# AI 形象照

# 概述 (Overview)
用 AI 形象照生成器，把您的照片變成令人驚豔的專業形象照。透過強大的 AI 工具，快速又有效地提升您的形象照品質，達到專業級成果。
* 風格多樣：從適合 LinkedIn 的專業形象照、商務大頭照，到創意型模特兒照，AI 形象照生成器幫您挑出最對味的造型。
* 專業成果：用 AI 確保形象照自然又上相，讓未來的雇主與客戶留下深刻印象。
* 方便省力：隨時隨地生成多張 AI 形象照，不必請攝影師。忙碌的職場人最佳選擇。

更多 AI 形象照風格請見 https://yce.makeupar.com/ai-headshot-generator。
使用案例：
![AI Headshot Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/yce_headshot_s2_img_03_4b55742358.jpg)
![AI Headshot Generator](https://bcw-media.s3.ap-northeast-1.amazonaws.com/yce_headshot_s1_img_1_d03183d7e0.jpg)
拍攝建議：
![Suggestions for How to Shoot](https://bcw-media.s3.ap-northeast-1.amazonaws.com/AI_Hair_Extension_recommendation_ba24bd5d92.png)


---

## 整合指南 (Integration Guide)
* AI 形象照使用指南

本指南說明如何準備來源圖片、挑選範本，以及執行 AI 形象照任務。


---

* 步驟 1. 列出預設範本

用**範本 API**（`/s2s/v2.0/task/template/headshot`）列出預設範本，並將範本的 `id` 作為 `template_id` 使用。


---

* 步驟 2. 準備來源圖片

用 **File API**（`/s2s/v2.0/file/headshot`）上傳來源圖片，並將回應中的 `file_id` 作為 `src_file_id` 使用。您也可以直接傳公開可取的圖片 URL 作為 `src_file_url`，跳過 File API。


---

* 步驟 3. 建立 AI 任務

用 **AI 任務 API**（`/s2s/v2.0/task/headshot`），傳入範本 ID、來源圖片與要生成的照片張數：

```bash
curl --request POST \
  --url https://yce-api-01.makeupar.com/s2s/v2.0/task/headshot \
  --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}'
```
> 單張輸出任務：`/s2s/v2.0/task/headshot-single` 每個任務恰好輸出一張照片，與上述端點並存。請求欄位相同但不含 `output_count`——傳入 `output_count` 會回傳 `InvalidParameters`。輸出的 `data.results` 是帶有 `url` 欄位的單一物件，不是陣列。



---

* 步驟 4. 輪詢任務結果

用建立任務回應裡的 `task_id` 查詢狀態。單張輸出任務則改查 `/s2s/v2.0/task/headshot-single/{task_id}`。

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


---

* 步驟 5. 取得結果

成功的回應會包含結果照片的下載 URL。單張輸出任務的 `data.results` 以帶有 `url` 欄位的單一物件回傳，而非陣列。

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


---

## 檔案規格與錯誤 (File Specs & Errors)
* 支援格式與尺寸

| AI 功能 | 支援尺寸 | 支援檔案大小 | 支援格式 |
|  --- | --- | --- | --- |
| AI 形象照 | 輸入圖片需包含單一人物，且以 OpenPose 偵測標準需可見雙肩關節與完整臉部——否則輸入短邊超過 1024 像素時，引擎會自動縮至 1024。輸出：長邊 <= 1024 | < 10MB | jpg/jpeg/png |

* 錯誤碼

| Error Code | Description |
|  --- | --- |
| exceed_max_filesize | 輸入檔案大小超過上限 |
| invalid_parameter | 參數值無效 |
| error_download_image | 下載來源圖片失敗 |
| error_decode_image | 解析來源圖片失敗 |
| error_nsfw_content_detected | 來源圖片偵測到 NSFW 內容 |



---

## 點數消耗 (Unit Consumption)
| AI 功能 | 消耗點數 |
|  --- | --- |
| AI 形象照 V1.0 | 2 張 1 點 * |
|  | 1 張 0.5 點 |

> *若圖片張數或影片長度無法整除，點數無條件進位。



---

License: Privacy policy

## Servers

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

## Security

### BearerAuthenticationV2

使用標準的 'Bearer authentication'。請在標頭中放入您的 'API Key'：`Authorization:Bearer YOUR_API_KEY`。請注意 'Bearer' 與 'YOUR_API_KEY' 之間有一個空格。

Type: http
Scheme: bearer

## Download OpenAPI description

 - [AI 形象照](https://docs.perfectcorp.com/_bundle/@l10n/zh-TW/reference/ai_headshot_generator.yaml)

## V1.0

 - [GET /s2s/v2.0/task/template/headshot](https://docs.perfectcorp.com/zh-tw/reference/ai_headshot_generator/v1.0/paths/~1s2s~1v2.0~1task~1template~1headshot/get.md)
 - [POST /s2s/v2.0/task/headshot](https://docs.perfectcorp.com/zh-tw/reference/ai_headshot_generator/v1.0/paths/~1s2s~1v2.0~1task~1headshot/post.md): AI 任務是非同步的。當功能支援 webhook 時，請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章，並在收到 `success` 或 `error` 通知後，使用收到的 `task_id` 查詢任務結果。設定與驗證細節請見 [webhook 整合指南](/develop/webhook)。 若您的整合不支援 webhook 或無法使用
 - [GET /s2s/v2.0/task/headshot/{task_id}](https://docs.perfectcorp.com/zh-tw/reference/ai_headshot_generator/v1.0/paths/~1s2s~1v2.0~1task~1headshot~1%7Btask_id%7D/get.md)
 - [POST /s2s/v2.0/task/headshot-single](https://docs.perfectcorp.com/zh-tw/reference/ai_headshot_generator/v1.0/paths/~1s2s~1v2.0~1task~1headshot-single/post.md): AI 任務是非同步的。當功能支援 webhook 時，請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章，並在收到 `success` 或 `error` 通知後，使用收到的 `task_id` 查詢任務結果。設定與驗證細節請見 [webhook 整合指南](/develop/webhook)。 若您的整合不支援 webhook 或無法使用
