zerocut-cli 0.3.4 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -102,6 +102,7 @@ zerocut config --ott <token> --region <cn|us> # non-interactive
102
102
  - Options:
103
103
  - `--prompt <prompt>` (required)
104
104
  - `--model <model>` (seedream|seedream-pro|seedream-5l|banana|banana2|banana-pro|wan|wan-pro)
105
+ - `--type <type>` (default|storyboard|subject-turnaround, default: default)
105
106
  - `--aspectRatio <ratio>` (1:1|3:4|4:3|16:9|9:16|2:3|3:2|21:9|1:4|4:1|1:8|8:1)
106
107
  - `--resolution <resolution>` (1K|2K|4K)
107
108
  - `--refs <img1,img2,...>` (comma-separated paths/URLs)
@@ -158,7 +159,7 @@ zerocut config --ott <token> --region <cn|us> # non-interactive
158
159
 
159
160
  ```bash
160
161
  # Create an image (default action)
161
- npx zerocut-cli image --prompt "a cat" --model seedream --aspectRatio 1:1 --resolution 1K --refs ref1.png,ref2.jpg --output out.png
162
+ npx zerocut-cli image --prompt "a cat" --model seedream --type default --aspectRatio 1:1 --resolution 1K --refs ref1.png,ref2.jpg --output out.png
162
163
 
163
164
  # Create video (default action)
164
165
  npx zerocut-cli video --prompt "city night drive" --duration 12 --model vidu --refs frame1.png,frame2.png --resolution 720p --output movie.mp4
@@ -38,11 +38,13 @@ function register(program) {
38
38
  "8:1",
39
39
  ];
40
40
  const allowedResolutions = ["1K", "2K", "4K"];
41
- async function performImageGeneration(session, { prompt, model, aspectRatio, resolution, refsList, output, }) {
41
+ const allowedTypes = ["default", "storyboard", "subject-turnaround"];
42
+ async function performImageGeneration(session, { prompt, model, type, aspectRatio, resolution, refsList, output, }) {
42
43
  const referenceImages = await Promise.all(refsList.map(async (ref) => ({ url: await (0, cerevox_1.getMaterialUri)(session, ref) })));
43
44
  const onProgress = (0, progress_1.createProgressSpinner)("inferencing");
44
45
  const payload = {
45
46
  model: model || "seedream-5l",
47
+ type,
46
48
  prompt,
47
49
  aspect_ratio: aspectRatio,
48
50
  resolution,
@@ -95,6 +97,13 @@ function register(program) {
95
97
  return;
96
98
  }
97
99
  const modelArg = (model ?? undefined);
100
+ const type = typeof opts.type === "string" ? opts.type.trim() : "default";
101
+ if (!allowedTypes.includes(type)) {
102
+ process.stderr.write(`Invalid value for --type: ${type}. Allowed: ${allowedTypes.join("|")}\n`);
103
+ process.exitCode = 1;
104
+ return;
105
+ }
106
+ const typeArg = type;
98
107
  const aspectRatio = typeof opts.aspectRatio === "string"
99
108
  ? opts.aspectRatio.trim()
100
109
  : undefined;
@@ -121,6 +130,7 @@ function register(program) {
121
130
  await performImageGeneration(session, {
122
131
  prompt,
123
132
  model: modelArg,
133
+ type: typeArg,
124
134
  aspectRatio,
125
135
  resolution,
126
136
  refsList,
@@ -131,6 +141,7 @@ function register(program) {
131
141
  parent
132
142
  .option("--prompt <prompt>", "Text prompt for image generation (required)")
133
143
  .option("--model <model>", `Generator model: ${allowedModels.join("|")}`)
144
+ .option("--type <type>", `Image type: ${allowedTypes.join("|")}`)
134
145
  .option("--aspectRatio <ratio>", `Aspect ratio: ${allowedAspectRatios.join("|")}`)
135
146
  .option("--resolution <resolution>", `Resolution: ${allowedResolutions.join("|")}`)
136
147
  .option("--refs <refs>", "Comma-separated reference image paths/urls")
@@ -142,6 +153,7 @@ function register(program) {
142
153
  .description("Create a new image; requires --prompt")
143
154
  .option("--prompt <prompt>", "Text prompt for image generation (required)")
144
155
  .option("--model <model>", `Generator model: ${allowedModels.join("|")}`)
156
+ .option("--type <type>", `Image type: ${allowedTypes.join("|")}`)
145
157
  .option("--aspectRatio <ratio>", `Aspect ratio: ${allowedAspectRatios.join("|")}`)
146
158
  .option("--resolution <resolution>", `Resolution: ${allowedResolutions.join("|")}`)
147
159
  .option("--refs <refs>", "Comma-separated reference image paths/urls")
@@ -18,6 +18,7 @@ export declare function syncToTOS(url: string): Promise<string>;
18
18
  export declare function runFFMpegCommand(session: Session, command: string, resources?: string[]): Promise<{
19
19
  exitCode: number;
20
20
  outputFilePath: string;
21
+ tosUrl: string | undefined;
21
22
  data: {
22
23
  stdout: string;
23
24
  stderr: string | undefined;
@@ -193,20 +193,23 @@ async function runFFMpegCommand(session, command, resources = []) {
193
193
  cwd: workDir,
194
194
  });
195
195
  const outputFilePath = trimmedCommand.startsWith("ffmpeg")
196
- ? finalCommand.split(" ").pop() || ""
196
+ ? (finalCommand.split(" ").pop() || "").replace(/^["']|["']$/g, "")
197
197
  : "";
198
198
  const sandboxFilePath = (0, node_path_2.join)(workDir, outputFilePath);
199
+ let tosUrl;
199
200
  // 等待命令完成
200
201
  const result = await response.json();
201
202
  if (result.exitCode === 0 && outputFilePath) {
202
203
  const savePath = (0, node_path_2.join)(process.cwd(), (0, node_path_1.basename)(outputFilePath));
203
- console.log(sandboxFilePath, savePath);
204
204
  const files = session.files;
205
205
  await files.download(sandboxFilePath, savePath);
206
+ const sandboxUrl = await getMaterialUri(session, savePath);
207
+ tosUrl = await syncToTOS(sandboxUrl);
206
208
  }
207
209
  return {
208
210
  exitCode: result.exitCode,
209
211
  outputFilePath,
212
+ tosUrl,
210
213
  data: {
211
214
  stdout: result.stdout || (!result.exitCode && result.stderr) || "",
212
215
  stderr: result.exitCode ? result.stderr : undefined,
@@ -102,13 +102,14 @@ Default action: `create`
102
102
 
103
103
  ```bash
104
104
  npx zerocut-cli image --prompt "a cat on a bike" --output out.png
105
- npx zerocut-cli image create --prompt "a cat on a bike" --model seedream-5l --aspectRatio 1:1 --resolution 1K --refs ref1.png,ref2.jpg --output out.png
105
+ npx zerocut-cli image create --prompt "a cat on a bike" --model seedream-5l --type default --aspectRatio 1:1 --resolution 1K --refs ref1.png,ref2.jpg --output out.png
106
106
  ```
107
107
 
108
108
  Options:
109
109
 
110
110
  - `--prompt <prompt>` required
111
111
  - `--model <model>`
112
+ - `--type <type>`
112
113
  - `--aspectRatio <ratio>`
113
114
  - `--resolution <resolution>`
114
115
  - `--refs <refs>` comma-separated local paths or URLs
@@ -118,6 +119,8 @@ Validation rules:
118
119
 
119
120
  - `--prompt` must be non-empty
120
121
  - `--model` allowed: `seedream|seedream-pro|seedream-5l|banana|banana2|banana-pro|wan|wan-pro`
122
+ - `--type` allowed: `default|storyboard|subject-turnaround`
123
+ - unless user specifies type, default to `default`
121
124
  - `--aspectRatio` allowed: `1:1|3:4|4:3|16:9|9:16|2:3|3:2|21:9|1:4|4:1|1:8|8:1`
122
125
  - unless user specifies aspect ratio, default to `16:9`
123
126
  - `--resolution` allowed: `1K|2K|4K`
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: one-click-video
3
- description: Use this skill when the user wants to produce a complete short video from a topic with fast CLI-driven workflow: scene planning, storyboard creation, scene video generation, optional background music, and final ffmpeg composition.
3
+ description: Use this skill when the user asks for one-click end-to-end video creation. It delivers a complete final video with consistent visual style, coherent narrative, stable voice strategy, storyboard-driven scene generation, optional BGM, and final ffmpeg composition using zerocut-cli only.
4
4
  homepage: "https://github.com/liubei-ai/zerocut-cli"
5
5
  source: "https://github.com/liubei-ai/zerocut-cli"
6
6
  requires_binaries:
@@ -10,35 +10,317 @@ requires_binaries:
10
10
 
11
11
  # One-Click Video
12
12
 
13
- ## Purpose
13
+ ## Role
14
14
 
15
- Create a deliverable final video by orchestrating `zerocut-cli` commands only.
15
+ You are a film-level director, storyboard designer, dialogue writer, and final delivery coordinator. Your objective is not to output random clips, but to deliver one coherent final video with clear narrative progression, consistent visual style, stable voice identity, and synchronized audio-visual rhythm.
16
16
 
17
- ## Runtime Requirements
17
+ ## Mission
18
18
 
19
- - Use CLI commands only, never MCP tool names.
20
- - Ensure `zerocut-cli` is available:
21
- - `pnpm dlx zerocut-cli help`
22
- - `pnpm add -g zerocut-cli && zerocut-cli help`
23
- - `npx zerocut-cli help`
19
+ Based on user topic, purpose, duration, style, references, and subject assets:
24
20
 
25
- ## Required Pre-Check
21
+ 1. Decide whether recurring subjects are required.
22
+ 2. Define subject, outfit, prop, and style constraints.
23
+ 3. Split concept into 1-5 scenes.
24
+ 4. Create storyboard and camera rhythm for every scene.
25
+ 5. Generate scene videos with consistent constraints.
26
+ 6. Create matching BGM.
27
+ 7. Compose final deliverable.
26
28
 
27
- Run config check first:
29
+ ## Highest-Priority Constraints
30
+
31
+ 1. Follow full workflow. Do not skip core steps.
32
+ 2. Perform quality checks at each step.
33
+ 3. Use CLI commands only, never MCP tool names.
34
+
35
+ Required workflow:
36
+
37
+ project preparation -> subject creation -> scene planning (ensure `./scene-bible.md` exists) -> storyboard generation -> scene video generation -> BGM generation -> final composition
38
+
39
+ ## Runtime Preparation
40
+
41
+ Verify CLI availability:
42
+
43
+ ```bash
44
+ npx zerocut-cli help
45
+ ```
46
+
47
+ Run config pre-check:
28
48
 
29
49
  ```bash
30
50
  npx zerocut-cli config list
31
51
  ```
32
52
 
33
- If `apiKey` is missing, stop and request user OTT token:
53
+ If `apiKey` is missing, stop and ask user OTT token:
34
54
 
35
55
  ```bash
36
56
  npx zerocut-cli config --ott <token> --region <cn|us>
37
57
  ```
38
58
 
39
- ## Video Parameter Contract
59
+ ## Model Policy
60
+
61
+ ### Image model policy
62
+
63
+ - Default image model is `banana2` when user does not explicitly name a model.
64
+ - Do not switch image model because of aesthetic preference words like "more cinematic" or "more realistic" unless model name is explicit.
65
+ - This applies to subject turnaround, storyboard, and any reference image generation.
66
+
67
+ ### Video model policy
68
+
69
+ - Default video model is `seedance-2.0-turbo` when user does not explicitly specify a compliant model.
70
+ - Allowed video models in this skill:
71
+ - `seedance-2.0`
72
+ - `seedance-2.0-turbo`
73
+ - `seedance-2.0-fast`
74
+ - If user requests an unsupported video model, fallback to `seedance-2.0-turbo`.
75
+
76
+ ### Priority
77
+
78
+ 1. Explicit user model
79
+ 2. Skill default model
80
+
81
+ ## Audio Strategy
82
+
83
+ - Unless user explicitly asks for mute, keep scene audio (`--withAudio`).
84
+ - Disable BGM at scene generation stage (`--withBGM false`).
85
+ - Add BGM only in final composition stage.
86
+ - If scenes include narration/dialogue, preserve intelligibility first.
87
+
88
+ ## Narration And Dialogue Rules
89
+
90
+ - If user does not provide exact script, generate concise narration/dialogue aligned with story and duration.
91
+ - If user provides script or key message, keep original intent, wording priority, and brand keywords.
92
+ - If narration exists for a scene, inject it at the beginning of the scene video prompt with this exact format:
93
+ - `【narration_tone】Narration:<text_content>\n`
94
+ - `narration_tone` must follow the voice design rules in this skill.
95
+ - `text_content` must be written in the user-required language.
96
+ - Estimate speech duration with normal-slow pace.
97
+ - Per-scene narration/dialogue total should not exceed 12 seconds.
98
+ - If over limit, compress script or split into more scenes.
99
+
100
+ ## Voice Consistency Rules
101
+
102
+ - Keep stable voice identity per character across scenes.
103
+ - Keep narration voice stable across the full video unless story explicitly changes narrator.
104
+ - Use voice formula internally:
105
+ - gender + age range + vocal traits + speaking pace + emotional baseline + language
106
+
107
+ ## Subject Creation Rules
108
+
109
+ - Not all tasks require recurring subjects.
110
+ - For narrative/ad/commercial stories with recurring characters, subject creation is mandatory.
111
+ - If user provides subject reference images, use them to maintain consistency.
112
+ - If user does not provide references, design stable subject specs first.
113
+
114
+ Suggested subject turnaround command:
115
+
116
+ ```bash
117
+ npx zerocut-cli image --prompt "<subject turnaround prompt>" --model banana2 --type subject-turnaround --aspectRatio 1:1 --resolution 1K --output 001_subject_turnaround.png
118
+ ```
119
+
120
+ ## Scene Planning And Scene-Bible Rules
121
+
122
+ Scene planning is a critical quality gate. Before any storyboard or video generation, create a complete `./scene-bible.md` and treat it as the single source of truth for all downstream prompts.
123
+
124
+ ### Mandatory Scene-Bible Checklist
125
+
126
+ `scene-bible.md` must include:
127
+
128
+ 1. **Project intent**
129
+ - user goal, platform, target audience, runtime target, delivery format
130
+ 2. **Global style lock**
131
+ - style keywords, texture/look, color system, lighting logic, camera language, post-look constraints
132
+ 3. **Model lock**
133
+ - image model and video model selected by policy
134
+ 4. **Subject lock**
135
+ - subject roster, appearance lock, outfit lock, prop lock, relationship rules
136
+ 5. **Voice lock**
137
+ - narrator/character voice formula and language rules
138
+ 6. **Scene plan**
139
+ - 1-5 scenes, each with objective, emotion shift, estimated duration, and shot count
140
+ 7. **Shot plan per scene**
141
+ - each shot has self-contained prompt requirements and camera intention
142
+ 8. **Narration/dialogue plan**
143
+ - per scene script, narration tone, language, and estimated speech duration (must stay within 12s per scene)
144
+ 9. **Asset binding**
145
+ - which references are required for each scene (`--storyboard`, `--persons`, `--refs`)
146
+ 10. **Output plan**
147
+ - deterministic output filenames for storyboard, scene clips, bgm, and final output
148
+ 11. **Quality gates**
149
+ - pass/fail checks before moving to storyboard and before moving to video generation
150
+
151
+ ### Scene-Bible Template
152
+
153
+ Use this structure when writing `./scene-bible.md`:
154
+
155
+ ```markdown
156
+ # Scene Bible
157
+
158
+ ## 1. Project Intent
159
+
160
+ - Goal:
161
+ - Platform:
162
+ - Audience:
163
+ - Runtime Target:
164
+ - Delivery:
165
+
166
+ ## 2. Global Style Lock
167
+
168
+ - Style:
169
+ - Texture:
170
+ - Color System:
171
+ - Lighting Logic:
172
+ - Camera Language:
173
+ - Post-Look:
174
+
175
+ ## 3. Model Lock
176
+
177
+ - Image Model:
178
+ - Video Model:
179
+
180
+ ## 4. Subject Lock And References
181
+
182
+ - Subject A:
183
+ - Appearance Lock:
184
+ - Outfit Lock:
185
+ - Prop Lock:
186
+ - Reference Files:
187
+
188
+ ## 5. Voice Lock
189
+
190
+ - Narrator Formula:
191
+ - Character A Formula:
192
+ - Language:
193
+
194
+ ## 6. Scene Plan (1-5 Scenes)
195
+
196
+ ### Scene 1
197
+
198
+ - Goal:
199
+ - Emotion:
200
+ - Duration:
201
+ - Shot Count:
202
+ - Storyboard Output:
203
+ - Video Output:
204
+
205
+ ## 7. Shot Plan
206
+
207
+ ### Scene 1 Shot 1
208
+
209
+ - Shot Purpose:
210
+ - Camera:
211
+ - Action:
212
+ - Prompt Must Include:
40
213
 
41
- When generating scene videos, only use legal `video` command parameters:
214
+ ## 8. Narration/Dialogue Plan
215
+
216
+ ### Scene 1
217
+
218
+ - Script:
219
+ - Estimated Speech Duration:
220
+
221
+ ## 9. Asset Binding
222
+
223
+ ### Scene 1
224
+
225
+ - Storyboard:
226
+ - Persons:
227
+ - Refs:
228
+
229
+ ## 10. Output Naming Plan
230
+
231
+ - 001_subject_turnaround.png
232
+ - 010_storyboard_scene1.png
233
+ - 020_scene1.mp4
234
+ - 090_bgm.mp3
235
+ - 110_final.mp4
236
+
237
+ ## 11. Quality Gates
238
+
239
+ - Gate A (Before Storyboard):
240
+ - Gate B (Before Video):
241
+ ```
242
+
243
+ ### Enforced Planning Rules
244
+
245
+ - Do not generate storyboard until `scene-bible.md` exists and all mandatory sections are filled.
246
+ - Do not generate scene video until scene-level entries are complete in scene bible.
247
+ - All storyboard prompts and video prompts must inherit locked constraints from scene bible.
248
+ - If user updates style/story/character constraints, update `scene-bible.md` first, then regenerate affected assets.
249
+ - If quality gates fail, revise the plan instead of forcing downstream generation.
250
+
251
+ ### Quality Gate Definitions
252
+
253
+ - Gate A (Before Storyboard) passes only when:
254
+ - global style lock is explicit and non-ambiguous
255
+ - scene count, duration, and shot count are fully defined
256
+ - subject lock and voice lock are complete for all recurring characters
257
+ - asset binding is ready for each scene
258
+ - Gate B (Before Video) passes only when:
259
+ - every scene has a storyboard prompt and output target
260
+ - every scene has narration/dialogue text and duration estimate
261
+ - every scene prompt is self-contained and does not rely on previous context
262
+ - scene durations and speech durations are within constraints
263
+
264
+ ### Scene Planning Deliverables Per Scene
265
+
266
+ For each scene, planning output must include:
267
+
268
+ 1. one-sentence scene objective
269
+ 2. emotional transition
270
+ 3. exact duration target
271
+ 4. shot list with camera intention
272
+ 5. storyboard prompt draft
273
+ 6. video prompt draft
274
+ 7. narration/dialogue draft
275
+ 8. required assets list (`--storyboard`, `--persons`, `--refs`)
276
+
277
+ ## Scene And Camera Rules
278
+
279
+ - Split into 1-5 scenes.
280
+ - Recommended scene duration is 12-15s, and scene target should not exceed 15s.
281
+ - Each scene can contain 1-6 shots.
282
+ - Maintain consistency of style, lighting logic, camera language, character identity, and voice design across scenes.
283
+
284
+ ## Storyboard Rules
285
+
286
+ - Every scene must have a storyboard image.
287
+ - Storyboard generation must use `npx zerocut-cli image` with `--type storyboard`.
288
+ - `--type` value is strictly locked to `storyboard` for storyboard generation. Do not use `default`, `subject-turnaround`, or any other value.
289
+ - Storyboard must include environment, subject position/action, framing, camera movement, rhythm, and key emotion.
290
+ - If a subject appears in that scene, include matching subject references.
291
+ - Storyboard prompts must be complete and self-contained.
292
+
293
+ Storyboard command:
294
+
295
+ ```bash
296
+ npx zerocut-cli image --prompt "<scene storyboard prompt>" --model banana2 --type storyboard --aspectRatio 16:9 --resolution 1K --refs 001_subject_turnaround.png --output 010_storyboard_scene1.png
297
+ ```
298
+
299
+ If no subject references are required in that scene, omit `--refs`.
300
+
301
+ ## Prompt Independence Hard Constraint
302
+
303
+ - Every shot prompt and every scene video prompt must be fully self-contained.
304
+ - If narration is present, the prompt must start with `【narration_tone】Narration:<text_content>\n`.
305
+ - Validate narration before generation: tone must match voice design and text language must match user requirement.
306
+ - Do not use shorthand such as:
307
+ - "same as previous shot"
308
+ - "continue above"
309
+ - "keep unchanged"
310
+ - "refer to previous settings"
311
+
312
+ ## Video Generation Rules
313
+
314
+ - Scene video must be grounded on storyboard and scene-specific references.
315
+ - Every scene prompt must repeat key constraints explicitly.
316
+ - Defaults:
317
+ - `--resolution 720p`
318
+ - `--aspectRatio 9:16` unless user requests otherwise
319
+ - `--withAudio`
320
+ - `--withBGM false`
321
+ - Keep each scene duration compatible with script and pacing.
322
+
323
+ Allowed video parameters:
42
324
 
43
325
  - `--prompt <prompt>` required
44
326
  - `--duration <seconds>`
@@ -48,93 +330,92 @@ When generating scene videos, only use legal `video` command parameters:
48
330
  - `--firstFrame <image>`
49
331
  - `--lastFrame <image>`
50
332
  - `--storyboard <image>`
51
- - `--persons <persons>` comma-separated image paths/URLs, mapped to `type=person`
333
+ - `--persons <persons>`
52
334
  - `--refs <assets>`
53
335
  - `--resolution <resolution>`
54
336
  - `--aspectRatio <ratio>`
55
337
  - `--withAudio`
56
- - `--withBGM <withBGM>` `true|false`, default `true`
338
+ - `--withBGM <withBGM>`
57
339
  - `--optimizeCameraMotion`
58
340
  - `--output <file>`
59
341
 
60
- ## Output Naming Rules
61
-
62
- - If user does not provide output path, generate meaningful names with 3-digit prefix:
63
- - `001_storyboard_scene1.png`
64
- - `002_scene1.mp4`
65
- - `003_scene2.mp4`
66
- - `004_bgm.mp3`
67
- - `005_final.mp4`
68
-
69
- ## Workflow
70
-
71
- 1. Understand topic, goal, duration, platform orientation, and style.
72
- 2. Split into 1-5 scenes with clear narrative progression.
73
- 3. Create one storyboard image for each scene.
74
- 4. Generate one video clip for each scene using only legal video parameters.
75
- 5. Optionally generate one background music track with `music` command.
76
- 6. Compose final video with `ffmpeg` command.
77
-
78
- ## Scene Storyboard Step
79
-
80
- Generate storyboard for each scene:
81
-
82
- ```bash
83
- npx zerocut-cli image --prompt "<scene storyboard prompt>" --model banana2 --aspectRatio 16:9 --resolution 1K --output 001_storyboard_scene1.png
84
- ```
85
-
86
- ## Scene Video Step
87
-
88
- Use storyboard as `--storyboard`, optional character images via `--persons`, and optional extra references via `--refs`.
342
+ Scene video example:
89
343
 
90
344
  ```bash
91
345
  npx zerocut-cli video \
92
- --prompt "<scene video prompt>" \
93
- --model seedance-2.0 \
346
+ --prompt "<self-contained scene video prompt>" \
347
+ --model seedance-2.0-turbo \
94
348
  --duration 12 \
95
349
  --resolution 720p \
96
350
  --aspectRatio 16:9 \
97
- --storyboard 001_storyboard_scene1.png \
351
+ --storyboard 010_storyboard_scene1.png \
98
352
  --persons actor_front.png,actor_side.png \
99
353
  --refs prop_ref.png,env_ref.png \
100
354
  --withAudio \
101
- --withBGM true \
102
- --output 002_scene1.mp4
355
+ --withBGM false \
356
+ --output 020_scene1.mp4
103
357
  ```
104
358
 
105
- ## Background Music Step
359
+ ## BGM Rules
360
+
361
+ - Generate BGM only after all scene videos are ready.
362
+ - Recommended durations: `30|60|90|120|150` seconds.
363
+ - BGM duration must be longer than total scene duration.
364
+ - Keep BGM supportive, never overpower dialogue/narration.
106
365
 
107
- Generate one BGM track when needed:
366
+ BGM example:
108
367
 
109
368
  ```bash
110
- npx zerocut-cli music --prompt "<bgm prompt>" --output 004_bgm.mp3
369
+ npx zerocut-cli music --prompt "<bgm prompt>" --output 090_bgm.mp3
111
370
  ```
112
371
 
113
- ## Final Composition Step (ffmpeg only)
372
+ ## Final Composition Rules
373
+
374
+ - Concatenate scene videos in order.
375
+ - Mix original scene audio and BGM with proper balance.
376
+ - Keep final pacing, narrative continuity, and style consistency.
114
377
 
115
378
  Create concat list:
116
379
 
117
380
  ```bash
118
- printf "file '002_scene1.mp4'\nfile '003_scene2.mp4'\n" > concat.txt
381
+ printf "file '020_scene1.mp4'\nfile '030_scene2.mp4'\n" > concat.txt
119
382
  ```
120
383
 
121
- Concatenate scene clips:
384
+ Concatenate:
122
385
 
123
386
  ```bash
124
- npx zerocut-cli ffmpeg --args -f concat -safe 0 -i concat.txt -c copy 005_concat.mp4 --resources concat.txt 002_scene1.mp4 003_scene2.mp4
387
+ npx zerocut-cli ffmpeg --args -f concat -safe 0 -i concat.txt -c copy 100_concat.mp4 --resources concat.txt 020_scene1.mp4 030_scene2.mp4
125
388
  ```
126
389
 
127
- Mix BGM with original video audio:
390
+ Mix BGM:
128
391
 
129
392
  ```bash
130
- npx zerocut-cli ffmpeg --args -i 005_concat.mp4 -i 004_bgm.mp3 -filter_complex "[1:a]volume=0.2[bgm];[0:a][bgm]amix=inputs=2:duration=first:dropout_transition=2[aout]" -map 0:v -map "[aout]" -c:v copy -c:a aac 005_final.mp4 --resources 005_concat.mp4 004_bgm.mp3
393
+ npx zerocut-cli ffmpeg --args -i 100_concat.mp4 -i 090_bgm.mp3 -filter_complex "[1:a]volume=0.2[bgm];[0:a][bgm]amix=inputs=2:duration=first:dropout_transition=2[aout]" -map 0:v -map "[aout]" -c:v copy -c:a aac 110_final.mp4 --resources 100_concat.mp4 090_bgm.mp3
131
394
  ```
132
395
 
133
- ## Hard Rules
396
+ ## Failure Handling
397
+
398
+ - If command output contains `Not enough credits`, stop immediately and ask user to recharge.
399
+ - If a scene drifts away from global style, revise prompt and regenerate before final composition.
400
+ - If voice identity drifts, revise script/constraints and regenerate the affected scene.
401
+ - Never skip core steps and output incomplete low-quality final result.
402
+
403
+ ## Output Naming Rules
404
+
405
+ If user does not provide explicit output names, use meaningful incremental names:
406
+
407
+ - `001_subject_turnaround.png`
408
+ - `010_storyboard_scene1.png`
409
+ - `020_scene1.mp4`
410
+ - `030_scene2.mp4`
411
+ - `090_bgm.mp3`
412
+ - `100_concat.mp4`
413
+ - `110_final.mp4`
414
+
415
+ ## Non-Negotiable Rules
134
416
 
135
- - Do not introduce non-CLI tool calls.
136
- - Do not use parameters outside the legal `video` parameter contract.
137
- - Keep single scene duration within model limits.
138
- - Keep visual style consistent across all scenes.
139
- - Keep role identity consistent when using `--persons`.
140
- - Do not generate subtitles in this workflow.
417
+ - Use only `zerocut-cli` commands.
418
+ - Keep prompts complete and executable without hidden context.
419
+ - Keep style consistency across all scenes.
420
+ - Keep character and voice consistency across all scenes.
421
+ - Keep per-scene language duration within 12 seconds at normal-slow pace.