Skip to main content

Split Layer

Purpose

This endpoint separates uploaded images into layers. It extracts specific elements from the image as individual layers based on keywords.

Method and Path

  • HTTP Method: POST
  • Path: /public/v1/image-tune/split-layer

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 NameTypeRequiredDescription
imagefileRequiredOriginal image file to split into layers (PNG, JPG, JPEG, etc.)
keywordstringRequiredKeyword specifying the element to separate

Keyword Guidelines

  • Enter a keyword describing the image element you want to separate
  • Examples: "arm", "body", "leg"

Response

JobIdResponse

Field NameTypeDescription
job_idUUIDUnique identifier for the created job. Use this ID to check job status

Error / Validation Rules

HTTP Status CodeError ConditionDescription
400 Bad RequestInvalid image fileInvalid image file
401 UnauthorizedAuthentication failedInvalid API key or missing authentication header
404 Not FoundUser not foundUser associated with API key cannot be found
422 Unprocessable EntityValidation failedRequired field missing

Async Job Behavior

This endpoint is processed asynchronously. It immediately returns a job_id, and actual layer split processing occurs in the background.

Job Flow:

  1. Send the image file and keyword to immediately receive a job_id
  2. Layer split processing occurs in the background
  3. Poll the GET /job/{job_id} endpoint to check status
  4. When status changes to Succeed, check the separated layer image URLs in image_urls

Recommended Polling Interval: 1-2 seconds

Example Request

cURL

curl -X POST "https://api.aetherforgeai.com/public/v1/image-tune/split-layer" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "image=@/path/to/your/image.png" \
-F "keyword=character"

Response Example

{
"job_id": "550e8400-e29b-41d4-a716-446655440000"
}