Prompt-based image editing

Prompt-based editing lets you modify a specific part of an image by describing the change you want to see. The API uses a context image and generates a new version based on your instruction.

Basic example

Let's us try to remove a blue car from below photo.

And the result is

Parameters of background generate section

Parameter

Description

description

Text prompt describing the edit you want to apply.

model_type

Model used for editing. Example: gemini-3-pro-image-preview. Other models

adapter_type

Adapter that defines the editing mode. Use img2img for editing based on an existing image.

context_images

Array of URLs to source images used as context for the edit.

width

Target width of the output image.

height

Target height of the output image.

Notes

  • Use clear and specific prompts (e.g., “remove a blue car”, “replace sky with sunset”).

  • The output size is controlled by width and height.

  • context_images must be publicly accessible URLs.

Example prompt variations

Last updated