Skip to content

Edit

Edit modifies an existing image based on your text instructions. Like generate, there are three content types — each handles edits differently.

Pixel-level changes: swap backgrounds, add or remove objects, change style or lighting.

Terminal window
depicta edit image photo.png "Make the sky more dramatic with storm clouds"

The API takes the source image as an HTTPS URL. To edit a local file, upload it first with POST /v1/upload; the CLI does this for you.

Terminal window
# 1. Upload the local file (skip if the image already has an HTTPS URL)
curl -X POST https://api.depicta.ai/v1/upload \
-H "Authorization: Bearer dpct_YOUR_API_KEY" \
-F "image=@photo.png"
# → {"upload_url": "https://media.depicta.ai/...", ...}
# 2. Edit it
curl -X POST https://api.depicta.ai/v1/edit/image \
-H "Authorization: Bearer dpct_YOUR_API_KEY" \
-H "Content-Type: application/json" \
--max-time 900 \
-d '{"input_image_url": "UPLOAD_URL", "prompt": "Make the sky more dramatic with storm clouds"}'

Style and shape changes: recolor, resize elements, change proportions.

Terminal window
depicta edit graphic icon.png "Change the color to blue and make it bolder"

API endpoint: POST /v1/edit/graphic

Structural changes: move boxes, add connections, relabel nodes.

Terminal window
depicta edit diagram architecture.png "Add a load balancer between the client and the API servers"

API endpoint: POST /v1/edit/diagram

Provide the source image as:

  • File path — depicta edit image photo.png "..."
  • URL — depicta edit image https://example.com/photo.png "..."
  • Stdin — cat photo.png | depicta edit image - "..."
  • API upload — use POST /v1/upload first, then reference the URL

Like generate, edit operations accept up to 5 reference images to guide the result — useful when you want the edit to match a particular style or color palette. The limit depends on the model: mai and mai-fast accept only the source image, so they take no references.

Terminal window
depicta edit image photo.png "Restyle in this art direction" --reference style-guide.png:"Warm tones, painterly"

See Generate — Reference images for full details.

Without --model, edits use your default model if it can edit, otherwise gemini. See Models.

Same format as generate — signed URLs for PNG, JPEG, WebP.