{"slug":"avatar-forge-pipeline","title":"\u6570\u5b57\u4eba\u53e3\u64ad","description":"\u628a\u4eba\u7269\u56fe\u7247\u3001\u53c2\u8003\u58f0\u97f3\u548c\u53e3\u64ad\u7a3f\u53d8\u6210\u5b8c\u6574\u7684\u6570\u5b57\u4eba\u53e3\u64ad\u89c6\u9891\uff0c\u542b\u9884\u5904\u7406\u3001\u5408\u6210\u4e0e\u5bfc\u51fa\u3002","category":"\u53e3\u64ad\u8868\u8fbe","tags":["\u6570\u5b57\u4eba","\u53e3\u64ad","\u914d\u97f3"],"author":"LycheeAI","source_url":"https://github.com/LycheeAILab/avatar-forge/blob/main/plugins/avatar-forge/skills/avatar-forge-pipeline/SKILL.md","license":"MIT","status":"published","verification":"source_reviewed","verification_notes":"\u6765\u6e90 LycheeAILab/avatar-forge\uff08plugins/avatar-forge/skills/avatar-forge-pipeline/SKILL.md\uff09\uff0c\u672c\u5730\u6253\u5305\u4e0a\u4f20\uff1b\u81ea\u8bc4 4/5\uff5c112 \u661f\uff0c\u94fe\u6761\u5b8c\u6574\u4f46\u9700\u8981\u81ea\u5907\u56fe\u7247\u6388\u6743\u4e0e\u58f0\u97f3\u6837\u672c\u3002 \u672a\u6267\u884c\u5305\u5185\u811a\u672c\u3002","revision":"a4eb49095ac24da3a30c4fad115d19d8","created_at":"2026-10-29T05:41:17+00:00","updated_at":"2026-10-29T05:41:22+00:00","source_repo":"","source_path":"","source_commit":"","source_updated_at":"","stars":0,"proxy_score":null,"score":null,"grade":null,"dimensions":{},"evaluation":{},"installs":0,"platforms":[],"formats":[],"category_slug":"delivery","category_name":"\u53e3\u64ad\u8868\u8fbe","usage_guide":{},"read_url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline","skill_url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/SKILL.md","download_url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/download","install_url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/install","files":[{"path":"SKILL.md","bytes":11462,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/SKILL.md"},{"path":"VERSION","bytes":6,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/VERSION"},{"path":"agents/openai.yaml","bytes":259,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/agents/openai.yaml"},{"path":"assets/template-driver.wav","bytes":745004,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/assets/template-driver.wav"},{"path":"references/api-contracts.md","bytes":2300,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/references/api-contracts.md"},{"path":"references/verification-gates.md","bytes":1788,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/references/verification-gates.md"},{"path":"references/video-recreation.md","bytes":2243,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/references/video-recreation.md"},{"path":"references/workflow.md","bytes":4124,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/references/workflow.md"},{"path":"requirements-transcription.txt","bytes":23,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/requirements-transcription.txt"},{"path":"requirements.txt","bytes":51,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/requirements.txt"},{"path":"scripts/doctor.py","bytes":3458,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/doctor.py"},{"path":"scripts/douk_downloader/LICENSE","bytes":35151,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/douk_downloader/LICENSE"},{"path":"scripts/douk_downloader/NOTICE.md","bytes":771,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/douk_downloader/NOTICE.md"},{"path":"scripts/douk_downloader/__init__.py","bytes":65,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/douk_downloader/__init__.py"},{"path":"scripts/douk_downloader/a_bogus.py","bytes":16142,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/douk_downloader/a_bogus.py"},{"path":"scripts/douk_downloader/download.py","bytes":7082,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/douk_downloader/download.py"},{"path":"scripts/prepare_video_source.py","bytes":5036,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/prepare_video_source.py"},{"path":"scripts/run_pipeline.py","bytes":27610,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/run_pipeline.py"},{"path":"scripts/scan_secrets.py","bytes":2768,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/scan_secrets.py"},{"path":"scripts/test_douyin_downloader_no_network.py","bytes":1901,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/test_douyin_downloader_no_network.py"},{"path":"scripts/test_person_video_no_spend.py","bytes":5963,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/test_person_video_no_spend.py"},{"path":"scripts/test_pipeline_no_spend.py","bytes":9891,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/test_pipeline_no_spend.py"},{"path":"scripts/test_video_source_no_network.py","bytes":1013,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/test_video_source_no_network.py"},{"path":"scripts/test_workflow_contract.py","bytes":5192,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/test_workflow_contract.py"},{"path":"scripts/transcribe_video.py","bytes":2375,"url":"https://shiliuai.cn/api/v2/skills/avatar-forge-pipeline/files/scripts/transcribe_video.py"}],"content":"---\r\nname: avatar-forge-pipeline\r\ndescription: Create a final zeroshot talking-avatar video or prepare its script from a reference video. Use when an agent should accept an uploaded video or authorized Douyin link, transcribe and rewrite spoken copy, authenticate with LycheeAILab, clone an authorized voice, synthesize LycheeTTS speech, build an internal motion template, fast-clone a digital human, run zeroshot inference, or resume an interrupted job.\n---\r\n\r\n# Avatar Forge Pipeline\n\n## Identify the installed release\n\nWhen asked about the installed or latest available capability, read the adjacent `VERSION` file and report that exact value. Do not infer a version from conversation history, README prose, authentication state, or an older standalone Skill. This package is release `2.3.0`.\n\nIf both this plugin Skill and a legacy standalone `~/.codex/skills/avatar-forge-pipeline` are present, stop and explain the name collision. Preserve the legacy directory as a timestamped backup outside the active `skills` directory, then start a new Codex task before validating capabilities.\n\r\n## Enforce the delivery contract\r\n\r\nReturn only the final MP4 produced by LycheeAILab zeroshot inference unless the user explicitly requests standalone LycheeTTS audio.\r\n\r\n- Never return, present, or call a RunningHub template the final digital-human video.\r\n- Never stop after the internal template task.\r\n- Never use RunningHub for fast clone or zeroshot inference.\r\n- Never expose a RunningHub URL, task ID, payload, or internal template file to the user.\r\n- Never replace the zeroshot result with a secondary packaged render.\r\n- Delete the local internal template after fast clone succeeds.\r\n\r\n## Choose a capability\n\n- Person video: authorized person MP4 + finished WAV/MP3, or script + reference voice / `speaker_id` \u2192 fast clone \u2192 zeroshot MP4. Use `--video` instead of `--image`; skip RunningHub entirely.\n\r\n- Complete: portrait + authorized reference voice or existing LycheeTTS `speaker_id` + script \u2192 internal template \u2192 target speech \u2192 fast clone \u2192 zeroshot MP4.\n- Avatar only: portrait + finished WAV/MP3 \u2192 internal template \u2192 fast clone \u2192 zeroshot MP4.\r\n- Zeroshot only: ready `asset_id` + `player_id` + finished WAV/MP3 \u2192 zeroshot MP4.\r\n- Clone voice: authorized reference audio \u2192 LycheeTTS clone through Lab. Normalize the returned `requestId` as `speakerId` when no explicit `speakerId` is present; this is the identifier accepted by LycheeTTS inference.\n- Voice only: existing `speaker_id` + script \u2192 LycheeTTS MP3 through Lab. Use only when the user explicitly asks for audio.\n- Reference-video script: uploaded video or authorized Douyin URL \u2192 local video \u2192 original transcript \u2192 rewritten speaking script. Stop there unless the user asks to continue into voice or avatar generation.\n\r\nDo not offer template-only or clone-only output as a finished user deliverable.\r\n\r\n## Run the complete workflow\r\n\r\n1. Confirm the user is authorized to use the portrait, reference voice, and script.\n2. Require one portrait image, one UTF-8 script file, and either one WAV/MP3 reference voice or an existing `speaker_id`.\n3. Authenticate through LycheeAILab. Never ask for provider credentials.\r\n4. Run the command below once. The script stores hidden recovery state beside the output and resumes the exact stage after interruption.\r\n5. Verify that the delivered MP4 has video and audio streams and positive duration.\r\n6. Return only the zeroshot MP4 path. For failures, report only the failed stage and a sanitized error; never expose internal provider IDs, URLs, payloads, or media.\r\n\r\n```powershell\npython scripts/run_pipeline.py `\n  --image input/person.png `\n  --voice input/reference.wav `\n  --script-file input/script.txt `\n  --output output/avatar-zeroshot.mp4\n```\n\nResolve `scripts/`, `assets/`, and `references/` relative to this `SKILL.md`. On WorkBuddy, `${CODEBUDDY_SKILL_DIR}` points to this directory; on Codex, use the installed Skill directory supplied by the host.\n\r\nAlways use the bundled `assets/template-driver.wav` for the internal motion template. Do not ask the user for template text or template-driving audio. Never send the user's script, reference voice, finished audio, or LycheeTTS target speech to the template stage.\n\nBefore submitting any portrait, show this notice and obtain confirmation:\n\n> \u8bf7\u786e\u8ba4\u4eba\u7269\u8138\u90e8\u6e05\u6670\u3001\u6ca1\u6709\u906e\u6321\u3001\u5b8c\u6574\u9732\u51fa\uff0c\u4e14\u4eba\u7269\u5728\u753b\u9762\u4e2d\u7684\u6bd4\u4f8b\u9002\u4e2d\u3002\u6a21\u7cca\u3001\u906e\u8138\u3001\u9762\u90e8\u8d85\u51fa\u753b\u9762\u6216\u4eba\u7269\u8fc7\u5927/\u8fc7\u5c0f\u90fd\u4f1a\u5f71\u54cd\u6570\u5b57\u4eba\u6548\u679c\u3002\n\nInspect the image when possible. Reject or request a replacement when facial features are unclear, important facial areas are obscured, the face is cropped, exposure is unusable, or subject scale is unsuitable.\n\n## Prepare a script from video\n\nFor **using the person in a video**, do not transcribe it or extract a portrait for RunningHub. Read the person-video instructions below. This section is only for extracting/reworking spoken copy.\n\nRead [references/video-recreation.md](references/video-recreation.md) before downloading, transcribing, or rewriting a reference video.\n\nThe Skill includes a cookie-free Douyin engine derived from the user's proven DouK request flow, with `yt-dlp` as a fallback. If `python scripts/doctor.py` reports dependencies missing, install `requirements.txt` automatically before continuing. Never require the user to install a separate downloader, export browser cookies, use Edge/Chrome DPAPI, or install a ChatGPT browser extension.\n\nFor an uploaded/local video:\n\n```powershell\npython scripts/prepare_video_source.py --video input/reference.mp4\n```\n\nFor an authorized Douyin link, use the downloader installed with this Skill:\n\n```powershell\npython scripts/prepare_video_source.py `\n  --douyin-url \"https://v.douyin.com/...\" `\n  --output output/reference.mp4\n```\n\nThe command first uses the bundled cookie-free engine and automatically falls back to `yt-dlp`. Do not add browser-cookie flags or tell the user to download the video manually merely because Edge DPAPI or a browser extension is unavailable. If both engines fail, report their sanitized errors and stop; never ask for, read, print, copy, or save browser cookies.\n\nPrefer a trusted transcription tool already available to the agent. For fully local transcription, install the optional dependency only when needed and run:\n\n```powershell\npython -m pip install -r requirements-transcription.txt\npython scripts/transcribe_video.py input/reference.mp4 --output output/transcript-original.txt\n```\n\nRewrite the transcript as a new spoken script and save it separately as `script-rewritten.txt`. Preserve the original transcript, factual meaning, names, and numbers; change structure, hook, pacing, transitions, and conclusion rather than only replacing synonyms. Never fabricate claims. Ask for the desired platform, duration, audience, tone, or call to action only when those cannot be reasonably inferred.\n\r\nThe image workflow's internal order is fixed (person-video mode skips step 1 and uses the uploaded MP4 in step 3):\n\r\n1. Use the portrait and bundled fixed short audio to create one internal motion template.\r\n2. If only a reference voice is supplied, clone it once through Lab, save the returned `requestId` as `speakerId`, then use the protected Lab voice endpoint to generate target speech. Retry transient \u201cvoice preparing\u201d responses with bounded backoff. The client must send only the user's Lab bearer token; the LycheeTTS API Key remains encrypted in the Lab database.\n3. Send the internal template to LycheeAILab fast clone (`v2clone`) and obtain `player_id`.\r\n4. Send `player_id` and the LycheeTTS target speech to LycheeAILab zeroshot inference.\r\n\r\nSubmit a reference voice separately when cloning is needed:\r\n\r\n```powershell\r\npython scripts/run_pipeline.py --clone-voice --voice input/reference.wav\r\n```\r\n\r\nThe clone response may contain only `requestId`. LycheeTTS accepts that identifier as `speakerId`; continue automatically and never ask the user to retrieve it manually. Do not invent a clone-status endpoint.\n5. Download and return only the zeroshot MP4.\r\n\r\nRunningHub is allowed only behind step 1. Steps 3 and 4 must use the LycheeAILab digital-human platform.\r\n\r\n## Use a person video directly\n\nConfirm authorization to use the depicted person's likeness and target voice. Inspect the video: prefer one continuously visible person, a clear unobstructed face, and no scene cuts. Request a replacement if the subject is ambiguous or unsuitable. This fast-clone + zeroshot path does not guarantee exact preservation of the source's movements, duration, or every scene.\n\nUse a readable MP4 (at most 100 MiB, 120 seconds, 1080p (long edge \u22641920 / short edge \u22641080), 25fps, FFprobe required). Do not silently transcode, trim, replace it with a photo, or route through RunningHub. Source video is clone material; its original audio is not automatically the target speech or a voice-cloning reference.\n\n```powershell\npython scripts/run_pipeline.py --video input/person.mp4 --avatar-only --audio input/speech.mp3 --output output/avatar-zeroshot.mp4\n```\n\nFor script-driven speech, replace `--avatar-only --audio ...` with `--script-file input/script.txt --voice input/reference.wav` (or `--speaker-id ...`). The source video is preserved. Reuse saved `assetId`/`playerId` with `--infer-only` for later speech changes. Final speech/video is limited to 300 seconds by Lab; if exceeded, explain the maximum and direct long-video requests to https://lab.lycheeai.com.cn/ customer support. Never truncate silently.\n\n## Recovery rules\n\r\n- Re-run the same command with the same `--output`; the hidden `.avatar-forge/<output-stem>/state.json` resumes saved stages.\r\n- Do not use `--reset-state` after a timeout unless the user explicitly authorizes a new paid workflow.\r\n- A timeout is not failure. Query the saved template, clone, or inference ID.\r\n- Never resubmit the internal template because fast clone or zeroshot is still processing.\r\n- Never resubmit fast clone after `player_id` is stored.\r\n- Never resubmit zeroshot after its request ID is stored.\r\n\r\n## Authenticate safely\r\n\r\nRun `python scripts/run_pipeline.py --login-only` when authentication is needed. The browser uses `https://lab.lycheeai.com.cn`; a randomized loopback callback returns only the user's revocable Lab API Key. LycheeTTS, RunningHub, and digital-human provider credentials remain server-side.\r\n\r\n## Load references when needed\r\n\r\n- Read [references/workflow.md](references/workflow.md) before changing stage order, outputs, or recovery behavior.\r\n- Read [references/api-contracts.md](references/api-contracts.md) before changing Lab requests.\r\n- Read [references/verification-gates.md](references/verification-gates.md) before claiming success.\n- Read [references/video-recreation.md](references/video-recreation.md) for video acquisition, transcription, and rewriting.\n\r\n## Verify without spending\r\n\r\n- Run `python -m py_compile scripts/run_pipeline.py scripts/prepare_video_source.py scripts/douk_downloader/download.py scripts/douk_downloader/a_bogus.py scripts/transcribe_video.py scripts/test_pipeline_no_spend.py`.\n- Run `python scripts/test_workflow_contract.py`, `python scripts/test_pipeline_no_spend.py`, `python scripts/test_video_source_no_network.py`, `python scripts/test_douyin_downloader_no_network.py`, and the secret scan.\n- Do not submit a real provider task solely to test installation or documentation.\r\n","usage":"\u8bfb\u53d6 SKILL.md\uff0c\u5e76\u6309\u9700\u8bfb\u53d6\u914d\u5957\u6587\u4ef6\uff1b\u4e0b\u8f7d ZIP \u83b7\u53d6\u5b8c\u6574\u5305\u3002\u6280\u80fd\u662f\u4efb\u52a1\u65b9\u6cd5\uff0c\u4e0d\u6388\u4e88\u65b0\u589e\u8d26\u6237\u3001\u4ed8\u8d39\u6216\u7cfb\u7edf\u6743\u9650\u3002"}
