POST /image-tune/inpaint/v2
Purpose
This endpoint naturally modifies specific parts of an image using AI. It modifies designated areas based on the uploaded image and prompt to produce the desired result.
Method and Path
- HTTP Method:
POST - Path:
/public/v1/image-tune/inpaint/v2
Authentication
This endpoint requires Bearer Token authentication. See the Authentication Guide for details.
Required Headers:
Authorization: Bearer {your_api_key}
Request Fields
Form Data (multipart/form-data)
| Field Name | Type | Required | Description |
|---|---|---|---|
image | file | Required | Original image file to inpaint (PNG, JPG, JPEG, etc.) |
prompt | string | Required | Text prompt describing what to inpaint |
quality | string | Required | Quality level. Allowed values: standard, pro |
Prompt Guidelines
- Describe the area to inpaint and the desired result in detail
- Examples:
"Change background to blue sky","Remove object in upper right corner"
Response
JobIdResponse
| Field Name | Type | Description |
|---|---|---|
job_id | UUID | Unique identifier for the created job. Use this ID to check job status |
Error / Validation Rules
| HTTP Status Code | Error Condition | Description |
|---|---|---|
400 Bad Request | Invalid image file | Invalid image file |
401 Unauthorized | Authentication failed | Invalid API key or missing authentication header |
404 Not Found | User not found | User associated with API key cannot be found |
422 Unprocessable Entity | Validation failed | Required field missing |
Async Job Behavior
This endpoint is processed asynchronously. It immediately returns a job_id, and actual inpaint processing occurs in the background.
Job Flow:
- Send the image file and prompt to immediately receive a
job_id - Inpaint processing occurs in the background
- Poll the
GET /job/{job_id}endpoint to check status - When
statuschanges toSucceed, check the result image URL inimage_urls
Recommended Polling Interval: 1-2 seconds
Example Request
cURL
curl -X POST "https://api.aetherforgeai.com/public/v1/image-tune/inpaint/v2" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "image=@/path/to/your/image.png" \
-F "prompt=Change background to blue sky" \
-F "quality=standard"
Response Example
{
"job_id": "550e8400-e29b-41d4-a716-446655440000"
}