# AI Studio Generator

# Overview
Embrace the excellence of studio-like AI Portrait Generator. Transform your selfie into a studio-quality portrait in a flash​.
* Studio-Free Convenience: No need for a photographer or studio visits—create studio-quality artistic photos anytime, anywhere​
* Quick Photo Transformation: Fast processing for instant high-quality artistic photo results, ideal for quick updates
* High-Quality Artistic Output: Delivers professional-standard artistic photos with clear details, perfect lighting, just like you've taken the photos in a studio

Use cases:
![AI Studio Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/yce_web_AI_studio_S1_img_19b627b6af.jpg)
![AI Studio Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/yce_web_AI_studio_S2_img_01_2e318817e9.jpg)
Suggestions for How to Shoot:
![Suggestions for How to Shoot](https://bcw-media.s3.ap-northeast-1.amazonaws.com/AI_Hair_Extension_recommendation_ba24bd5d92.png)


---

## Integration Guide
* AI Studio Generator Usage Guide

This guide explains how to prepare a source image, choose a template, and run AI Studio Generator tasks.


---

* Step 1. List Predefined Templates

Use the **Template API** (`/s2s/v2.0/task/template/ai-studio`) to list the predefined templates, and use the `id` of a template as `template_id`.


---

* Step 2. Prepare a Source Image

Use the **File API** (`/s2s/v2.0/file/ai-studio`) to upload a source image, and use the `file_id` from the response as `src_file_id`. You can also pass a publicly accessible image URL as `src_file_url` and skip the File API.


---

* Step 3. Create an AI Task

Use the **AI Task API** (`/s2s/v2.0/task/ai-studio`) with a template ID, a source image, and the number of photos to generate:

```bash
curl --request POST \
  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/ai-studio \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'content-type: application/json' \
  --data '{"template_id":"YOUR_TEMPLATE_ID","src_file_url":"https://example.com/selfie.jpg","output_count":10}'
```
> Single photo task: `/s2s/v2.0/task/ai-studio-single` outputs exactly one photo per task and coexists with the endpoint above. The request is the same, without `output_count` - sending `output_count` returns `InvalidParameters`. The output `data.results` is a single object with a `url` field, not an array.



---

* Step 4. Poll for Task Result

Use the `task_id` from the run response to check the status. For a single photo task, check `/s2s/v2.0/task/ai-studio-single/{task_id}` instead.

```bash
curl --request GET \
  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/ai-studio/YOUR_TASK_ID \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'content-type: application/json'
```


---

* Step 5. Retrieve Result

A successful response includes download URLs for the result photos. A single photo task returns `data.results` as one object with a `url` field, not an array.

```json
{
  "status": 200,
  "data": {
    "error": null,
    "results": {
      "output": [
        { "url": "https://example.com/sample-result-url" }
      ]
    },
    "task_status": "success"
  }
}
```


---

## File Specs & Errors
* Supported Formats & Dimensions

| AI Feature | Supported Dimensions | Supported File Size | Supported Formats |
|  --- | --- | --- | --- |
| AI Studio | Please ensure the input image has one face, a short side of at least 200 pixels, and a long side no greater than 1920 pixels; the engine will select the largest face if multiple are present, and the output resolution will not exceed 960×1280 (W×H) | < 10MB | jpg/jpeg/png |

* Error Codes

| Error Code | Description |
|  --- | --- |
| error_below_min_image_size | Input image resolution is too small |
| error_exceed_max_image_size | Input image resolution is too large |



---

## Unit Consumption
| AI Feature | Unit Consumed |
|  --- | --- |
| AI Studio Generator V3.0 | 1 unit for 2 images * |
|  | 0.5 unit for 1 image |

> *If the number of images or video duration isn’t evenly divisible, units round up.



---

License: Privacy policy

## Servers

```
https://yce-api-01.makeupar.com
```

## Security

### BearerAuthenticationV2

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'.

Type: http
Scheme: bearer

## Download OpenAPI description

 - [AI Studio Generator](https://docs.perfectcorp.com/_bundle/reference/ai_studio_generator.yaml)

## V3.0

 - [GET /s2s/v2.0/task/template/ai-studio](https://docs.perfectcorp.com/reference/ai_studio_generator/v3.0/paths/~1s2s~1v2.0~1task~1template~1ai-studio/get.md)
 - [POST /s2s/v2.0/task/ai-studio](https://docs.perfectcorp.com/reference/ai_studio_generator/v3.0/paths/~1s2s~1v2.0~1task~1ai-studio/post.md): Please refer to the polling guide for checking task status. Requires a source image, template ID, and output count configuration.
 - [GET /s2s/v2.0/task/ai-studio/{task_id}](https://docs.perfectcorp.com/reference/ai_studio_generator/v3.0/paths/~1s2s~1v2.0~1task~1ai-studio~1%7Btask_id%7D/get.md)
 - [POST /s2s/v2.0/task/ai-studio-single](https://docs.perfectcorp.com/reference/ai_studio_generator/v3.0/paths/~1s2s~1v2.0~1task~1ai-studio-single/post.md): Please refer to the polling guide for checking task status. Requires a source image and a template ID. This endpoint always outputs exactly one photo, so `output_count` is not accepted: sending it ret
 - [GET /s2s/v2.0/task/ai-studio-single/{task_id}](https://docs.perfectcorp.com/reference/ai_studio_generator/v3.0/paths/~1s2s~1v2.0~1task~1ai-studio-single~1%7Btask_id%7D/get.md)
