{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/zh-TW/develop/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"youcam-cli","description":"YouCam API documentation by Perfect Corp. Learn how to use Skin analysis API, Virtual try-on API, Image editing API, and Video generative AI APIs.","siteUrl":"https://docs.perfectcorp.com","keywords":"AI Skin Analysis, AI Clothes, AI Hairstyle, AI Outfits","image":"/assets/favicon.cd6fa4d833b2a573b3c6dae68386b293da205b203402cb0c97b80bd2acc07ea2.8351e24f.png"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"youcam-cli","__idx":0},"children":["youcam-cli"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam"]}," 是 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://yce.perfectcorp.com/ai-api"},"children":["YouCam AI API"]}," 的命令列介面。它的每一項 AI 功能（臉部與身體編輯、頭髮、肌膚檢測、彩妝、虛擬試穿、背景與照片編輯、影像與影片生成⋯等）都在終端機中執行，使用與 API 相同的模型與參數。您也可以檢查任務狀態、瀏覽預先定義的範本，以及查詢您的點數與功能費用。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["無論您是在評估某項功能、建構整合，或自動化一條流程，CLI 都能派上用場："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["評估 YouCam API 的 AI 功能"]},"：在您自己的照片上執行某項功能並檢查結果，例如比較風格，或確認某項功能是否符合您的產品需求。無需寫程式。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["整合 API"]},"：在撰寫程式碼之前，先從終端機嘗試任何端點。選項與請求欄位一對一對對應，每項功能都連結到它的",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#available-ai-features"},"children":["API 參考文件"]},"。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AI agents"]},"：Claude Code、Cursor、Codex 及其他 agent，可以將任何 YouCam 功能當作一般的 shell 指令使用。每個指令都會輸出 JSON，失敗時以代碼 1 結束，每個功能與選項都在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--help"]}," 中自我說明，且在送出請求前就會拒絕無效的值。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["自動化與批次作業"]},"：透過 shell 腳本、CI 管線或容器，對整批產品照與人像執行功能。本地檔案會由您代為上傳，無需自行撰寫上傳步驟。"]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"需求","__idx":1},"children":["需求"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://nodejs.org/"},"children":["Node.js"]}," 18 以上版本"]},"（以及 npm）。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["一支 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://yce.perfectcorp.com/api-console/en/api-keys/"},"children":["YouCam API key"]},"。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"安裝","__idx":2},"children":["安裝"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install -g @youcam_cli/youcam-cli\n\n# 驗證安裝結果\nyoucam --help\n\n# YouCam CLI 的版本\nyoucam --version\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["若要解除安裝，請執行 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["npm uninstall -g @youcam_cli/youcam-cli"]},"。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"認證","__idx":3},"children":["認證"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam auth login <apiKey>"]}," 會一次儲存您的 API 金鑰，金鑰儲存在本地，之後每個指令都會重複使用它。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam auth login <apiKey>\n\n# 或以旗標明確指定\nyoucam auth login --api-key <apiKey>\n\n# 移除已儲存的 API 金鑰（登出 CLI 工具）\nyoucam auth logout\n\n# 列出可用的認證選項\nyoucam auth --help\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["auth login"]}," 會將金鑰寫入一個純 JSON 檔案，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["~/.youcam-cli/credentials.json"]},"："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"apiKey\": \"<your-api-key>\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["每個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["template"]}," 與 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client"]}," 指令都會自動讀取這個檔案。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["當設定了 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YOUCAM_CLI_API_KEY"]}," 環境變數時，它會優先於已儲存的金鑰。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"快速開始","__idx":4},"children":["快速開始"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["執行您的第一個 AI 任務，從檢查點數到下載結果。這會執行一個真實任務，因此會使用點數（見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#checking-feature-cost"},"children":["查詢功能費用"]},"）。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["每個 YouCam 功能都以背景任務執行：您啟動它，取得一個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]},"，然後檢查那個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]}," 直到結果就緒。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["1. 安裝並登入"]},"（詳細說明見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#installation"},"children":["安裝"]},"與",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#authentication"},"children":["認證"]},"）"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"npm install -g @youcam_cli/youcam-cli\nyoucam auth login <apiKey>\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["2. 檢查您的點數"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam client credit\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["回應："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": 200,\n  \"results\": [\n {\n  \"id\": 0,\n  \"type\": \"ApiPaygToken\",\n  \"amount\": 8193,\n  \"amount_dec\": 8193,\n  \"expiry\": 1801958399000\n }\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}," 是每個項目中的點數數量，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expiry"]}," 是到期時間（自 Unix epoch 起算的毫秒數）。這個指令名為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["credit"]},"，是因為 API 將一個單位稱為「credit」（見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#units-and-feature-cost"},"children":["點數與功能費用"]},"）。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["3. 啟動任務"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["這會使用 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_photo_enhance/v1.0/paths/~1s2s~1v2.0~1task~1enhance/post"},"children":["AI Photo Enhance"]}," 將一張範例照片修復為兩倍解析度："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run enhance --src_file \"https://plugins-media.makeupar.com/strapi/assets/hair_color_03_81c0c8a3c8.jpg\" --scale 2\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["回應："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": 200,\n  \"data\": {\n \"task_id\": \"32tu4jQvRbI9NfnKlw13cls8tyT1zA2ZoOtKq-RkiTL_FrIEOLYHJX1HxYVrnWz\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["CLI 也會印出下一步的指令。它會輸出到 stderr，因此 stdout 對腳本而言保持純粹的 JSON："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"執行 `youcam status enhance 32tu4jQvRbI9NfnKlw13cls8tyT1zA2ZoOtKq-RkiTL_FrIEOLYHJX1HxYVrnWz` 以檢查結果。\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["若要使用您自己的照片，請改傳本地路徑，例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--src_file ./photo.jpg"]},"。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["4. 檢查並下載結果"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam status enhance <task_id>\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["任務仍在處理時，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_status"]}," 為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["running"]},"；數秒後再次執行指令。完成後："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": 200,\n  \"data\": {\n \"error\": null,\n \"results\": {\n  \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/ttl30/.../509f8acd-8d41-4459-aa31-1d4738d7a922.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&...&X-Amz-Expires=7200&...\"\n },\n \"task_status\": \"success\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["results.url"]}," 就是增強後的圖片。它是一個簽章連結，2 小時後失效（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Amz-Expires=7200"]},"），請盡快下載。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["後續步驟"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["瀏覽",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#available-ai-features"},"children":["可用的 AI 功能"]},"，並執行 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run <feature> --help"]}," 查看該功能的選項。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["在",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#running-an-ai-task"},"children":["執行 AI 任務"]},"中了解選項、檔案與 JSON 參數的運作方式。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["有些功能會先偵測臉部或身體，見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#pre-process-face-and-body-detection"},"children":["前處理"]},"。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"點數與功能費用","__idx":5},"children":["點數與功能費用"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["點數是您使用 YouCam API 時消耗的額度，每個 AI 功能使用的數量不同。API（以及 CLI）將一個單位稱為「credit」，這就是指令名為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client credit"]}," 與 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["client credit-history"]}," 的原因。請見官方 FAQ 中的",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.perfectcorp.com/develop/faq"},"children":["「Unit（點數）是什麼？如何使用？」"]},"。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"檢查您的點數","__idx":6},"children":["檢查您的點數"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam client credit  # 剩餘點數\nyoucam client credit-history  # 點數使用歷史\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"查詢功能費用","__idx":7},"children":["查詢功能費用"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["在大量執行之前，先查詢某項功能會消耗多少點數。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam client feature-cost\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["兩個指令都以 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--page_size"]}," 與 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--starting_token <token>"]}," 進行結果分頁："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["credit-history"]},"：",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--page_size <1-30>"]},"，預設 20。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["feature-cost"]},"：",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--page_size <1-20>"]},"，預設 20。"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["註：",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#pre-process-face-and-body-detection"},"children":["前處理"]},"偵測任務與",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#listing-predefined-templates"},"children":["列出預先定義的範本"]},"不會消耗點數。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"指令總覽","__idx":8},"children":["指令總覽"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"youcam <command> [options]\n\nCommands:\n  auth Manage authentication credentials\n  run  Run an AI task\n  status  Check the status of an AI task\n  template   List predefined templates\n  client  Get account/credit info\n  help Display help for a command\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["每個指令與子指令都支援 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-h, --help"]},"，顯示它自己的用法與選項："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run --help\nyoucam run face-swap --help\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["結果以 JSON 輸出。指令在請求失敗時以代碼 1 結束。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"api--cli-指令對應","__idx":9},"children":["API ↔ CLI 指令對應"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.perfectcorp.com/"},"children":["API 參考文件"]},"中的每個端點，都能以可預期的方式對應到一個 CLI 指令："]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"REST 端點"},"children":["REST 端點"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"CLI 指令"},"children":["CLI 指令"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /s2s/v{ver}/task/{feature}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run <feature> [options]"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /s2s/v{ver}/task/{feature}/{task_id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam status <feature> <task_id>"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /s2s/v{ver}/task/{feature}/pre-process"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run pre-process <feature> [options]"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /s2s/v{ver}/task/{feature}/pre-process/{task_id}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam status pre-process <feature> <task_id>"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /s2s/v{ver}/task/template/{feature}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam template <feature> [--page_size] [--starting_token]"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["公開的 makeup-vto 圖樣目錄"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam template makeup-vto <categories...>"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /s2s/v1.0/client/credit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam client credit"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /s2s/v1.0/client/credit/history"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam client credit-history [--page_size] [--starting_token]"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /s2s/v2.0/credit/feature-cost"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam client feature-cost [--page_size] [--starting_token]"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /s2s/v2.0/file"]}," + 預簽章 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT"]}," 上傳"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["當檔案選項是本地路徑時自動完成（見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#uploading-files"},"children":["上傳檔案"]},"）"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["從 API 參考文件推導 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<feature>"]}," 的經驗法則："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["CLI 的功能名稱，是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{task_id}"]}," 之前的那個路徑段，例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/s2s/v2.0/task/abs-shape/{task_id}"]}," → ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["abs-shape"]},"。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["API 版本前綴（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v2.0"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v2.1"]},"⋯）由您代為處理：每個指令都會呼叫 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.perfectcorp.com/"},"children":["API 參考文件"]},"中最新的 API 版本，例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["skin-analysis"]}," 與 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hair-transfer"]}," 呼叫 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/s2s/v2.1/..."]},"。當某功能有多個引擎版本時，只提供最新版本，例如提供 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cloth-v4"]}," 而不提供 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cloth-v3"]},"。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["少數端點有一個額外的路徑段，去掉它即可得到 CLI 名稱："]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"API 路徑"},"children":["API 路徑"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"CLI 指令"},"children":["CLI 指令"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/s2s/v2.0/task/2d-vto/earring"]},"（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["necklace"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ring"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bracelet"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["watch"]}," 相同）"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run earring"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/s2s/v2.0/task/image-to-image/youcam"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/text-to-image/youcam"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/image-to-video/youcam"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/text-to-video/youcam"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run image-to-image"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run text-to-image"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run image-to-video"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run text-to-video"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/s2s/v2.0/task/colorize/color-correct"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run color-correct"]}]}]}]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["請求內容的屬性，會變成對應 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]}," 指令上的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--<property_name>"]}," 選項（見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#uploading-files"},"children":["上傳檔案"]},"與",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#passing-json-parameters"},"children":["傳遞 JSON 參數"]},"）。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["page_size"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["starting_token"]}," 等查詢參數也會變成 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--<param_name>"]}," 選項。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_hair_color/v1.0/paths/~1s2s~1v2.0~1task~1hair-color/post"},"children":["AI Hair Color Virtual Try-On"]}," 為例，它的兩個端點是："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"POST /s2s/v2.0/task/hair-color   { src_file_url | src_file_id, preset?, pattern?, palettes? }\nGET  /s2s/v2.0/task/hair-color/{task_id}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["對應到這些 CLI 指令："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run hair-color --src_file <url-or-path> [--preset <value> | --pattern <json> --palettes <json>]\nyoucam status hair-color <task_id>\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["要套用預設顏色："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run hair-color --src_file \"https://plugins-media.makeupar.com/strapi/assets/hair_color_09_76a7a1081e.jpg\" --preset \"Honey Blonde\"\nyoucam status hair-color <task_id>\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]}," 指令會送出這個請求內容："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"src_file_url\": \"https://plugins-media.makeupar.com/strapi/assets/hair_color_09_76a7a1081e.jpg\",\n  \"preset\": \"Honey Blonde\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["若要改套用自訂顏色，請傳入 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pattern"]}," 與 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["palettes"]}," 物件："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run hair-color --src_file \"https://plugins-media.makeupar.com/strapi/assets/hair_color_09_76a7a1081e.jpg\" \\\n  --pattern '{\"name\": \"full\"}' \\\n  --palettes '[{\"color\": \"#8B4513\", \"color_intensity\": 80, \"shine_intensity\": 50}]'\nyoucam status hair-color <task_id>\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["等價的 JSON 請求內容為："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"src_file_url\": \"https://plugins-media.makeupar.com/strapi/assets/hair_color_09_76a7a1081e.jpg\",\n  \"pattern\": { \"name\": \"full\" },\n  \"palettes\": [{ \"color\": \"#8B4513\", \"color_intensity\": 80, \"shine_intensity\": 50 }]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run"]}," 會印出新的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]},"；將它傳給 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam status"]}," 並重複執行，直到 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_status"]}," 為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["success"]},"。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"執行-ai-任務","__idx":10},"children":["執行 AI 任務"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["每個 AI 功能都是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]}," 的一個子指令。選項依功能而異；請對該功能使用 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--help"]}," 查看它的輸入。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run <feature> [options]\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例如，執行 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_abs_filter/v1.0/paths/~1s2s~1v2.0~1task~1abs-shape/post"},"children":["AI Abs Filter"]},"："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run abs-shape --src_file \"https://example.com/photo.jpg\" --mode \"Six-pack\" --intensity 2\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["執行任務會回傳一個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]},"，您用它來",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#checking-task-status"},"children":["檢查狀態"]},"。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["前處理："]}," 少數功能會先偵測照片中的臉部或身體，讓您可以選擇要處理哪一個人。見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#pre-process-face-and-body-detection"},"children":["前處理"]},"。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["範本："]}," 某些功能接受現成的風格預設，透過 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--template_id"]}," 指定。見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#listing-predefined-templates"},"children":["列出預先定義的範本"]},"。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["驗證："]}," 選項值會在送出之前，依 API schema 檢查。有固定值集合的選項會在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--help"]}," 中列出，無效的值會被拒絕並列出允許的選項。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"上傳檔案","__idx":11},"children":["上傳檔案"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["每個接受圖片或影片的功能，都將其暴露為單一的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--src_file"]}," 選項，儘管 API 接受兩個互斥的欄位：",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["src_file_url"]},"（公開網址）或 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["src_file_id"]},"（已上傳檔案的 ID）。CLI 會依您傳入的內容選擇正確的那一個："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["公開可存取的網址"]},"會以 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["src_file_url"]}," 送出。不會上傳任何東西。",{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run enhance --src_file \"https://example.com/photo.jpg\" --scale 2\n","lang":"bash"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["本地檔案路徑"]},"會由您代為上傳，任務以 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["src_file_id"]}," 送出：",{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /s2s/v2.0/file"]}," 註冊檔案（名稱、內容類型、大小），並回傳一個預簽章的上傳網址與一個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["file_id"]},"。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["檔案的位元組以 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PUT"]}," 傳送至該預簽章網址。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run <feature>"]}," 被呼叫時，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["src_file_id"]}," 設為那個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["file_id"]},"。"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run enhance --src_file ./photo.jpg --scale 2\n","lang":"bash"},"children":[]},"在 PowerShell 或 cmd 中，Windows 路徑也可以使用：",{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"powershell","header":{"controls":{"copy":{}}},"source":"youcam run enhance --src_file .\\photo.jpg --scale 2\n","lang":"powershell"},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["注意事項："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["本地檔案必須是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".jpg"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".jpeg"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".png"]}," 或 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".mp4"]},"。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["大小、解析度與長度限制依功能而異，過大的檔案會使任務失敗，在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," 中出現 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["exceed_max_filesize"]},"。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["沒有獨立的上傳 CLI 指令，上傳只透過檔案選項發生。"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"其他檔案選項","__idx":12},"children":["其他檔案選項"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["除了 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--src_file"]},"，某些功能需要額外的圖片（遮罩、參考照片、產品照）。它們遵循相同的規則：傳入公開網址或本地路徑，本地路徑會由您代為上傳。"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"選項"},"children":["選項"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"內容"},"children":["內容"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"值"},"children":["值"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"使用於"},"children":["使用於"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--src_file <input>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["主要來源照片或影片"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["單一"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["多數功能"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--src_files <inputs...>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["多張來源照片"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["多個"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hair-frizziness-detection"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hair-type-detection"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["image-to-image"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--ref_file <input>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["要複製的參考圖片（例如彩妝造型、一套服飾、一項產品）"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["單一"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bag"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cloth-v4"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eye-color-vto"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hair-transfer"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hat"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["mu-transfer"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ai-nail"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["scarf"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shoes-transfer"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bg-replace-vid"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["face-swap-vid"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--ref_files <inputs...>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["多張參考圖片（例如每個目標一張臉、產品照）"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["多個"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bracelet"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["earring"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["face-swap"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nail-vto"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["necklace"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ring"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["watch"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--msk_file <input>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["覆蓋來源的遮罩：白色標示要變更的區域，黑色維持原樣"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["單一"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["generative-fill"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["obj-replace"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["obj-rem-vid"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--srcmsk_file <input>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["在來源中隔離相關身體部位的遮罩（例如耳朵、頸部、手腕）"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["單一"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bracelet"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["earring"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["necklace"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ring"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["watch"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--refmsk_files <inputs...>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["對應每個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--ref_files"]}," 項目的遮罩，順序相同"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["多個"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bracelet"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["earring"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ring"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["watch"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["帶有 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["..."]}," 的選項，在同一個旗標後接受多個值，以空格分隔（不是逗號）："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run face-swap \\\n  --src_file group-photo.jpg \\\n  --ref_files person-a.jpg person-b.jpg \\\n  --face_mapping '[{\"index\":0,\"position\":0},{\"index\":1,\"position\":1}]'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["若某個多值選項混合了公開網址與本地路徑，例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--ref_files https://example.com/a.jpg ./b.jpg"]},"，其中的每個檔案都會被上傳，網址也包括在內：CLI 會下載每個網址、像本地檔案一樣上傳它，並將全部以檔案 ID 送出（例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ref_file_ids"]},"）。這些網址必須提供 JPG、PNG 或 MP4。若要讓網址以網址形式送出，在該選項中只傳網址。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["執行 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run <feature> --help"]}," 可查看該功能確實接受哪些選項。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"選項語法","__idx":13},"children":["選項語法"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["下列形式是等價的，請使用您偏好的寫法："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run skin-simulation --src_file https://example.com/face.png --acne 1\nyoucam run skin-simulation --src_file=https://example.com/face.png --acne=1\nyoucam run skin-simulation --src_file=\"https://example.com/face.png\" --acne=\"1\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["只有在值包含空格，或包含您的 shell 會特殊處理的字元（例如網址中的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["&"]},"，或 JSON）時，才需要引號。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["接受多個值的選項，可以在同一個旗標後以空格分隔，或以重複的旗標：",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--src_files a.jpg b.jpg"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--src_files=a.jpg --src_files=b.jpg"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["不是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--src_files=a.jpg b.jpg"]},"，這種寫法會被拒絕。"]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"傳遞-json-參數","__idx":14},"children":["傳遞 JSON 參數"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--help"]}," 中顯示為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<json>"]},"（而非 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<value>"]},"）的選項，對應 API 請求內容中的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}," 或 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["array"]}," 欄位。請將整個結構作為單一 JSON 值傳入："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["內嵌 JSON，例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--pattern '{\"name\":\"full\"}'"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["指向 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".json"]}," 檔案的路徑，例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--effects ./effects.json"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["用 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["-"]}," 從 stdin 讀取 JSON，例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cat effects.json | youcam run makeup-vto --src_file photo.jpg --effects -"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["內嵌 JSON 的引號："]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# bash / zsh / macOS / Linux / Git Bash：單引號可保護雙引號\nyoucam run hair-color --src_file photo.jpg --pattern '{\"name\":\"full\"}' --palettes '[{\"color\":\"#8B4513\",\"color_intensity\":80,\"shine_intensity\":50}]'\n\n# Windows PowerShell：跳脫內部的雙引號\nyoucam run hair-color --src_file photo.jpg --pattern '{\\\"name\\\":\\\"full\\\"}' --palettes '[{\\\"color\\\":\\\"#8B4513\\\",\\\"color_intensity\\\":80,\\\"shine_intensity\\\":50}]'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["巢狀物件與陣列："]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hair-color"]}," 的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--pattern"]}," 是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]},"，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--palettes"]}," 是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{color, color_intensity, shine_intensity}"]}," 物件的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["array"]},"（全染模式一個，漸層模式兩個）："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run hair-color \\\n  --src_file photo.jpg \\\n  --pattern '{\"name\":\"full\"}' \\\n  --palettes '[{\"color\":\"#FF5733\",\"color_intensity\":80,\"shine_intensity\":50}]'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["photo.jpg"]}," 上傳並解析成 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["src_file_id"]}," 後，CLI 會將這個內容送至 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /s2s/v2.0/task/hair-color"]},"："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"src_file_id\": \"<file_id from the upload>\",\n  \"pattern\": {\n \"name\": \"full\"\n  },\n  \"palettes\": [\n {\n  \"color\": \"#FF5733\",\n  \"color_intensity\": 80,\n  \"shine_intensity\": 50\n }\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["每個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--<option> <json>"]}," 的值，都原樣作為該屬性的值：",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--pattern"]}," 成為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pattern"]}," 物件，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--palettes"]}," 成為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["palettes"]}," 陣列。不會重新命名或重塑結構，也不會為未提供的選項加入預設值。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["深度巢狀陣列："]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["makeup-vto"]}," 的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--effects"]}," 是特效物件的陣列，其中一些有自己的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pattern"]}," 與 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["palettes"]},"。多行 JSON 也可以使用："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run makeup-vto --src_file photo.jpg --effects '[\n  {\"category\":\"skin_smooth\",\"skinSmoothStrength\":55,\"skinSmoothColorIntensity\":45},\n  {\"category\":\"blush\",\"pattern\":{\"name\":\"1color1\"},\"palettes\":[\n {\"color\":\"#e19f9f\",\"texture\":\"matte\",\"colorIntensity\":60}\n  ]}\n]'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1color1"]}," 等圖樣名稱來自 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam template makeup-vto"]},"（見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#listing-makeup-vto-pattern-names"},"children":["列出 makeup-vto 圖樣名稱"]},"）。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["無效的 JSON，或類型錯誤的值，會在送出請求前被拒絕，並指出問題欄位，例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invalid value for --palettes: [{\"color\":123}] (0.color: Invalid input: expected string, received number)"]},"。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"檢查任務狀態","__idx":15},"children":["檢查任務狀態"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam status <feature> <task_id>\n# 或\nyoucam status <feature> --task_id <task_id>\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["範例："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam status abs-shape 1234567890abcdef\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["輪詢直到 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_status"]}," 為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["success"]},"（或 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},"）；回應接著會包含結果，例如輸出檔案網址。若是前處理任務，請使用 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam status pre-process <feature> <task_id>"]},"。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"前處理臉部與身體偵測","__idx":16},"children":["前處理（臉部與身體偵測）"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["前處理任務不使用點數，只有主要任務會使用。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["對下列功能而言，一張照片可能包含多人，因此您要選擇處理哪一位。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run pre-process <feature>"]}," 會偵測照片中的臉部或身體，並以清單回傳。清單中每個對象依其在清單中的位置編號：第一位是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]},"，第二位是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},"，依此類推。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["偵測：",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run pre-process <feature> --src_file <photo>"]}," 回傳一個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]},"。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["讀取偵測結果：",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam status pre-process <feature> <task_id>"]}," 會列出偵測到的臉部或身體。清單的形式依功能而異：",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["body-reshape"]}," 回傳 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["results.result[]"]},"，為相對於圖片尺寸的框（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]},"–",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},"），而 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["face-swap"]}," 回傳 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["results.faces[].bbox"]},"，為像素框 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[x1, y1, x2, y2]"]},"（左上角與右下角）。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["在同一張照片上執行該功能，使用下表中的選項傳入您選擇的編號："]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"功能"},"children":["功能"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"接受偵測到的臉部或身體編號的選項"},"children":["接受偵測到的臉部或身體編號的選項"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["body-reshape"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--index <number>"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["face-lift"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--index <number>"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["face-reshape"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--index <number>"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fitzpatrick-scale-analyzer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--index <number>"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["teeth-whiten"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--index <number>"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["face-swap"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["每個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--face_mapping"]}," 項目中的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"position\""]},"。該項目的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"index\""]}," 決定要使用哪個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--ref_files"]}," 圖片"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例如，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run face-lift --src_file <photo> --index 1 ..."]}," 會拉提第二個偵測到的臉。完整執行與真實輸出請見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#example-workflow"},"children":["範例工作流程"]},"。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"列出預先定義的範本","__idx":17},"children":["列出預先定義的範本"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["有些功能附帶可直接使用的範本（風格或造型預設），您以 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--template_id"]}," 引用，不必自行建構參數。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam template <feature> [--page_size <1-20>] [--starting_token <token>]\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<feature>"]}," 為下列其中之一："]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"類別"},"children":["類別"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"功能"},"children":["功能"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["頭髮與鬍鬚"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hair-bang"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hair-curl"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hair-ext"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hair-transfer"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hair-vol"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["beard-style"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["彩妝與試妝"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["look-vto"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fabric"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["影像"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ai-avatar"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ai-studio"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["headshot"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bg-replace"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["影片"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["video-trans"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["關於 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["makeup-vto"]}," 的圖樣細節，請見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#listing-makeup-vto-pattern-names"},"children":["列出 makeup-vto 圖樣名稱"]},"。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["範例："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam template ai-avatar --page_size 10\nyoucam run ai-avatar --src_file ./photo.jpg --template_id <id> --output_count 1\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["將回應中的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["next_token"]}," 作為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--starting_token"]}," 傳入，即可取得下一頁。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["當 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ai-avatar"]}," 任務成功時，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam status ai-avatar <task_id>"]}," 會在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["results.output[].url"]}," 中列出生成的圖片，每個輸出有一個項目。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"列出-makeup-vto-圖樣名稱","__idx":18},"children":["列出 makeup-vto 圖樣名稱"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["makeup-vto"]}," 特效以名稱挑選形狀，例如腮紅的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"pattern\":{\"name\":\"1color1\"}"]},"，或唇色的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"shape\":{\"name\":\"plump\"}"]},"。列出每個特效類別的有效名稱："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam template makeup-vto <categories...>\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["傳入 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["blush"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bronzer"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contour"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eyebrows"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eyeliner"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eyeshadow"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eyelashes"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lipshape"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lipliner"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["highlighter"]}," 中的一個或多個（或在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--category"]}," 後使用相同名稱）。至少需要一個。這些目錄是公開的，因此列出它們不會使用點數。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam template makeup-vto blush lipshape\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["結果以類別為索引。使用項目的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["label"]}," 作為圖樣名稱；",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["colorNum"]},"（僅腮紅、眼線與眼影）表示該圖樣需要幾個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["palettes"]},"："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"blush\": [\n {\n  \"category\": \"1 color\",\n  \"label\": \"1color1\",\n  \"thumbnail\": \"https://app-cdn-01.makeupar.com/.../a53cd4f4-43b6-4e19-b85a-ec7a95c6a47f.jpg\",\n  \"tags\": [\n   { \"id\": 100, \"name\": \"Blush 3D\" },\n   { \"id\": 103, \"name\": \"Oblong\" }\n  ],\n  \"colorNum\": 1\n }\n  ],\n  \"lipshape\": [\n {\n  \"category\": \"general\",\n  \"label\": \"original\",\n  \"thumbnail\": \"https://plugins-media.makeupar.com/wcm-saas/images/lipshapes/original.png\",\n  \"tags\": []\n }\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["無法取得的類別會顯示 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"error\": \"...\" }"]},"，且指令以代碼 1 結束。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"可用的-ai-功能","__idx":19},"children":["可用的 AI 功能"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["將下列任一项作為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<feature>"]}," 傳給 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]}," 與 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]},"。每一項都連結到它的 API 參考頁面。有偵測步驟的功能請見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#pre-process-face-and-body-detection"},"children":["前處理"]},"。可與 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam template"]}," 搭配的功能請見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#listing-predefined-templates"},"children":["列出預先定義的範本"]},"。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"彩妝","__idx":20},"children":["彩妝"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/makeup_vto/v1.0/paths/~1s2s~1v2.0~1task~1makeup-vto/post"},"children":["makeup-vto"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#listing-makeup-vto-pattern-names"},"children":["圖樣名稱"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_makeup_transfer/v1.0/paths/~1s2s~1v2.0~1task~1mu-transfer/post"},"children":["mu-transfer"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_look_vto/v1.0/paths/~1s2s~1v2.0~1task~1look-vto/post"},"children":["look-vto"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_eye_color_lens/v1.0/paths/~1s2s~1v2.0~1task~1eye-color-vto/post"},"children":["eye-color-vto"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_nail_vto/v1.0/paths/~1s2s~1v2.0~1task~1nail-vto/post"},"children":["nail-vto"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_nail_transfer/v1.0/paths/~1s2s~1v2.0~1task~1ai-nail/post"},"children":["ai-nail"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"肌膚臉部與身體","__idx":21},"children":["肌膚、臉部與身體"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_face_analyzer/v1.0/paths/~1s2s~1v2.0~1task~1face-attr-analysis/post"},"children":["face-attr-analysis"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_skin_analysis/"},"children":["skin-analysis"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_skin_tone_analysis/v1.0/paths/~1s2s~1v2.0~1task~1skin-tone-analysis/post"},"children":["skin-tone-analysis"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_fitzpatrick_skin_type/v1.0/paths/~1s2s~1v2.0~1task~1fitzpatrick-scale-analyzer/post"},"children":["fitzpatrick-scale-analyzer"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_skin_simulation/v1.0/paths/~1s2s~1v2.0~1task~1skin-simulation/post"},"children":["skin-simulation"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_abs_filter/v1.0/paths/~1s2s~1v2.0~1task~1abs-shape/post"},"children":["abs-shape"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_aging_simulation/v1.0/paths/~1s2s~1v2.0~1task~1aging/post"},"children":["aging"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_body_reshape/v1.0/paths/~1s2s~1v2.0~1task~1body-reshape/post"},"children":["body-reshape"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_breast_augmentation/v1.0/paths/~1s2s~1v2.0~1task~1breast-shape/post"},"children":["breast-shape"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_face_lift/v1.0/paths/~1s2s~1v2.0~1task~1face-lift/post"},"children":["face-lift"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_face_reshape/v1.0/paths/~1s2s~1v2.0~1task~1face-reshape/post"},"children":["face-reshape"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_smile/v1.0/paths/~1s2s~1v2.0~1task~1ai-smile/post"},"children":["ai-smile"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_teeth_whitening/v1.0/paths/~1s2s~1v2.0~1task~1teeth-whiten/post"},"children":["teeth-whiten"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"頭髮與鬍鬚","__idx":22},"children":["頭髮與鬍鬚"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_hair_density_detection/v1.0/paths/~1s2s~1v2.0~1task~1hair-density-detection/post"},"children":["hair-density-detection"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_hair_frizziness_detection/v1.0/paths/~1s2s~1v2.0~1task~1hair-frizziness-detection/post"},"children":["hair-frizziness-detection"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_hair_length_detection/v1.0/paths/~1s2s~1v2.0~1task~1hair-length-detection/post"},"children":["hair-length-detection"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_hair_type_detection/v1.0/paths/~1s2s~1v2.0~1task~1hair-type-detection/post"},"children":["hair-type-detection"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_bangs/v1.0/paths/~1s2s~1v2.0~1task~1hair-bang/post"},"children":["hair-bang"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_hair_color/v1.0/paths/~1s2s~1v2.0~1task~1hair-color/post"},"children":["hair-color"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_wavy_hair/v1.0/paths/~1s2s~1v2.0~1task~1hair-curl/post"},"children":["hair-curl"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_hair_extension/v1.0/paths/~1s2s~1v2.0~1task~1hair-ext/post"},"children":["hair-ext"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_hairstyle/v2.1/paths/~1s2s~1v2.1~1task~1hair-transfer/post"},"children":["hair-transfer"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_hair_volume/v1.0/paths/~1s2s~1v2.0~1task~1hair-vol/post"},"children":["hair-vol"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_beard_style/v1.0/paths/~1s2s~1v2.0~1task~1beard-style/post"},"children":["beard-style"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"虛擬試穿試戴","__idx":23},"children":["虛擬試穿／試戴"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_earrings/v1.0/paths/~1s2s~1v2.0~1task~12d-vto~1earring/post"},"children":["earring"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_necklace/v1.0/paths/~1s2s~1v2.0~1task~12d-vto~1necklace/post"},"children":["necklace"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ring_vto/v1.0/paths/~1s2s~1v2.0~1task~12d-vto~1ring/post"},"children":["ring"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_bracelet/v1.0/paths/~1s2s~1v2.0~1task~12d-vto~1bracelet/post"},"children":["bracelet"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_watch/v1.0/paths/~1s2s~1v2.0~1task~12d-vto~1watch/post"},"children":["watch"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_bag/v2.0/paths/~1s2s~1v2.0~1task~1bag/post"},"children":["bag"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_hat/v2.0/paths/~1s2s~1v2.0~1task~1hat/post"},"children":["hat"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_scarf/v2.0/paths/~1s2s~1v2.0~1task~1scarf/post"},"children":["scarf"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_clothes/v4.0/paths/~1s2s~1v2.0~1task~1cloth-v4/post"},"children":["cloth-v4"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_fabric/v1.0/paths/~1s2s~1v2.0~1task~1fabric/post"},"children":["fabric"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_shoes/v3.0/paths/~1s2s~1v2.0~1task~1shoes-transfer/post"},"children":["shoes-transfer"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"影像","__idx":24},"children":["影像"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_photo_enhance/v1.0/paths/~1s2s~1v2.0~1task~1enhance/post"},"children":["enhance"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_photo_lighting/v2.0/paths/~1s2s~1v2.0~1task~1lighting/post"},"children":["lighting"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_photo_colorize/v1.0/paths/~1s2s~1v2.0~1task~1colorize/post"},"children":["colorize"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_color_correction/v1.0/paths/~1s2s~1v2.0~1task~1colorize~1color-correct/post"},"children":["color-correct"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_background_removal/v1.0/paths/~1s2s~1v2.0~1task~1sod/post"},"children":["sod"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_photo_background_blur/v2.0/paths/~1s2s~1v2.0~1task~1bg-blur/post"},"children":["bg-blur"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_photo_background_change/v2.0/paths/~1s2s~1v2.0~1task~1bg-replace/post"},"children":["bg-replace"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_object_removal_pro/v4.0/paths/~1s2s~1v2.0~1task~1generative-fill/post"},"children":["generative-fill"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_replace/v1.0/paths/~1s2s~1v2.0~1task~1obj-replace/post"},"children":["obj-replace"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_image_extender/v2.0/paths/~1s2s~1v2.0~1task~1out-paint/post"},"children":["out-paint"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_image_generator/v2.0/paths/~1s2s~1v2.0~1task~1image-to-image~1youcam/post"},"children":["image-to-image"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_image_generator/v2.0/paths/~1s2s~1v2.0~1task~1text-to-image~1youcam/post"},"children":["text-to-image"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_avatar_generator/v3.0/paths/~1s2s~1v2.0~1task~1ai-avatar/post"},"children":["ai-avatar"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_studio_generator/v3.0/paths/~1s2s~1v2.0~1task~1ai-studio/post"},"children":["ai-studio"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_headshot_generator/v1.0/paths/~1s2s~1v2.0~1task~1headshot/post"},"children":["headshot"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_watermark_removal/v1.0/paths/~1s2s~1v2.0~1task~1wmk-removal/post"},"children":["wmk-removal"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_face_swap/v1.0/paths/~1s2s~1v2.0~1task~1face-swap/post"},"children":["face-swap"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"影片","__idx":25},"children":["影片"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_video_background_replace/v1.0/paths/~1s2s~1v2.0~1task~1bg-replace-vid/post"},"children":["bg-replace-vid"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_video_face_swap/v1.0/paths/~1s2s~1v2.0~1task~1face-swap-vid/post"},"children":["face-swap-vid"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_video_generator/v2.0/paths/~1s2s~1v2.0~1task~1image-to-video~1youcam/post"},"children":["image-to-video"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_video_generator/v2.0/paths/~1s2s~1v2.0~1task~1text-to-video~1youcam/post"},"children":["text-to-video"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_video_object_removal/v2.1/paths/~1s2s~1v2.0~1task~1obj-rem-vid/post"},"children":["obj-rem-vid"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_video_enhancer/v1.0/paths/~1s2s~1v2.0~1task~1video-sr/post"},"children":["video-sr"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_video_style_transfer/v1.0/paths/~1s2s~1v2.0~1task~1video-trans/post"},"children":["video-trans"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["執行 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run <feature> --help"]}," 可查看每個功能接受的確切參數。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"範例工作流程","__idx":26},"children":["範例工作流程"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["這裡完整示範 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/ai_body_reshape/v1.0/paths/~1s2s~1v2.0~1task~1body-reshape/post"},"children":["AI Body Reshape"]},"：從偵測照片中的身體、選擇一位、進行塑形，到取得結果。以下的請求與回應內容，取自使用這張範例照片的真實執行："]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["1. 啟動偵測（前處理）任務"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run pre-process body-reshape \\\n  --src_file \"https://plugins-media.makeupar.com/strapi/assets/body_reshape_01_d10c50c97d.jpg\"\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["回應："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": 200,\n  \"data\": {\n \"task_id\": \"CKPWaMO-olxd1ECr_3tTDXW5Gu_tQw0EKgN0-dU27zSyXhV8cJR2TzYLMhDqD\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["2. 取得偵測到的身體"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam status pre-process body-reshape CKPWaMO-olxd1ECr_3tTDXW5Gu_tQw0EKgN0-dU27zSyXhV8cJR2TzYLMhDqD\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["回應："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": 200,\n  \"data\": {\n \"error\": null,\n \"results\": {\n  \"result\": [\n   {\n   \"left\": 0.35347824096679686,\n   \"top\": 0.022326231002807617,\n   \"width\": 0.3041056156158447,\n   \"height\": 0.951037073135376\n   }\n  ],\n  \"timed\": 4565\n },\n \"task_status\": \"success\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["results.result"]}," 中的每個項目是一位偵測到的人，以相對於圖片尺寸的邊界框表示（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]},"–",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},"）。它在陣列中的位置，就是接下來要傳的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--index"]},"；這張照片只有一人，因此 index 為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]},"。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["3. 對選定的人執行主要任務"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam run body-reshape \\\n  --src_file \"https://plugins-media.makeupar.com/strapi/assets/body_reshape_01_d10c50c97d.jpg\" \\\n  --version 1.0 \\\n  --index 0 \\\n  --features '{\"slim\": 20}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["回應："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": 200,\n  \"data\": {\n \"task_id\": \"ZV3WIzcB1rk7I5o8hMxKP5VdgIEpnHf7VOpsk1YC76tZy2Wur0lg4Bunb3KY-7Qa\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["4. 輪詢主要任務直到完成"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam status body-reshape ZV3WIzcB1rk7I5o8hMxKP5VdgIEpnHf7VOpsk1YC76tZy2Wur0lg4Bunb3KY-7Qa\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["任務執行期間，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_status"]}," 為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["running"]},"；每隔數秒重複執行指令。成功後（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /s2s/v2.0/task/body-reshape/{task_id}"]},"）："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": 200,\n  \"data\": {\n \"error\": null,\n \"results\": {\n  \"url\": \"https://yce-us.s3-accelerate.amazonaws.com/ttl30/.../0b333891-60be-4cd1-81cd-7d8cae35b3eb.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&...&X-Amz-Expires=7200&...\",\n  \"timed\": 12131,\n  \"slim\": true\n },\n \"task_status\": \"success\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["results.url"]}," 就是塑形後的圖片。它是一個會失效的簽章連結（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["X-Amz-Expires=7200"]},"，即 2 小時），請在任務成功後盡快下載。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"偵錯指南","__idx":27},"children":["偵錯指南"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["CLI 發送的是標準的 YouCam API 請求，因此 API 文件中的所有內容都完全適用：相同的",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.perfectcorp.com/develop/rate_limit"},"children":["速率限制"]},"、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.perfectcorp.com/develop/error_codes"},"children":["錯誤代碼"]},"與",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.perfectcorp.com/develop/file_retention_period"},"children":["檔案保留期限"]},"。也請參考 API 本身的",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.perfectcorp.com/develop/debugging_guide"},"children":["偵錯指南"]},"。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"錯誤出現的位置","__idx":28},"children":["錯誤出現的位置"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["問題可能出現在三個時點："]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"失敗位置"},"children":["失敗位置"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"結束代碼"},"children":["結束代碼"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"stdout"},"children":["stdout"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"stderr"},"children":["stderr"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"參見"},"children":["參見"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["CLI 在送出前拒絕指令"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["空"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["錯誤訊息"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#cli-errors"},"children":["CLI 錯誤"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["API 拒絕請求"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["含 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}," 與 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error_code"]}," 的 JSON"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["空"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#api-request-errors"},"children":["API 請求錯誤"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["任務執行但失敗"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["含 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"task_status\": \"error\""]}," 的 JSON，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.error"]}," 中有代碼，",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.error_message"]}," 中有說明"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["空"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#task-errors"},"children":["任務錯誤"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["失敗的任務仍以 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}," 結束，因為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," 請求本身成功了。腳本必須檢查 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.task_status"]},"，不能只看結束代碼。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"速率限制","__idx":29},"children":["速率限制"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.perfectcorp.com/develop/rate_limit"},"children":["API 速率限制"]},"適用於每個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam"]}," 指令："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["依 IP 位址："]}," 每 300 秒最多 250 個請求。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["依 access token（API key）："]}," 每 300 秒最多 250 個請求。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["兩個限制都必須符合。違反任一個的請求會得到 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429 Too Many Requests"]},"，CLI 以代碼 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," 結束。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["建議節奏約為每秒 5 個請求。"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["多數指令發送一個 API 請求。使用本地檔案的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]},"，在任務請求之前，每個檔案也會發送一個 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /s2s/v2.0/file"]}," 請求。輪詢也計入——每秒檢查多個任務會很快用完限制。請每隔數秒輪詢，收到 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429"]}," 時，請等待並以遞增的延遲重試，而不是立即重試。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"cli-錯誤","__idx":30},"children":["CLI 錯誤"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["這些會在任務請求送出前被攔截，因此不會使用點數。"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"CLI 錯誤訊息"},"children":["CLI 錯誤訊息"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"可能原因"},"children":["可能原因"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"解法"},"children":["解法"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Not authenticated. Run: youcam auth login <apiKey>, or set YOUCAM_CLI_API_KEY"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["沒有已儲存的 API 金鑰，且 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YOUCAM_CLI_API_KEY"]}," 未設定或為空"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["執行 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam auth login <apiKey>"]},"，或設定 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YOUCAM_CLI_API_KEY"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invalid credentials file at <path>. Re-run: youcam auth login <apiKey>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["credentials.json"]}," 不是有效的 JSON，或 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apiKey"]}," 為空或不是字串"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["執行 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam auth login <apiKey>"]},"。它會覆蓋該檔案"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Can't log out: credentials file at <path> is invalid. Fix or delete it by hand"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam auth logout"]}," 發現同樣無效的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["credentials.json"]},"，且未更動它"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["將檔案修正為 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"apiKey\": \"<your-api-key>\" }"]},"，然後再次登出，或刪除該檔案"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error: required option '--scale <value>' not specified"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["缺少必要選項"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["加上它。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam run <feature> --help"]}," 會列出所有選項"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error: option '--scale <value>' argument '9' is invalid. Allowed choices are 1, 2, 4."]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["值不在允許的選項中"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["使用列出的值之一"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Invalid value for --page_size: 99 (Too big: expected number to be <=20)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["值類型錯誤或超出範圍。對 JSON 選項，訊息會指出欄位"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["修正值。JSON 引號請見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#passing-json-parameters"},"children":["傳遞 JSON 參數"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error: unknown option '--bogus'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["該選項不存在於此功能，或拼寫錯誤"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--help"]}," 中檢查拼寫。選項使用 snake_case，例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--src_file"]},"，不是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--src-file"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ENOENT: no such file or directory, open '...'"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["本地檔案路徑錯誤"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["檢查路徑。相對路徑從目前目錄開始。含空格的路徑請加上引號"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Unsupported file type \"unknown\" for ./notes.txt. Supported types: image/jpeg, image/png, video/mp4"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["本地檔案不是 JPG、PNG 或 MP4"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["轉換檔案，或改傳公開網址"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Missing task ID. Usage: status <feature> <task_id> (or --task_id <value>)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["執行 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," 時未帶任務 ID"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["傳入 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]}," 印出的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"api-請求錯誤","__idx":31},"children":["API 請求錯誤"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["API 拒絕了請求。CLI 會在 stdout 印出 API 的回應，例如："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"status\": 400,\n  \"error\": \"This task ID doesn't exist, or the task has expired.\",\n  \"error_code\": \"InvalidTaskId\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"狀態"},"children":["狀態"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"error_code"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error_code"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"可能原因"},"children":["可能原因"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"解法"},"children":["解法"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["InvalidTaskId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["任務 ID 輸入錯誤、屬於另一個功能（例如以 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status hair-color"]}," 檢查 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run enhance"]}," 的任務），或超過 30 天，也就是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]}," 的有效期間"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," 中使用與 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]}," 相同的功能名稱。前處理任務請使用 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam status pre-process <feature> <task_id>"]},"。請在啟動任務後 30 天內檢查任務"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["InvalidAccessToken"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["已儲存的 API 金鑰錯誤，或已不再有效"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["從 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://yce.perfectcorp.com/api-console/en/api-keys/"},"children":["API console"]}," 複製金鑰，並再次執行 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam auth login"]},"。金鑰中不要包含用法說明裡的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[">"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["來自您的 IP 位址或 API 金鑰的請求過多"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["放慢速度，並以遞增的延遲重試。見",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#rate-limits"},"children":["速率限制"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"任務錯誤","__idx":32},"children":["任務錯誤"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["任務已被接受，但 AI 引擎無法處理。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam status"]}," 回傳 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"task_status\": \"error\""]},"，代碼在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.error"]},"，說明在 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.error_message"]},"。請在 API 的",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://docs.perfectcorp.com/develop/error_codes"},"children":["錯誤代碼"]},"頁面查詢代碼。某些功能有額外的代碼，列在該功能 API 參考頁面的「File Specs & Errors」中，包含其大小、解析度與姿勢限制。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"過期的結果連結","__idx":33},"children":["過期的結果連結"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["結果網址（例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["results.url"]},"，或 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ai-avatar"]}," 的 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["results.output[].url"]},"）在任務成功後可用 2 小時。若已過期，請再次執行 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["youcam status <feature> <task_id>"]}," 取得新的連結；這在任務建立後 30 天內都有效。結果會在 30 天後刪除，因此請在期限前下載您想保留的內容。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"取得協助","__idx":34},"children":["取得協助"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"youcam help\nyoucam help <command>\nyoucam <command> <subcommand> --help # 例如 youcam run pre-process --help\n","lang":"bash"},"children":[]}]},"headings":[{"value":"youcam-cli","id":"youcam-cli","depth":1},{"value":"需求","id":"需求","depth":2},{"value":"安裝","id":"安裝","depth":2},{"value":"認證","id":"認證","depth":2},{"value":"快速開始","id":"快速開始","depth":2},{"value":"點數與功能費用","id":"點數與功能費用","depth":2},{"value":"檢查您的點數","id":"檢查您的點數","depth":3},{"value":"查詢功能費用","id":"查詢功能費用","depth":3},{"value":"指令總覽","id":"指令總覽","depth":2},{"value":"API ↔ CLI 指令對應","id":"api--cli-指令對應","depth":2},{"value":"執行 AI 任務","id":"執行-ai-任務","depth":2},{"value":"上傳檔案","id":"上傳檔案","depth":2},{"value":"其他檔案選項","id":"其他檔案選項","depth":3},{"value":"選項語法","id":"選項語法","depth":2},{"value":"傳遞 JSON 參數","id":"傳遞-json-參數","depth":2},{"value":"檢查任務狀態","id":"檢查任務狀態","depth":2},{"value":"前處理（臉部與身體偵測）","id":"前處理臉部與身體偵測","depth":2},{"value":"列出預先定義的範本","id":"列出預先定義的範本","depth":2},{"value":"列出 makeup-vto 圖樣名稱","id":"列出-makeup-vto-圖樣名稱","depth":3},{"value":"可用的 AI 功能","id":"可用的-ai-功能","depth":2},{"value":"彩妝","id":"彩妝","depth":3},{"value":"肌膚、臉部與身體","id":"肌膚臉部與身體","depth":3},{"value":"頭髮與鬍鬚","id":"頭髮與鬍鬚","depth":3},{"value":"虛擬試穿／試戴","id":"虛擬試穿試戴","depth":3},{"value":"影像","id":"影像","depth":3},{"value":"影片","id":"影片","depth":3},{"value":"範例工作流程","id":"範例工作流程","depth":2},{"value":"偵錯指南","id":"偵錯指南","depth":2},{"value":"錯誤出現的位置","id":"錯誤出現的位置","depth":3},{"value":"速率限制","id":"速率限制","depth":3},{"value":"CLI 錯誤","id":"cli-錯誤","depth":3},{"value":"API 請求錯誤","id":"api-請求錯誤","depth":3},{"value":"任務錯誤","id":"任務錯誤","depth":3},{"value":"過期的結果連結","id":"過期的結果連結","depth":3},{"value":"取得協助","id":"取得協助","depth":2}],"frontmatter":{"seo":{"title":"youcam-cli"}},"lastModified":"2026-10-30T07:46:55.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/zh-tw/develop/cli","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}