Inpaint V2
Purpose
Redraws part of an image with AI based on a prompt. Upload the image and describe what should be redrawn. This is the same feature as the V2 tab of the web app's "Inpaint" page (the default tab).
Credit cost: 3
Method and Path
POST /public/v1/image-tune/inpaint/v2
Authentication
See the Authentication page. Bearer token is required.
Required Headers:
Authorization: Bearer {your_api_key}
Request Fields
Send the request as multipart/form-data.
| Field Name | Type | Required | Description |
|---|---|---|---|
| image | file | Yes | Original image file to inpaint (PNG or JPEG) |
| prompt | string | Yes | What part should be redrawn? The prompt is sent as-is |
Prompt guidelines
- Describe the area to redraw and the desired result in detail
- Examples:
"Change background to blue sky","Remove object in upper right corner"
Response
Success Response (200 OK):
{
"job_id": "uuid-string"
}
| Field | Type | Description |
|---|---|---|
| job_id | string | Unique identifier for the created job. Use Get Job Status to retrieve results |
Error / Validation Rules
| Condition | HTTP Status | Error Message |
|---|---|---|
| Image is not a valid PNG or JPEG file | 400 | "Invalid image file" |
| Invalid API key | 401 | "Invalid API key" |
| Missing field | 422 | Validation error |
Async Job Behavior
This endpoint creates an asynchronous job. It immediately returns a job_id, and the inpaint runs in the background.
Polling Method:
- Save the
job_idreceived in the response - Poll
GET /public/v1/job/{job_id}to check status - When status becomes
Succeed, check the result image inimage_urls
Status Flow: Pending → Succeed or Failed
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"
Response Example:
{
"job_id": "550e8400-e29b-41d4-a716-446655440000"
}