/generate/prompt-editing

[DEPRECATED] This API is deprecated.

Edit an image with a prompt.

Note: Please use POST /generate/custom/{modelId} endpoint instead. You can retrieve the model inputs from the GET /models/{modelId} endpoint. Use one of the following models:

  • model_bytedance-seedream-4-editing
  • model_flux-kontext-editing
  • model_google-gemini-2-5-flash-image-editing
  • model_openai-gpt-image-1-editing
  • model_qwen-image-editing
  • model_runway-gen4-image-editing

or one of your Kontext LoRA.

See https://docs.scenario.com/docs/edit-images-with-prompts for more details.

Query Params
string

If set to true, returns the original asset without transformation

string
Body Params
string
required

The image to edit. Must reference an existing AssetId or be a data URL.

referenceImages
array of strings

List of additional reference images as a data URLs (example: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=") or the asset IDs (example: "asset_GTrL3mq4SXWyMxkOHRxlpw").

5 additional reference images are allowed for the gemini-2.0-flash, gemini-2.5-flash and gpt-image-1 models. 3 additional reference images are allowed for the flux-kontext model. No additional reference images are allowed for the flux-kontext model if using concepts. 2 additional reference images are allowed for the runway-gen4-image model.

referenceImages
number

The seed to use for the image generation.

Only available for the flux-kontext model.

number

The strength

Only available for the flux-kontext LoRA model.

number

The guidance scale to use for the image generation.

Only available for the flux-kontext model.

string
enum
Defaults to gemini-2.5-flash

The model to use. Can be "gemini-2.0-flash", "gemini-2.5-flash", "gpt-image-1", "flux-kontext", "runway-gen4-image" or "seedream-4".

Allowed:
string
enum
Defaults to png

The format of the generated image(s)

This parameter is only supported for the gpt-image-1 model.

Allowed:
string
enum
Defaults to auto

The aspect ratio of the generated image(s). Supported for: gemini-2.5-flash, gpt-image-1, flux-kontext, runway-gen4-image, seedream-4. Will default to auto for other models and unknown ratios.

Notes:

  • gemini-2.5-flash supports Landscape: 21:9, 16:9, 4:3, 3:2 • Square: 1:1 • Portrait: 9:16, 3:4, 2:3 • Flexible: 5:4, 4:5 • auto.
  • gpt-image-1 supports 1:1, 3:2, 2:3, auto (unknown ratios fall back to auto).
  • runway-gen4-image supports 1:1, 4:3, 3:4, 16:9, 9:16, auto (unknown ratios fall back to auto).
  • seedream-4 supports 1:1, 4:3, 3:4, 16:9, 9:16, 2:3, 3:2, 21:9, auto.
string
enum
Defaults to low

When set to high, allows to better preserve details from the input images in the output. This is especially useful when using images that contain elements like faces or logos that require accurate preservation in the generated image.

You can provide multiple input images that will all be preserved with high fidelity, but keep in mind that the first image will be preserved with richer textures and finer details, so if you include elements such as faces, consider placing them in the first image.

Only available for the gpt-image-1 model.

Allowed:
string
enum
Defaults to high

The quality of the generated image(s).

Only available for the gpt-image-1, flux-kontext, runway-gen4-image and seedream-4 models.

Allowed:
concepts
array of objects

Flux Kontext LoRA to style the image. For Flux Kontext Prompt Editing.

concepts
number

The number of samples to generate

Maximum depends on the subscription tier.

number

The compression level (0-100%) for the generated images. This parameter is only supported for the gpt-image-1 model with the webp or jpeg output formats, and defaults to 100.

string
required

The prompt to edit the given image.

string

You can provide a mask to indicate where the image should be edited. The black area of the mask will be replaced, while the filled areas will be kept as is.

Must reference an existing AssetId or be a data URL.

Only available for the gpt-image-1 model. Will be ignored for other models.

Responses

Language
Credentials
Header
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json