Edit request with source image, prompt, and optional mask.
Generation result with the edited image(s).
When the provider is not initialised or the API fails.
Upscales an image using a Replicate upscaling model.
Defaults to nightmareai/real-esrgan which supports 2x and 4x upscaling
via the scale input parameter.
Upscale request with source image and desired scale factor.
Generation result with the upscaled image.
When the provider is not initialised or the API fails.
The model a style transfer runs on for modelId, or a refusal. An empty
id takes the configured default when it is one of
REPLICATE_STYLE_TRANSFER_MODELS, else FLUX.2 Pro. A named model
must be one of them, unless the provider's base URL is not Replicate's;
it is run by its name on the model endpoint, so a pinned version
(owner/name:version) is refused.
The model the call names, or an empty string.
For a model the style transfer does not run.
Restyles an image after a style reference on a FLUX.2 model, which takes
both as input_images, the source first, with an instruction that names
them by index ("point to other reference images by their index number",
https://replicate.com/black-forest-labs/flux-2-pro). FLUX.2 takes no
strength and no negative prompt: strength picks the instruction (see
styleTransfer.ts), and the output keeps the source's aspect ratio
(match_input_image) unless providerOptions.input sets another.
The call's prompt and its two images are what it sends, so a
providerOptions.input naming prompt, input_images, image or
input_image is refused, and so is providerOptions.extraBody, which
could pin another version or replace the input. The prediction must end
succeeded; a failed, canceled or unfinished one throws.
The source, the reference and the prompt.
Generation result with the restyled image(s).
When the provider is not initialised, the model, an image or an option is refused, the API fails, the prediction does not succeed, or its output holds no image.
Readonly providerOptional default
Edits an image using a Replicate model that supports image-to-image input.
Uses
black-forest-labs/flux-fillfor inpainting (when a mask is provided) or falls back tostability-ai/sdxlfor generic img2img transforms. The source image goes in the model input as a data URL of its type, or, from 1 MB, as a file uploaded to Replicate's Files API.