Function: transferStyle()
transferStyle(
opts):Promise<TransferStyleResult>
Defined in: packages/agentos/src/api/transferStyle.ts:170
Restyles a source image after a style reference, sending the provider both.
With no provider named, the first provider whose key is set serves:
Replicate (REPLICATE_API_TOKEN), Fal (FAL_API_KEY), Stability
(STABILITY_API_KEY), then OpenAI (OPENAI_API_KEY). A named provider
without a style transfer that takes both images is refused, and so is a
model its style transfer does not run, both before either image is read.
Parameters
opts
TransferStyleOptions
Style transfer options.
Returns
Promise<TransferStyleResult>
Promise resolving to the transfer result with styled image(s).
Throws
When the arguments are refused, no style transfer provider is configured, the provider or model cannot run one, an image or option is refused, or the provider fails.
Example
// Photo to oil painting
const result = await transferStyle({
image: photoBuffer,
styleReference: './monet.jpg',
prompt: 'Impressionist oil painting, warm golden light, visible brushstrokes',
strength: 0.7,
});