Edit a photo
edit_photoUse this to change one of the user's photos while keeping the rest the same: the outfit, colours, background, an object, the expression ("change her top to red", "make it night"). To put a specific item into the photo, pass its picture as image with use "add" and say where it goes in the instruction ("she holds the bottle up next to her face"). To dress the influencer in a specific garment, pass its picture as image with use "wear" and garment_category; the instruction isn't needed. To change the photo's shape (a square photo made 9:16 for stories, a portrait made landscape), pass aspect_ratio; the scene is extended to fill the new frame and the person stays the same. The instruction is optional then, and it can go with any other change; a try-on keeps the shape. Costs 1 credit and makes a new photo; the original is kept. Say the cost before calling. Returns at once with a generation_id; then call get_generation (usually 15 to 40 seconds). Calling it again starts and charges a new edit.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"photo_id": "<photo_id>"
},
"name": "edit_photo"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| use | No | What the image is for: "add" an item to the photo (default) or "wear" a garment. | |
| image | No | An image: an upload_id from upload_image (for a file the user has), a photo_id of one of the user's photos, or an https:// link to an image. The item to add or the garment to wear. | |
| photo_id | Yes | The photo to edit: a photo_id from get_generation or list_media. | |
| instruction | No | What to change, or where the added item goes. Optional when aspect_ratio is the only change. | |
| aspect_ratio | No | A new shape for the photo: 9:16 for stories and reels, 3:4 for feed posts, 1:1 square, 16:9 or 4:3 landscape. Leave out to keep its shape. | |
| garment_category | No | For use "wear": tops, bottoms, or one-pieces (a dress or jumpsuit). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | Present only on a refusal: the summary says why, and what the user can do. | |
| kind | No | ||
| summary | Yes | ||
| photo_id | No | The new photo. | |
| view_url | No | ||
| error_code | No | Present only on a refusal. | |
| aspect_ratio | No | ||
| credits_left | No | ||
| generation_id | No | ||
| credits_charged | No | ||
| source_photo_id | No | ||
| expected_seconds | No |