openapi: 3.0.0
info:
title: AI Hair Style Virtual Try-On
description: "# Overview\nUsing the latest AI technology to try a wide variety of hairstyles, catering\
\ to both women and men, meeting different gender and style preference.\nDiscover a world of styles:\
\ curly, long, buzz cut, and more. Our AI-powered hair changer lets you experiment effortlessly. Find\
\ your ideal hairstyle now!\n\n\n\
\n---\n\n## Integration Guide\n\n* API Playground\nYou can use the API Playground to test the AI Hairstyle\
\ Generator feature. This allows you to experiment with your ideas and gain a better understanding\
\ of the try-on process.\n\nAccess the API Playground at:\n\n\
\n---\n\n* API Workflow\nThis guide walks you through:\n\nWorkflow for AI Hairstyle Generator API:\n\
\n**Endpoint:** `/s2s/v2.1/task/hair-transfer`\n\n**Authentication Required:** `Authorization: Bearer\
\ YOUR_API_KEY`\n\n**Workflow Steps:**\n\n1. **Image Upload Preparation:**\n - The process begins\
\ with preparing a selfie.\n\n2. **List predefined templates or using your own reference photo**\n\
\ **Choose Reference Source**\nYou have two options for styling references:\n\n| Option | Use Case\
\ | Implementation Tip |\n|-------|-----------|---------------------|\n| **Predefined Templates**\
\ (`template_id`) | Quick start (e.g., \"Curly Bob\", \"Side-Swept Bangs\") | Call `/s2s/v2.1/task/template/hair-transfer`\
\ and pick `template_id`. |\n| **Custom Reference Image** (`ref_file_url` / `ref_file_id`) | User\
\ uploads own style photo or uses provided image link | Upload via same file API;
Use `ref_file_url`\
\ if your reference image is already hosted online. |\n\n3. **Initiate AI Task and Obtain Task ID:**\n\
\ - Send the uploaded image along with the style configuration via an HTTP POST request to `/s2s/v2.0/file`.\n\
\ - Await a unique task ID in the response, which identifies this interaction.\n\n4. **Poll Task\
\ Status (Continuous Check):**\n - Use the obtained `task_id` to periodically poll the task status\
\ using an HTTP GET request (e.g., `GET /task/${task_id}`).\n - Continuously monitor for:\n \
\ - `Task_status = \"success\"` (process completed).\n - `Task_status = \"error\"` (resolve or\
\ retry if applicable).\n - Update the workflow accordingly once the status transitions to success.\n\
\nThis structured workflow ensures efficient integration with user inputs, automated monitoring of\
\ tasks, and seamless retrieval of results.\n\n---\n\n* Authentication\n- Include your API key in\
\ the request header using **Bearer Token**:\n ```\n Authorization: Bearer YOUR_API_KEY\n \
\ ```\nYou can find your API Key at https://yce.makeupar.com/api-console/en/api-keys/.\n\n---\n\n\
* API Usage Guide\n\nThis guide explains how to upload images, prepare reference images, and create\
\ virtual try-on tasks using the AI Hairstyle Generator API.\n\n***\n\n * Step 1. Upload a File\
\ Using the File API or provide a valid image URL\n\nUse the **File API** (`/s2s/v2.0/file`) to upload\
\ a target user image.\n\nAlternatively, skip step 1 to 3 if you already have a public image URL.\n\
\n**Image Requirements:**\n\n* Upload a high-resolution selfie photo.\n* Ensure the photo clearly\
\ shows the entire body.\n* Avoid backgrounds with multiple people or distracting objects.\n\n**Example\
\ Request:**\n\n```bash\ncurl --request POST \\\n --url https://yce-api-01.makeupar.com/s2s/v2.0/file\
\ \\\n --header 'Authorization: Bearer YOUR_API_KEY' \\\n --header 'content-type: application/json'\
\ \\\n --data '{\n \"files\": [\n {\n \"content_type\": \"image/jpg\",\n \"\
file_name\": \"selfie_01_3dbd1b6683.jpg\",\n \"file_size\": 547541\n }\n ]\n }'\n\
```\n\n***\n\n * Step 2. Retrieve File API Response\n\nThe response includes:\n\n* `file_id` for\
\ creating an AI task.\n* `requests.url` for uploading the actual image file.\n\n**Sample Response:**\n\
\n```json\n{\n \"status\": 200,\n \"data\": {\n \"files\": [\n {\n \"content_type\"\
: \"image/jpg\",\n \"file_name\": \"full_body_photo_01_3dbd1b6683.jpg\",\n \"file_id\"\
: \"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9/13W5TOD8/u/FfjK3xgCQ+hRt9MJXBFaud\",\n \"requests\": [\n\
\ {\n \"method\": \"PUT\",\n \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...\"\
,\n \"headers\": {\n \"Content-Length\": \"547541\",\n \"Content-Type\"\
: \"image/jpg\"\n }\n }\n ]\n }\n ]\n }\n}\n```\n\n***\n\n *\
\ Step 3. Upload Image to Provided URL\n\nUse the `requests.url` from the File API response to upload\
\ the image:\n\n```bash\ncurl --location --request PUT 'https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...'\
\ \\\n --header 'Content-Type: image/jpg' \\\n --header 'Content-Length: 547541' \\\n --data-binary\
\ @'./full_body_photo_01_3dbd1b6683.jpg'\n```\n\n***\n\n * Step 4. Prepare a Reference Image\n\n\
\ * 4.1 Fetch Predefined Image Templates\n\nUse the **Template API** (`/s2s/v2.1/task/template/hair-transfer`)\
\ to retrieve a list of predefined reference templates:\n\n```bash\ncurl --request GET \\\n --url\
\ 'https://yce-api-01.makeupar.com/s2s/v2.1/task/template/hair-transfer?page_size=20&starting_token=73a3c9e69b89'\
\ \\\n --header 'Authorization: Bearer YOUR_API_KEY'\n```\n\n * 4.2 Upload a Reference Image\n\
\nYou can:\n\n* Upload an reference image using the File API (`/s2s/v2.0/file`), or\n* Provide\
\ a valid image URL.\n\n**Supported Images:**\n\n* Another selfie photo as an reference image.\n\
\nRefer to **[File Specs and Errors](#section/overview/File-Specs-and-Errors)** for detailed specifications.\n\
\n***\n\n * Step 5. Create an AI Hairstyle Generator Task\n\nUse the **AI Task API** (`/s2s/v2.1/task/hair-transfer`)\
\ to create a virtual try-on task.\n\n**Parameters:**\n\n* For the user image: `src_file_id` or\
\ `src_file_url`.\n* For the reference image: `ref_file_id`, `ref_file_url`, or `template_id`.\n\
\n**Example Request:**\n\n```bash\ncurl --request POST \\\n --url https://yce-api-01.makeupar.com/s2s/v2.1/task/hair-transfer\
\ \\\n --header 'Authorization: Bearer YOUR_API_KEY' \\\n --header 'content-type: application/json'\
\ \\\n --data '{\n \"src_file_url\": \"https://plugins-media.makeupar.com/strapi/assets/selfie_03_cccd5d4803.jpeg\"\
,\n \"ref_file_url\": \"https://plugins-media.makeupar.com/strapi/assets/style_reference_full_body_01_5a000d999f.png\"\
\n }'\n```\n\n**Sample Response:**\n\n```json\n{\n \"status\": 200,\n \"data\": {\n \"task_id\"\
: \"SaGaqpDgKwFrVBgMpQMA3HY0LeqdT9_13W5TOD8_u_GPi6NqQ3dhlmN-6ntFwhzT\"\n }\n}\n```\n\n***\n\n *\
\ Step 6. Poll for Task Result\n\nUse the task ID to check the status:\n\n```bash\ncurl --request\
\ GET \\\n --url https://yce-api-01.makeupar.com/s2s/v2.1/task/hair-transfer/ \\\n\
\ --header 'Authorization: Bearer YOUR_API_KEY' \\\n --header 'content-type: application/json'\n\
```\n\n***\n\n * Step 7. Retrieve Result\n\nA successful response includes a download URL for the\
\ result image:\n\n```json\n{\n \"status\": 200,\n \"data\": {\n \"error\": null,\n \"results\"\
: {\n \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/demo/ttl30/...signature...\"\n \
\ },\n \"task_status\": \"success\"\n }\n}\n```\n\nInvalid API Key error response:\n\n```json\n\
{\n \"status\": 401,\n \"error\": \"Unauthorized\",\n \"error_code\": \"InvalidAccessToken\"\n\
}\n```\n\n---\n\nUse cases:\nUse case:\n\n\
\nSuggestions for How to Shoot:\n\n\
\n## File Specs & Errors\n* Supported Formats & Dimensions\n\n|AI Feature|Supported Dimensions|Supported\
\ File Size|Supported Formats|\n| ---- | ---- | ---- | ---- |\n|AI Hairstyle Generator|long side\
\ <= 1024, face width >= 128, face pose: -10 < pitch < +10, -45 < yaw < +45, -15 < roll < +15, single\
\ face only, need to show full face|< 10MB|jpg/jpeg|\n\n* Error Codes\n\n|Error Code|Description|\n\
| ---- | ---- |\n|error_no_shoulder\t|Shoulders are not visible in the source image\n|error_large_face_angle\t\
|The face angle in the uploaded image is too large\n|error_insufficient_landmarks\t|Cannot detect\
\ sufficient face or body landmarks in the source image\n|error_hair_too_short\t|Input hair is too\
\ short\n|error_face_pose\t|The face pose of source image is unsupported\n\n* Environment & Dependency\n\
\n| Sample Code Language / Tool | Recommended Runtime Versions |\n|---|---|\n| cURL | - bash >= 3.2\
\ - curl >= 7.58 (modern TLS/HTTP support) - jq >= 1.6 (robust JSON parsing) |\n| Node.js\
\ (JavaScript) | Node >= 18 (for global fetch) |\n| JavaScript | - Chrome / Edge >= 80 - Firefox\
\ >= 74 - Safari >= 13.1 |\n| PHP | PHP >= 7.4 (for modern TLS/compat), ext-curl (recommended)\
\ or allow_url_fopen=On + ext-openssl, ext-json |\n| Python | Python >= 3.10 (for f-strings), requests\
\ >= 2.20.0 |\n| Java | Java 11+ (for HttpClient), Jackson Databind >= 2.12.0 |\n\n---\n\n## FAQ\n\
**Q: Can I try on a custom hairstyle?**\n\n**A:** Absolutely, you can try on a custom hairstyle using\
\ your own reference photo. The AI Hairstyle Generator supports two methods for specifying the desired\
\ hairstyle:\n\n1. **Upload your own reference image**\n You may upload a high-resolution selfie\
\ or style photo (e.g., someone wearing the target hairstyle) via the File API (`/s2s/v2.0/file`).\
\ After uploading, use the returned `file_id` or public URL as the reference source when creating\
\ the AI task.\n\n2. **Provide a valid image URL**\n If your reference image is already hosted online\
\ (e.g., on your own server or CDN), you can directly supply its HTTPS URL in the request body under\
\ the field `ref_file_url`.\n\nWhen submitting the task via `/s2s/v2.1/task/hair-transfer`, include\
\ either:\n- `src_file_id` (your selfie) and `ref_file_id` (your custom reference image),\nor\n- `src_file_url`\
\ and `ref_file_url`.\n\nEnsure both images meet the specified requirements:\n- Supported format:\
\ JPG/JPEG only\n- File size under 10 MB\n- Long side ≤ 1024 pixels\n- Face width ≥ 128 pixels\n-\
\ Head pose within allowed range (pitch: −10° to +10°, yaw: −45° to +45°, roll: −15° to +15°)\n- Single\
\ face visible, full frontal view with clear hair visibility\n\nThis flexibility allows you to apply\
\ virtually any hairstyle from a photo reference, not just predefined templates.\n\n---\n\n## Unit\
\ Consumption\n\n| AI Feature | Unit Consumed |\n|---|---|\n| AI Hair Style Virtual Try-On V2.0 |\
\ 1 unit for Preset Mode
2 units for Custom Mode |\n| AI Hair Style Virtual Try-On V2.1 | 2 units\
\ for Preset Mode
2 units for Custom Mode |\n\n---\n"
version: ''
termsOfService: https://www.makeupar.com/perfectbeauty/youcam/terms-of-service-api
contact:
email: YouCamOnlineEditor_API@perfectcorp.com
license:
name: Privacy policy
url: https://www.makeupar.com/perfectbeauty/youcam/privacy-policy-api
servers:
- url: https://yce-api-01.makeupar.com
tags:
- name: V2.1
description: Powered by updated AI technology and new style templates, the platform can create new hairstyles,
apply specific template‑based looks, and transfer styles from user‑provided reference images.
- name: V2.0
description: By enabling hairstyle creation directly from a user‑provided reference image, the solution
also supports AI‑driven style generation and template‑based applications with the latest engine.
- name: V1.0
description: Generate new hairstyles, apply specific hair styles via templates using AI technology.
paths:
/s2s/v2.0/task/template/hair-style:
get:
summary: List predefined templates.
tags:
- V1.0
security:
- BearerAuthenticationV2: []
parameters:
- name: page_size
in: query
schema:
type: integer
example: 20
description: Number of results to return in this page. Valid value should be between 1 and 20.
Default 20.
- name: starting_token
in: query
schema:
type: string
example: 73a3c9e69b89
description: Token for current page. Start with `null` for the first page, and use `next_token`
from the previous response to start next page
responses:
'200':
$ref: '#/components/responses/TemplateResponse'
'400':
$ref: '#/components/responses/InvalidParameters'
'401':
$ref: '#/components/responses/InvalidApiKey'
/s2s/v2.0/task/hair-style:
post:
summary: Run an AI Hairstyle Generator task.
description: 'AI tasks are asynchronous. Prefer webhook-based completion handling when the feature
supports webhooks. Configure your webhook endpoint, verify webhook signatures, and use the received
`task_id` to query the task result after a `success` or `error` notification. See the [webhook
integration guide](/develop/webhook.md) for setup and verification details.
If webhooks are not supported for the feature, or if your integration cannot use webhooks, implement
polling. After starting an AI task, keep polling the task status endpoint at the given `polling_interval`
until the task status is either `success` or `error`.
Do not stop polling a running task for longer than the allowed polling window. If the task is
not polled in time, the task may expire; a later status check can return `InvalidTaskId` even
if processing finished, and the consumed units may still be charged.
'
tags:
- V1.0
security:
- BearerAuthenticationV2: []
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/RunWithSingleTemplateAndSrcUrl'
responses:
'200':
description: Successful execution of the AI Hairstyle Generator task
content:
application/json:
schema:
$ref: '#/components/schemas/BasicRunTaskResponseV2'
'400':
description: Failed execution of task
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/RunError'
'401':
$ref: '#/components/responses/InvalidApiKey'
'429':
$ref: '#/components/responses/TooManyRequests'
/s2s/v2.0/task/hair-style/{task_id}:
get:
summary: Check the status of a AI Hairstyle Generator task.
tags:
- V1.0
security:
- BearerAuthenticationV2: []
parameters:
- name: task_id
in: path
required: true
schema:
type: string
example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe
description: ID of task to check
responses:
'200':
description: Successful check of the AI Hairstyle Generator task status
content:
application/json:
schema:
$ref: '#/components/schemas/TaskStatusResponseV2'
'400':
$ref: '#/components/responses/InvalidTaskId'
'401':
$ref: '#/components/responses/InvalidApiKey'
'500':
$ref: '#/components/responses/TaskTimeout'
/s2s/v2.0/task/hair-transfer:
post:
summary: Run an AI Hairstyle Generator task with reference.
description: 'AI tasks are asynchronous. Prefer webhook-based completion handling when the feature
supports webhooks. Configure your webhook endpoint, verify webhook signatures, and use the received
`task_id` to query the task result after a `success` or `error` notification. See the [webhook
integration guide](/develop/webhook.md) for setup and verification details.
If webhooks are not supported for the feature, or if your integration cannot use webhooks, implement
polling. After starting an AI task, keep polling the task status endpoint at the given `polling_interval`
until the task status is either `success` or `error`.
Do not stop polling a running task for longer than the allowed polling window. If the task is
not polled in time, the task may expire; a later status check can return `InvalidTaskId` even
if processing finished, and the consumed units may still be charged.
'
tags:
- V2.0
security:
- BearerAuthenticationV2: []
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/BasicRunTaskV2WithRequiredRef'
responses:
'200':
description: Successful execution of the AI Hairstyle Generator task
content:
application/json:
schema:
$ref: '#/components/schemas/BasicRunTaskResponseV2'
'400':
description: Failed execution of task
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/RunError'
'401':
$ref: '#/components/responses/InvalidApiKey'
'429':
$ref: '#/components/responses/TooManyRequests'
/s2s/v2.0/task/hair-transfer/{task_id}:
get:
summary: Check the status of a AI Hairstyle Generator task with reference.
tags:
- V2.0
security:
- BearerAuthenticationV2: []
parameters:
- name: task_id
in: path
required: true
schema:
type: string
example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe
description: ID of task to check
responses:
'200':
description: Successful check of the AI Hairstyle Generator task status
content:
application/json:
schema:
$ref: '#/components/schemas/TaskStatusResponseV2'
'400':
$ref: '#/components/responses/InvalidTaskId'
'401':
$ref: '#/components/responses/InvalidApiKey'
'500':
$ref: '#/components/responses/TaskTimeout'
/s2s/v2.1/task/template/hair-transfer:
get:
summary: List predefined templates v2.1.
tags:
- V2.1
security:
- BearerAuthenticationV2: []
parameters:
- name: page_size
in: query
schema:
type: integer
example: 20
description: Number of results to return in this page. Valid value should be between 1 and 20.
Default 20.
- name: starting_token
in: query
schema:
type: string
example: 73a3c9e69b89
description: Token for current page. Start with `null` for the first page, and use `next_token`
from the previous response to start next page
responses:
'200':
$ref: '#/components/responses/TemplateResponse'
'400':
$ref: '#/components/responses/InvalidParameters'
'401':
$ref: '#/components/responses/InvalidApiKey'
/s2s/v2.1/task/hair-transfer:
post:
summary: Run an AI Hairstyle Generator v2.1 task.
description: 'AI tasks are asynchronous. Prefer webhook-based completion handling when the feature
supports webhooks. Configure your webhook endpoint, verify webhook signatures, and use the received
`task_id` to query the task result after a `success` or `error` notification. See the [webhook
integration guide](/develop/webhook.md) for setup and verification details.
If webhooks are not supported for the feature, or if your integration cannot use webhooks, implement
polling. After starting an AI task, keep polling the task status endpoint at the given `polling_interval`
until the task status is either `success` or `error`.
Do not stop polling a running task for longer than the allowed polling window. If the task is
not polled in time, the task may expire; a later status check can return `InvalidTaskId` even
if processing finished, and the consumed units may still be charged.
'
tags:
- V2.1
security:
- BearerAuthenticationV2: []
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/RunHairTransferTaskV2.1'
responses:
'200':
description: Successful execution of the task
content:
application/json:
schema:
$ref: '#/components/schemas/BasicRunTaskResponseV2'
'400':
description: Failed execution of task
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/RunError'
'401':
$ref: '#/components/responses/InvalidApiKey'
'429':
$ref: '#/components/responses/TooManyRequests'
/s2s/v2.1/task/hair-transfer/{task_id}:
get:
summary: Check the status of a AI Hairstyle Generator v2.1 task.
tags:
- V2.1
security:
- BearerAuthenticationV2: []
parameters:
- name: task_id
in: path
required: true
schema:
type: string
example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe
description: ID of task to check
responses:
'200':
description: Successful check of the task status
content:
application/json:
schema:
$ref: '#/components/schemas/TaskStatusResponseV2'
'400':
$ref: '#/components/responses/InvalidTaskId'
'401':
$ref: '#/components/responses/InvalidApiKey'
'500':
$ref: '#/components/responses/TaskTimeout'
components:
securitySchemes:
BearerAuthenticationV2:
type: http
scheme: bearer
description: 'Use the standard ''Bearer authentication''. Put your ''API Key'' in header: `Authorization:Bearer
YOUR_API_KEY`. Notice that there is '' '' a space between ''Bearer'' and the ''YOUR_API_KEY''.'
schemas:
RunHairTransferTaskV2.1Template:
required:
- template_id
properties:
template_id:
type: string
description: ID of the template. List predefined templates first, and use the id of a template.
example: good_template_001
hair_color:
type: string
enum:
- ref
- src
default: ref
description: Specifies the hair color of the output image (source/reference), default reference
color.
*Applies only to templates where the keep_user_color parameter is true, meaning
the user’s original hair color is preserved. When the parameter is false, the template’s predefined
color overrides the user’s hair color. Custom reference images always use the hair color from
the reference image.
RunHairTransferTaskV2.1:
allOf:
- title: Provide exactly one of ref_file_id, ref_file_url, or template_id
not:
required:
- ref_file_url
- template_id
- title: Provide exactly one of ref_file_id, ref_file_url, or template_id
not:
required:
- ref_file_id
- template_id
- anyOf:
- allOf:
- title: Run task with src file url & ref file url
required:
- ref_file_url
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileUrl'
- $ref: '#/components/schemas/BasicRunTaskV2RefFileUrl'
- allOf:
- title: Run task with src file url & ref file ID
required:
- ref_file_id
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileUrl'
- $ref: '#/components/schemas/BasicRunTaskV2RefFileId'
- allOf:
- title: Run task with src file ID & ref file url
required:
- ref_file_url
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileId'
- $ref: '#/components/schemas/BasicRunTaskV2RefFileUrl'
- allOf:
- title: Run task with src file ID & ref file ID
required:
- ref_file_id
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileId'
- $ref: '#/components/schemas/BasicRunTaskV2RefFileId'
- allOf:
- title: Run task with src file url and template
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileUrl'
- $ref: '#/components/schemas/RunHairTransferTaskV2.1Template'
- allOf:
- title: Run task with src file ID and template
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileId'
- $ref: '#/components/schemas/RunHairTransferTaskV2.1Template'
Template:
type: object
properties:
id:
type: string
description: The ID of the template. Use this as \`template_id\` when run task.
example: good_template_001
thumb:
type: string
description: The thumbnail of style.
title:
type: string
description: The title of the template.
category_name:
type: string
description: The category name of the template.
keep_users_color:
type: boolean
description: Indicates whether the template supports preserving the user's original hair color
instead of applying only the template's predefined color.
RunWithSingleTemplate:
title: RunWithSingleTemplate
type: object
properties:
template_id:
type: string
description: ID of the template. List predefined templates first, and use the id of a template.
example: good_template_001
required:
- template_id
BasicRunTaskV2SrcFileUrl:
type: object
required:
- src_file_url
properties:
src_file_url:
type: string
description: Url of the file to run task. The url should be publicly accessible.
example: https://example.com/selfie.jpg
BasicRunTaskV2SrcFileId:
type: object
required:
- src_file_id
properties:
src_file_id:
type: string
description: ID of file to run task. File ID from upload file API.
example: pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE=
BasicRunTaskV2:
title: BasicRunTaskV2
anyOf:
- title: Run task with src file url
allOf:
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileUrl'
- title: Run task with src file ID
allOf:
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileId'
RunWithSingleTemplateAndSrcUrl:
title: RunWithSingleTemplateAndSrcUrl
allOf:
- $ref: '#/components/schemas/RunWithSingleTemplate'
- $ref: '#/components/schemas/BasicRunTaskV2'
BasicRunTaskResponseV2:
type: object
properties:
status:
type: integer
description: Response status
example: 200
data:
type: object
properties:
task_id:
type: string
description: ID of this task. Task result is valid to query by this ID for 24 hours.
example: grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe
RunError:
type: object
properties:
status:
type: integer
description: Response status
example: 400
error:
type: string
description: Error message
example: The operation could not be completed
error_code:
type: string
enum:
- InvalidParameters
- CreditInsufficiency
- InvalidStyleGroup
- InvalidStyle
- BadRequest
description: "Error code:\n * InvalidParameters - Invalid request parameters\n * CreditInsufficiency\
\ - Insufficient unit to run\n * BadRequest - Unexpected request parameter\n * InvalidStyleGroup\
\ - Invalid style group id\n * InvalidStyle - Invalid style id\n"
EngineErrorCode:
type: string
nullable: true
enum:
- error_exceed_max_image_size
- exceed_max_filesize
- invalid_parameter
- error_download_image
- error_download_mask
- error_decode_image
- error_decode_mask
- error_nsfw_content_detected
- error_no_face
- error_pose
- error_face_parsing
- error_inference
- exceed_nsfw_retry_limits
- error_upload
- unknown_internal_error
description: 'Errors:
- \`error_exceed_max_image_size\` - Input image size exceeds the maximum limit
- \`exceed_max_filesize\` - Input file size exceeds the maximum limit
- \`invalid_parameter\` - Invalid parameter value
- \`error_download_image\` - Download source image error
- \`error_download_mask\` - Download mask image error
- \`error_decode_image\` - Decode source image error
- \`error_decode_mask\` - Decode mask image error
- \`error_nsfw_content_detected\` - NSFW content detected in source image
- \`error_no_face\` - No face detected on source image
- \`error_pose\` - Failed to detect pose on source image
- \`error_face_parsing\` - Failed to do face segmentation on source image
- \`error_inference\` - Inference pipeline error
- \`exceed_nsfw_retry_limits\` - Exceed the retry limits to avoid generated NSFW image
- \`error_upload\` - Upload result image error
- \`unknown_internal_error\` - Others
'
TaskStatusResponseBodySingleUrlResultsV2:
type: object
properties:
url:
type: string
description: URL to download this result. Valid for 2 hours
example: https://example.com/sample-result-url
TaskStatusResponseV2:
type: object
properties:
status:
type: integer
description: Response status
example: 200
data:
type: object
properties:
task_status:
type: string
enum:
- running
- success
- error
description: Status of this task
error:
$ref: '#/components/schemas/EngineErrorCode'
error_message:
type: string
description: Detailed description of error
results: null
$ref: '#/components/schemas/TaskStatusResponseBodySingleUrlResultsV2'
BasicRunTaskV2RefFileUrl:
type: object
properties:
ref_file_url:
type: string
description: Url of the reference file to run task. The url should be publicly accessible.
example: https://example.com/accessory.jpg
BasicRunTaskV2RefFileId:
type: object
properties:
ref_file_id:
type: string
description: ID of the reference file to run task. File ID from upload file API.
example: pfNK5PuRe0MrwLHcGA3DOmB1ahwfXTbYHjv+KoBIxbE=
BasicRunTaskV2WithRequiredRef:
title: BasicRunTaskV2WithRef
anyOf:
- allOf:
- title: Run task with src file url & ref file url
required:
- ref_file_url
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileUrl'
- $ref: '#/components/schemas/BasicRunTaskV2RefFileUrl'
- allOf:
- title: Run task with src file url & ref file ID
required:
- ref_file_id
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileUrl'
- $ref: '#/components/schemas/BasicRunTaskV2RefFileId'
- allOf:
- title: Run task with src file ID & ref file url
required:
- ref_file_url
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileId'
- $ref: '#/components/schemas/BasicRunTaskV2RefFileUrl'
- allOf:
- title: Run task with src file ID & ref file ID
required:
- ref_file_id
- $ref: '#/components/schemas/BasicRunTaskV2SrcFileId'
- $ref: '#/components/schemas/BasicRunTaskV2RefFileId'
responses:
TemplateResponse:
description: Successful retrieval of styles
content:
application/json:
schema:
type: object
properties:
status:
type: integer
description: Response status
example: 200
data:
type: object
properties:
templates:
type: array
items:
$ref: '#/components/schemas/Template'
next_token:
type: string
example: 73a3c9e69b89
description: Token to query next page.
InvalidParameters:
description: Invalid request parameters
content:
application/json:
schema:
type: object
properties:
status:
type: integer
example: 400
description: Response status
error:
type: string
example: Invalid parameter value
error_code:
type: string
example: InvalidParameters
InvalidApiKey:
description: Invalid or missing API key
content:
application/json:
schema:
type: object
properties:
status:
type: integer
example: 401
description: Response status
error:
type: string
example: Invalid API key
TooManyRequests:
description: Too many requests
content:
application/json:
schema:
type: object
properties:
status:
type: integer
example: 429
description: Response status
error:
type: string
example: Too many requests
InvalidTaskId:
description: Invalid task ID
content:
application/json:
schema:
type: object
properties:
status:
type: integer
example: 400
description: Response status
error:
type: string
example: Invalid task ID
TaskTimeout:
description: Task execution timeout
content:
application/json:
schema:
type: object
properties:
status:
type: integer
example: 500
description: Response status
error:
type: string
example: Task execution timed out