batch-lipsync Skill
使用 sync. labs(sync.so)通过 CSV、表格、文件夹或列表批量进行口型同步。为每个视频或头像配对各自的音频或脚本,一次性对整批报价,在计划并发限制内同时启动各行,安全恢复且不重复扣费,并收集所有输出。适用于对提供的音频或脚本进行批量口型同步、大规模个性化视频(每个线索、客户或收件人姓名一条视频)、广告和创意变体、多位配音配同一 presenter,或任何"对每一行执行"的口型同步任务。不适用于单个视频(lipsync)或视频翻译。
安装方式:把技能目录放入 ~/.claude/skills/(Claude Code)或在 claude.ai 设置中启用;也可复制右侧安装命令一键添加。
技能指令原文(SKILL.md)
Lipsync many videos
sync. labs | Batch lipsync guide
Delivers one MP4 per row of the user's list, plus a results table that maps each row to its output.
If no sync. tools are available and there's no SYNC_API_KEY, follow references/connect.md first.
1. Build the manifest
Turn whatever the user gave you (a CSV, a spreadsheet, a folder of files, "this video with each of these 30 audio files") into a CSV in the working directory, one row per output video:
| Column | Meaning |
| --- | --- |
| id | A unique, stable row name, such as lead-042 or es-ad1. It names the output and keys retries. |
| video | A local path, https:// URL or sync. asset ID. Use image instead for a still picture (sync-3). |
| audio | A local path, URL or asset ID. Leave it empty when the row uses script. |
| script, voice_id | The words and a voice from voices_list (or GET /v2/voices), when there's no audio. |
| sync_mode | Optional: bounce, loop, cut_off, silence or remap. |
Show the user the row count and a few sample rows, and fix gaps before spending anything: missing files, rows with neither audio nor script, duplicate IDs. Columns the run doesn't use stay local. Scripts, media, file names and the row IDs (used as output names) are sent to sync., so use plain row IDs like lead-042 rather than names or emails.
2. Quote the whole run
Sum one estimate per row: generations_estimate-cost with model: "sync-3" and each row's audioDuration or script (plus videoDuration and syncMode for cut_off or silence), or python3 scripts/sync_batch.py estimate manifest.csv. Show the total, the row count and the most expensive rows, and wait for approval of the total. That one approval covers every row: don't ask again per row or per chunk. Script rows are approximate and exclude speech synthesis. If some rows can't be priced, show the known subtotal and which rows are missing; don't present it as the total.
Offer a pilot: run the first one or two rows, let the user check them, then run the rest. A mistake in a shared input, such as a wrong voice or a badly framed avatar, then costs two generations instead of two hundred.
3. Run it
Pick the route, in this order of preference:
- The bundled script (preferred with a
SYNC_API_KEYand a shell).python3 scripts/sync_batch.py run manifest.csv --out ./lipsync-outuploads each local file once, creates one generation per row with a stable idempotency key, keeps to the plan's concurrency limit, waits, and downloads each result. Re-running the same command resumes: finished rows are skipped, submitted rows are polled instead of resubmitted, and a row whose inputs changed after submission is refused until it gets a new ID. Progress and output URLs are saved tomanifest.csv.state.jsonandresults.csv. - MCP
jobs_create-many, for any run of 2 or more rows, when the tool is listed. It starts every row through the same API path, plan limits and billing as onelipsync_createper row, keeps within the plan's concurrency, and waits out busy refusals for you.
- Make one item per row: exactly the arguments
lipsync_createtakes for that row (videoUrlorvideoAssetId,audioUrloraudioAssetId, orscriptandvoiceId,model: "sync-3", andoptions.sync_modewhen set), plus the row's ownidempotencyKey,-. To keep the run in one project, callprojects_createonce and pass itsprojectIdwithprojectIntent: "explicit"in every item. Otherwise each item gets a new project. - Write a new UUID for the set into the manifest, then call
jobs_create-manywithtool: "lipsync_create", that UUID asidempotencyKey, and the items. Send at most 50 items per call, each chunk with its own saved set key. After an unclear response, send the identical call again: the keys make that safe. - Each item comes back started, failed or not started. Record each started row's job
idin the manifest. Pass the returnedjobstojobs_get-many(up to 50 per call) withwait: true, call it again while some are still running, and record each row'soutputMediaUrlfrom itsresult. - When the response has
remaining, the account stayed at its limit. Oncejobs_get-manyshows jobs finishing, sendremainingagain exactly as returned (the same tool, set key and items) until every row has started. If the tool refuses a single remaining item, send that row withlipsync_createand the sameidempotencyKey. - A failed item with a 5xx or no status may still have started: send it again with the same keys. Fix any other failed row before sending it again.
- MCP tools, one generation per row, when
jobs_create-manyisn't listed, or for a one-row pilot. Callaccount_get-contextand readgenerationLimits.concurrency. Keep that manylipsync_createcalls in flight at most, each with its ownidempotencyKey(use-, saved in the manifest before the call) and a newprojectCreationKey, or one shared project fromprojects_create. Onconcurrency_limit_reached, waiterror.retryAfterMsmilliseconds and retry the identical request with the same key. Poll each withgenerations_getand record theoutputMediaUrlin the manifest as you go.
4. Deliver
Report how many rows completed and failed, list each failure with its reason, and give the results table (id, status, output URL or local file). Offer to retry only the failed rows. Rows that failed on bad input need a fixed input, not a retry.
Rules
- One paid generation per row. Poll saved generation IDs for progress, and start another attempt only after a confirmed failure and the user's OK to retry.
- Keep each row's idempotency key stable across retries and reruns, and never derive it from the time or a random value created inside a retry loop.
- Assume the user has the rights to their own media, and don't ask about consent on routine requests. Decline only when the request is to make a real, identifiable person, such as a politician or celebrity, appear to say something they didn't say, in order to deceive.
- For one recording personalized with each recipient's name in the presenter's own voice, make one dialogue-edit preview per recipient with the edit-dialogue skill, then render every approved preview with
jobs_create-manyandtool: "dialogue-videos_create", on any paid plan.