edit_image
Apply 19 AI operations to edit photos, including background removal, skin retouching, age change, face swap, and more. Choose an operation and provide the required inputs.
Instructions
Edit a photo using one of 19 AI operations. Credit costs: remove_background (10), replace_background (3), all others (100).
Operations:
remove_background: Remove image background (image_url required)
replace_background: Replace background with prompt (image_url, prompt required)
retouch: AI retouch with prompt guidance (image_url, prompt required)
skin: Smooth and enhance skin (image_url required)
hair: Change hairstyle (image_url required, hairstyle or reference_image_url)
makeup: Apply AI makeup (image_url required)
age: Change apparent age (image_url, target_age required)
expression: Change facial expression (image_url, target_expression required)
body_type: Modify body type (image_url, target_body_type required)
eye_color: Change eye color (image_url, target_eye_color required)
color_correction: Auto color correction (image_url required)
custom: Custom AI edit with prompt (image_url, prompt required)
clothes: Change clothes (image_url, clothes_image_url required)
try_on: Virtual clothes try-on (image_url, clothes_image_url required)
product: Product placement (image_url, product_image_url required)
upscale: Enhance resolution (image_url required)
restore: Restore old/damaged photo (image_url required)
face_swap: Swap faces between photos (source_image_url, target_image_url required)
extend: Extend image canvas (image_url required)
All image URLs must be CDN URLs from upload_image.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | The edit operation to perform | |
| image_url | No | CDN URL of the image to edit (required for all operations except face_swap) | |
| prompt | No | Text prompt for replace_background, retouch, custom operations | |
| hairstyle | No | Target hairstyle for hair operation | |
| hair_color | No | Target hair color for hair operation | |
| reference_image_url | No | Reference image URL for hair or custom operations | |
| target_age | No | Target age for age operation | |
| target_expression | No | Target expression for expression operation (e.g. "happy", "serious") | |
| target_body_type | No | Target body type for body_type operation | |
| target_eye_color | No | Target eye color for eye_color operation | |
| clothes_image_url | No | Clothes image URL for clothes/try_on operations | |
| product_image_url | No | Product image URL for product operation | |
| source_image_url | No | Source face image for face_swap operation | |
| target_image_url | No | Target image for face_swap operation | |
| num_images | No | Number of variations for try_on operation | |
| wait_for_result | No | If true (default), waits for the result. If false, returns prediction_id immediately. |