Edit a photo
edit_imageEdit a photo with one of 19 AI operations. Credit costs: remove_background 10, replace_background 3, everything else 100.
Operations and their required arguments:
remove_background (image_url)
replace_background (image_url, prompt)
retouch (image_url, prompt)
skin (image_url)
hair (image_url, plus hairstyle or reference_image_url)
makeup (image_url)
age (image_url, target_age)
expression (image_url, target_expression)
body_type (image_url, target_body_type)
eye_color (image_url, target_eye_color)
color_correction (image_url)
custom (image_url, prompt)
clothes (image_url, clothes_image_url)
try_on (image_url, clothes_image_url)
product (image_url, product_image_url)
upscale (image_url)
restore (image_url)
face_swap (source_image_url, target_image_url)
extend (image_url)
Every image argument must be a CDN URL from upload_image.
Requires a connected Photo AI Studio account. Calling this tool starts the sign-in flow.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | No | Text prompt for replace_background, retouch, and custom | |
| hairstyle | No | Target hairstyle for the hair operation | |
| image_url | No | CDN URL of the image to edit, required for every operation except face_swap | |
| operation | Yes | The edit operation to perform | |
| hair_color | No | Target hair color for the hair operation | |
| num_images | No | Number of variations for try_on (1-4) | |
| target_age | No | Target age for the age operation | |
| wait_for_result | No | Wait up to 55 seconds for the result before returning. Defaults to false: the tool returns a prediction_id immediately and you poll get_prediction, which is the reliable pattern for photos and videos. | |
| source_image_url | No | Source face image for face_swap | |
| target_body_type | No | Target body type | |
| target_eye_color | No | Target eye color | |
| target_image_url | No | Target image for face_swap | |
| clothes_image_url | No | Clothes image for clothes and try_on | |
| product_image_url | No | Product image for the product operation | |
| target_expression | No | Target expression, for example "happy" | |
| reference_image_url | No | Reference image for hair or custom |