Edit
Edit modifies an existing image based on your text instructions. Like generate, there are three content types — each handles edits differently.
Content types
Section titled “Content types”Edit image
Section titled “Edit image”Pixel-level changes: swap backgrounds, add or remove objects, change style or lighting.
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.
# 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 itcurl -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"}'import httpx
headers = {"Authorization": "Bearer dpct_YOUR_API_KEY"}
with open("photo.png", "rb") as f: upload = httpx.post( "https://api.depicta.ai/v1/upload", headers=headers, files={"image": f} ).json()
response = httpx.post( "https://api.depicta.ai/v1/edit/image", headers=headers, json={ "input_image_url": upload["upload_url"], "prompt": "Make the sky more dramatic with storm clouds", }, timeout=900, # generations can take several minutes)Edit graphic
Section titled “Edit graphic”Style and shape changes: recolor, resize elements, change proportions.
depicta edit graphic icon.png "Change the color to blue and make it bolder"API endpoint: POST /v1/edit/graphic
Edit diagram
Section titled “Edit diagram”Structural changes: move boxes, add connections, relabel nodes.
depicta edit diagram architecture.png "Add a load balancer between the client and the API servers"API endpoint: POST /v1/edit/diagram
Input methods
Section titled “Input methods”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/uploadfirst, then reference the URL
Reference images
Section titled “Reference images”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.
depicta edit image photo.png "Restyle in this art direction" --reference style-guide.png:"Warm tones, painterly"See Generate — Reference images for full details.
Models
Section titled “Models”Without --model, edits use your default model if it can edit, otherwise gemini. See Models.
Response
Section titled “Response”Same format as generate — signed URLs for PNG, JPEG, WebP.