Edit request with source image buffer and prompt.
Generation result containing the edited image(s).
When the provider is not initialised.
When the API returns an HTTP error status.
https://platform.openai.com/docs/api-reference/images/createEdit
The model a style transfer runs on for modelId, or a refusal. An empty
id takes the configured default when it is one of
OPENAI_STYLE_TRANSFER_MODELS, else Sunburst. A named model must be
one of them, unless the provider's base URL is not OpenAI's: a custom
endpoint may serve any name.
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 through /v1/images/edits,
which takes "up to 16 images" for the GPT Image models (openai-node,
src/resources/images.ts): the source and the reference go as two
image[] parts, the source first, with an instruction that names them.
The endpoint has no strength, seed or negative prompt: strength picks
the instruction (see styleTransfer.ts), and the others are not sent.
Before the request, the images are checked to be PNG, WebP or JPEG files
under 50 MB each, and the prompt as sent to be at most 32,000 characters.
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 the prompt is refused, the API returns an HTTP error status, or the answer holds no image.
Makes variations of an image through the /v1/images/edits endpoint, with
a GPT image model and a prompt that asks for a variation. OpenAI retired
/v1/images/variations and the DALLĀ·E models it served: "Use the image
edits endpoint with a GPT Image model and a prompt to create a variation
of an image" (openai-node, src/resources/images.ts).
The edits endpoint has no strength parameter, so variance picks the
prompt: below 0.5 asks for a close variation, otherwise a looser one.
Variation request with the source image buffer.
Generation result containing the variation image(s).
When the provider is not initialised.
When the API returns an HTTP error status.
https://github.com/openai/openai-node/blob/master/src/resources/images.ts
Readonly providerOptional default
Edits an image using the OpenAI
/v1/images/editsendpoint.Supports both img2img (prompt-guided transformation) and inpainting (mask-guided regional editing). The endpoint expects multipart form data with the source image and an optional mask.