Communitygithub.com

Video Generation Desk

Turns finalized G2 generation checklists into real video clips—builds KIE Seedance tasks per segment, polls, downloads, performs media inspection, frame sampling quality checks, listens for dialogue verification, and writes each segment's status and request fingerprint into the generation ledger. Three mutually exclusive modes (text-to-video / first-frame image-to-video / first-and-last-frame image-to-video). Narration is spoken directly by the model; dialogue is written into the prompt as-is, without separate TTS voiceover.

What is Video Generation Desk?

The Video Generation Desk skill is an AI agent tool specialized for post-generation video production. It takes a finalized 'generation checklist' (a markdown document listing segments, durations, assets, etc.) and converts it into real video clips using the KIE Seedance API. Its primary function is to animate locked-in visuals and have the embedded model narrate dialogue from the checklist, without redesigning visuals or altering script text. The skill supports three mutually exclusive modes (text-to-video, first-frame image-to-video, and first-and-last-frame image-to-video) to handle different scene types. It automates a 7-step pipeline: reading the checklist, determining the mode, writing video prompts, submitting tasks to Seedance, polling for download, running media inspection (via a script), and performing human frame-sampling quality checks. A key differentiator is that narration is generated by the video model itself directly from the prompt, eliminating separate TTS. The skill manages a generation ledger to track status per segment, handles batch processing (default 5 concurrent tasks) with safeguards against ledger corruption, and provides a detailed failure diagnosis table. It enforces hard boundaries: no visual redesign, no rewriting dialogue, no subtitles, no audio post-processing, and no editing. The tool is ideal for Cursor, Claude Code, or Codex agents tasked with converting 'locked picture and dialogue' into usable, traceable footage, ensuring output consistency and preventing creative deviation.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/lhaovo/short-video-skills/tree/HEAD/short-video-generate

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does Video Generation Desk do?

Does one thing: Makes already finalized visuals move, and leaves a traceable record.

The video model here is responsible for three things: motion, camera movement, and speaking the narration. Character appearance, clothing, scene, color palette, lighting, composition, and on-screen text are locked in at S1/S2. This layer is not allowed to recreate them. Once it starts "improvising," the entire film's consistency breaks.

Narration no longer uses separate voiceover. Dialogue is written into the prompt, spoken directly by the model—this is the biggest difference from traditional workflows and the area that needs the most oversight.


I. Prerequisites for Entry

Four items are required; missing any one means sending back to the previous phase:

RequirementLocationWhat happens if missing
03-generation-checklist.mdProduced by short-video-prompt, and G2 approvedUnclear how many segments to generate or their lengths
Original dialogue for each segmentInside the per-segment prompt in the checklistThe model won't know what to say and will make something up
Asset image / first frame04-assets/01-asset-images/, 04-assets/02-first-frames/Character appearance varies per segment
KIE_API_KEYEnvironment variableCannot submit tasks

No first frame doesn't mean it can't be done: Pure atmosphere, empty shots, and transitions can use text-to-video. But segments with characters must have an image—this is a hard requirement.

Segments without dialogue can skip narration, like empty shots or pure music sections. But if a segment needs speech, the dialogue must be in the prompt—it's the only source of sound now.


II. Three Modes, Mutually Exclusive, Cannot Be Mixed

The platform accepts only one mode per request. Crossing field boundaries switches modes and causes task failure.

ModeRequired FieldsWhen to UseExplicitly Prohibited
text Text-to-videopromptEmpty shots, atmosphere, pure background effects, transitionsIncluding first_frame_url / last_frame_url
first First-frame image-to-videoprompt + first_frame_urlDefault mode: needs to lock starting compositionIncluding last_frame_url
first-last First-and-last-frameprompt + first frame + last frameNeeds to lock both start and end to ensure smooth continuity between adjacent segments—

How to Map "Reference Image" Mode from the Checklist

The checklist's mode column from short-video-prompt might say "First-Last / Reference Image / Text." Current model has no reference image mode—fields like reference_image_urls are not open on this model. So a mapping is needed:

Checklist SaysActual Submission ModeInstructions
First-lastfirst-lastDirect pass-through
Reference imagefirstUse the reference image as the first frame, lock starting composition
TexttextDirect pass-through, but only valid for shots without characters

This is not a compromise; it's a capability boundary. If a segment truly needs "reference image to lock character + free composition," the only options are to lock the composition along with the first frame or go back to S2 to modify the segment split.


III. Parameter Specifications

ParameterValuesDefaultDescription
duration4–15 integer seconds5Over 15: split into multiple shots; under 4: pass to post-production for effects or cropping
aspect_ratio9:16 / 16:9 / 1:1 / 3:4 / 4:3 / 21:9 / adaptive9:16adaptive only for text-to-video; image-to-video requires a fixed ratio
resolution480p / 720p480pDefault controls generation cost; explicitly pass 720p when delivery clarity is needed
generate_audiotrue / falsetrueCannot turn off. The narration is in this audio track; turning it off means no sound
web_searchtrue / falsefalseOnly usable for text-to-video; generally not used

Three common pitfalls:

  1. Aspect ratio must match actual output. If the model returns a result with a clearly mismatched ratio or black bars, mark it as quality failure; do not letterbox and deliver as final.
  2. Audio must be enabled. Narration and ambient sounds are all in this one track. Only use --no-audio for pure empty shots that truly don't need sound.
  3. duration must be an integer. Passing 5.5 will be rejected.

IV. Seven-Step Pipeline

① Read checklist → ② Determine mode → ③ Write video prompt → ④ Submit → ⑤ Poll and download → ⑥ Media inspection → ⑦ Frame sampling QA

① Read Checklist, First Determine Feasibility

Check three things for each segment; if mismatched, stop and ask, don't guess:

  • Is each segment's duration between 4 and 15? (Split if over)
  • Does the declared first-frame file actually exist?
  • Are all referenced asset IDs present in the asset list?

② Determine Mode

Determine mode per segment based on Section II's table. Try to keep the whole project consistent. Mixing isn't an error, but it makes adjacent segments look worse.

③ Write Video Prompt

Follow the seven-section structure in references/video-prompt.md. Two core principles:

  1. Only describe "change," don't redescribe "what it is." The first frame already shows the model what the product looks like; describing it again in the prompt makes the model redraw it from the text, instantly losing consistency.
  2. Copy dialogue verbatim from the script, don't change a single word. The narration is now spoken directly by the model; the original dialogue must be in the prompt. Changing even one word means the subtitles won't match the audio.

④ Submit

python scripts/kie_seedance.py create \
  --prompt "…" --mode first \
  --first 04-assets/02-first-frames/S01_f01_v1.png \
  --duration 6 --out 04-assets/03-clips/S01_v1.mp4 --wait

Immediately write the taskId and fingerprint into the ledger after successful submission, then move on. Write after doing; if interrupted midway, you can't find it back.

④-2 Batch Run for Entire Film (Default 5 Concurrent Workers)

Running one segment at a time for 6 segments takes over 30 minutes, most of it waiting. Batch concurrent running takes about the time of the slowest segment.

# Preview first: inspect the assembled request body
python scripts/kie_seedance.py batch --tasks tasks.json --out-dir 04-assets/03-clips --dry-run

# Confirm then run; default 5 concurrent
python scripts/kie_seedance.py batch --tasks tasks.json --out-dir 04-assets/03-clips

# Reduce if hitting rate limits
python scripts/kie_seedance.py batch --tasks tasks.json --out-dir 04-assets/03-clips --concurrency 2

The task table format follows assets/batch-tasks-example.json: one entry per segment, with mode / first / last / duration / prompt having the same meaning as the single command.

Concurrency isn't always faster; there's a real pitfall: the ledger can get corrupted.

If 5 segments finish concurrently, and each tries to update 00-generation-ledger.md right after finishing, the five writes will overwrite each other, leaving only one segment's record. The correct approach is:

① Finish the whole batch, collect the items from the summary (already sorted by checklist order)
② Write back to the ledger in one go: write all five segments together, not one at a time
③ Immediately verify: the ledger should have as many rows as the checklist has segments

If you prefer to write as you go, reduce concurrency to 1—serial execution with write-as-you-go is the only way to avoid corruption. Make this trade-off yourself, but you cannot concurrently run and write piecemeal.

Rate limiting appears as code != 200 or HTTP 429, not "worse video quality." When you see these errors, reduce concurrency first; don't change the prompt.

Failure doesn't interrupt: If one segment fails, the rest continue. Check failed in the summary. To stop on first error, add --stop-on-error; it stops submitting new tasks but doesn't affect ones already running.

⑤ Poll and Download

--wait keeps running until download completes. You can also split: create to get a taskId → wait --task-id.

Polling interval starts at 6 seconds and gradually increases to 30 seconds, with a 15-minute cap. Timeout doesn't mean failure; check status first before deciding.

⑥ Media Inspection (Script-Checked)

# Segments with dialogue: audio track must exist
python scripts/inspect_clip.py --file 04-assets/03-clips/S01_v1.mp4 \
  --ratio 9:16 --duration 6 --expect-audio

# Segments without dialogue (empty shots): should have no audio track
python scripts/inspect_clip.py --file S02_v1.mp4 --no-expect-audio

Checks five objective facts: file exists, size is normal, duration is correct, aspect ratio is correct, audio track exists. Passing only means "a playable file was downloaded," not that the visuals are usable or the dialogue is correct.

The audio check is now more important than before: the narration is in this audio track. No audio track = no sound for this segment = waste. An existing audio track but wrong words can't be caught by the script—only by listening.

⑦ Frame Sampling QA + Audio Listening (Human-Checked)

Visuals: Sample at least three points (start, middle, end). Check against the seven criteria in references/clip-review.md.

Audio: Since the model now speaks the narration, every segment with dialogue must be listened to against the original script, checking three things:

What to Listen ForCriteria
Missing sentencesAs many sentences as in the original script, you should hear that many
Mispronounced wordsAre keywords, brand names, numbers correct?
Unwanted soundsMusic, other voices, noise that shouldn't be there

When what's heard doesn't match the script, don't settle. Two options: regenerate this segment, or modify subtitles to match the actual spoken content. The one thing you cannot do is keep the original subtitles verbatim—if the audience hears one thing and reads another, it's more damaging than a mispronunciation itself.

This step must be listened to. For ambiguous keywords, repeat and transcribe at least three times for comparison, then do manual final review per sentence and write the conclusion into 04-assets/00-dialogue-final.json. See references/clip-review.md.


V. Three Layers of Status, Don't Mix Them Up

StatusWho JudgesMeaning
Media passedScriptFile complete, parameters correct, audio track exists
Visuals passedHuman watchingCharacter unchanged, no distortion, can connect to next segment
Dialogue passedHuman listeningDialogue fully spoken, keywords correctly pronounced

Only when all three pass can the status be written as "Quality Passed."

Treating "download complete" as "usable" is the most common mistake on this chain—you only discover in the editing desk that segment 4's character changed, wasting previous assembly work. Now there's an extra layer: even if visuals are all correct but one word is mispronounced, the whole segment is still unusable because subtitles won't match.

The dialogue layer is the most likely to be skipped because it requires quiet headphone listening, not a quick glance.


VI. Ledger: Written in 04-assets/00-generation-ledger.md

One row per segment, recording six items: request fingerprint, mode, taskId, status, output file, failure reason.

The ledger's role is not just archiving—it's preventing duplicate submissions. Coming back a day later to continue the same film, reading the ledger tells you which segments are done, which were submitted but not downloaded, and which failed.

See rules in references/task-ledger.md. Four key points:

  1. Status is "Quality Passed" and file exists → Skip
  2. Has taskId and status is "Waiting / Generating" → Only query, don't create new
  3. Status is "Generated successfully, pending download" → Only download; if URL expired, query same taskId for new URL
  4. Status is "Failed" → Don't automatically retry; wait for user to explicitly say redo

VII. How to Handle Failure

First locate which layer is broken, then decide what to change. Don't start changing prompts right away.

PhenomenonRoot CauseWhere to Change
Character distorted, product looks differentNo first frame, or first frame itself is wrongAdd/replace first frame
Shake, flickeringToo many actions describedReduce to one action
Text messed up, extra fingersPrompt requires model to write text / do complex hand movementsLeave text to post-production, simplify hand movements
Wrong aspect ratio, black barsParameters don't match outputMark as failure, regenerate; don't crop black bars
Segments don't connectLast frame doesn't match next segment's first frameUse first-last frame mode, or add a transition frame
Missing sentences, only half spokenSegment dialogue word count exceeds shot lengthCut dialogue, or split segment into two
Mispronounced words, different words spokenUncommon characters, polyphonic characters, brand names buried in long sentencesUse common phrasing; make brand names a separate sentence
Dialogue drowned by musicPrompt didn't say "no music" or "don't cover voice"Add an audio constraint line, regenerate
No sound at allAccidentally used --no-audio, or audio disabledCheck submission parameters, regenerate
Submission error / 429Too high concurrency hitting rate limit--concurrency 2, rerun; don't change prompt
Same segment keeps failingMultiple variables changed at onceChange only one variable at a time

Dialogue issues account for more than half of all failures. The commonality: the visuals look fine; only listening reveals the problem. So each segment must be heard before marking it as passed.

When reworking, change only one variable at a time. Changing prompt, duration, and first frame all at once means even if it succeeds, you won't know which change caused it, and the same issue will recur.

See detailed diagnosis in references/clip-review.md.


VIII. Boundaries

  • Do not redesign visuals: Character, scene, color palette, lighting are locked at S2; only make them move here
  • Do not change dialogue text: Script is read as written. To change words, go back to S1/S2; don't adjust here
  • Do not create subtitles: Text is always added in post-production. Model can "speak" Chinese but cannot "write" Chinese
  • Do not fix audio: Mispronounced segments can only be regenerated, or subtitles modified to match. No mixing, no re-recording here
  • Do not edit: No splicing, no cutting to beat, no color grading—that's S4's job
  • Do not judge "aesthetic quality": Only judge "usable or not." Look and feel belong to the review stage
  • Do not guarantee first-time success: Generation is probabilistic; 2-4 candidates are normal, not failure

IX. Reference Materials

FileWhen to Read
references/api-and-modes.mdChecking API, parameters, three mode fields, error responses
references/video-prompt.mdWriting video prompts, modifying prompts
references/task-ledger.mdBuilding ledger, continuing work, deciding whether to resubmit
references/clip-review.mdFrame sampling QA, judging failure, deciding rework direction
references/assembly-ops.mdS4 splicing, subtitle and mixing FFmpeg implementation details
assets/gen-ledger-template.mdWhen building the ledger
assets/dialogue-final-template.jsonWhen recording final dialogue, transcription assistance, and manual final review
assets/batch-tasks-example.jsonWhen running batch tasks

Scripts:

ScriptPurpose
scripts/kie_seedance.pySubmit / batch / query / wait for download / upload reference frame
scripts/inspect_clip.pyMedia inspection (requires ffprobe)

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

lhaovo/short-video-skills

为视频生成准备可用的图——把资产清单变成能直接喂给图生视频的素材:排生产顺序、定资产级别、出候选图、做一致性验收、按编号落盘、回写清单状态。支持三种来源:实拍、AI 生成、官方素材,不强制实拍。当用户说「准备素材」「出资产图」「首帧图」「角色三视图」「产品图跑一下」「资产对不上」「这条要哪些图」时使用。只管把图做出来并验收,不写分镜,不直接生成视频。

lhaovo/short-video-skills

一条短视频从策划到发布的流程总控:建制作目录、依次走「剧本分镜 → 提示词 → 生成 → 交付 → 发布」五段、每段设门禁、记录流程状态、支持跨会话续做。当用户要开一条新片子、问「下一步做什么」、想接着做某条没做完的片子、要把分镜变成提示词、要整理素材与成片、要准备发布包时使用。本技能只规定流程、目录与产物标准,不重复各环节的写作规范。

lhaovo/short-video-skills

把「我想拍点什么」变成一条想清楚的片子——先定主题(出 5 个候选、标明类型、给出推荐与淘汰理由),再定结构与分段剧本,最后切成镜头级内容分镜。支持两种入口:一句话主题(需要发散选题)与已有拆解剧本(跳过选题,先问复刻需求与复刻强度再判定改写)。当用户提到选题、定主题、短视频策划、写剧本、写大纲、分镜、镜头脚本、不知道拍什么、内容怎么排、科普干货、剧情软广、钩子怎么写、复刻别人的剧本时使用。只管内容层(讲什么、怎么讲),不碰执行层;内置的内容红线只防明显自伤,不替代合规审查。

lhaovo/short-video-skills

把已定稿的分镜表翻成可直接执行的两份清单——资产清单(要准备哪些图、每张图的图像提示词)与生成清单(每段视频的时长、模式、素材引用与提示词)。覆盖画面化、资产编号、切分生成单元、Seedance 视频提示词写法、首帧方案、一致性与失败诊断。当用户说「把分镜变成提示词」「写视频提示词」「这条片子要哪些图」「生成清单」「某个镜头生成不出来」时使用。只做翻译与清单,不重新编排内容,不直接出图出片。

Related Skills