{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/zh-CN/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 功能——人脸与身体编辑、发型、测肤、美妆、虚拟试穿、背景与照片编辑、图像与 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 智能体"]},"：Claude Code、Cursor、Codex 等智能体可以把任何 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 流水线、容器里，对整文件夹的商品图、人像批量跑功能。本地文件由 CLI 代为上传，脚本里不用写上传这一步。"]}]},{"$$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 密钥"]},"。"]}]},{"$$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# Verify the installation\nyoucam --help\n\n# Version of the 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# or explicitly with a flag\nyoucam auth login --api-key <apiKey>\n\n# Remove the saved API key (logout CLI tool)\nyoucam auth logout\n\n# List the available authentication options\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 纪元起的毫秒数）。这条命令之所以叫 ",{"$$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 照片优化"]}," 把一张示例照片放大到 2 倍分辨率："]},{"$$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":"Run `youcam status enhance 32tu4jQvRbI9NfnKlw13cls8tyT1zA2ZoOtKq-RkiTL_FrIEOLYHJX1HxYVrnWz` to check the result.\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":"/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  # remaining units\nyoucam client credit-history  # unit usage 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":["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"]}," 等）不用您操心：每条命令都会调用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 发色虚拟试染"]}," 为例，它的两个接口是："]},{"$$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 腹肌滤镜"]},"："]},{"$$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 结构校验。取值范围固定的选项会在 ",{"$$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"]},"（一个公开 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":["可公开访问的 URL"]}," 作为 ",{"$$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":["本地文件路径"]}," 由 CLI 代为上传，任务用 ",{"$$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":["没有单独的上传命令，上传只通过文件选项发生。"]}]},{"$$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"]},"，有些功能还要额外的图片（蒙版、参考照、商品图）。规则一样：传公开 URL 或本地路径，本地路径由 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":"选项"},"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":["如果一个多值选项里混着公开 URL 和本地路径，例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["--ref_files https://example.com/a.jpg ./b.jpg"]},"，那么里面每个文件都会被上传，URL 也一样：CLI 会先把每个 URL 下载下来，当作本地文件上传，最后全部以文件 ID（例如 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ref_file_ids"]},"）送出。这些 URL 指向的必须是 JPG、PNG 或 MP4。想让 URL 以 URL 的形式送出，那个选项里就只传 URL。"]},{"$$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 要特殊处理的字符时（例如 URL 里的 ",{"$$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":["-"]}," 从标准输入读 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: single quotes protect the double quotes\nyoucam run hair-color --src_file photo.jpg --pattern '{\"name\":\"full\"}' --palettes '[{\"color\":\"#8B4513\",\"color_intensity\":80,\"shine_intensity\":50}]'\n\n# Windows PowerShell: escape the inner double quotes\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"]},"（全头模式 1 个，渐层模式 2 个）："]},{"$$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# or\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"]},"）为止；届时响应里就带上结果，例如输出文件的 URL。预处理任务请用 ",{"$$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>"]}," 会检测照片里的人脸或人体，并以列表返回。列表里每一项按位置编号：第 1 个是 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]},"，第 2 个是 ",{"$$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 ..."]}," 就是对检测到的第 2 张脸做提升。完整流程与真实输出见",{"$$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 身形塑形"]}," 走一遍完整流程——先检测照片里的人体，挑一个，做塑形，再取结果。下面的请求体与响应体都取自用这张示例照片的真实运行："]},{"$$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"]},"；这张照片只有一个人，所以编号是 ",{"$$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":"/develop/rate_limit"},"children":["速率限制"]},"、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/develop/error_codes"},"children":["错误码"]},"与",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/develop/file_retention_period"},"children":["文件保留期限"]},"。另见 API 自身的",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/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":"/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":["按访问令牌（API 密钥）："]}," 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":["多数命令只发 1 次 API 请求。",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run"]}," 带本地文件时，在任务请求之前，每个文件还会多发 1 次 ",{"$$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":["转换文件格式，或者改传公开 URL"]}]},{"$$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 会把 API 的响应打印到 stdout，例如："]},{"$$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":["run enhance"]}," 的任务却用 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status hair-color"]}," 去查）；或已超过 30 天——",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]}," 的有效期是 30 天"]},{"$$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 控制台"]},"复制密钥，重新执行 ",{"$$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":"/develop/error_codes"},"children":["错误码"]},"页面查这个码。部分功能另有专属错误码，列在该功能的 API 参考页面「文件规格与错误」一节里，同一节还写明尺寸、分辨率与姿态的限制。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"结果链接过期","__idx":33},"children":["结果链接过期"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["结果 URL（例如 ",{"$$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 # e.g., 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-cn/develop/cli","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}