New: Earn 20% as an AgentAlley affiliate. Share your link and earn on every sale you refer. Join now New: Earn 20% as an affiliate. Join now

Full production pipeline covering story to scenes

Director — Story-to-Video Production Pipeline

by artokun · MIT license · ★ 759 on GitHub · updated Sep 21

Director — Story-to-Video Production Pipeline cover

Full production pipeline covering story to scenes, Z-Image start frames, Qwen Edit end frames, WAN FLF video clips, ffmpeg concatenation

---
name: director
description: Full production pipeline covering story to scenes, Z-Image start frames, Qwen Edit end frames, WAN FLF video clips, ffmpeg concatenation
globs:
  - "**/*.json"
---

# Director — Story-to-Video Production Pipeline

## Overview

The Director skill runs a complete short film production from a text story. It breaks the story into scenes, generates start/end frames for each, creates video clips from frame pairs, and concatenates everything into a final video.

The pipeline runs Story Planning → Z-Image Hero + Character Refs → Qwen Edit Chain (all frames) → WAN 2.2 FLF Video Clips → ffmpeg Concatenation.

Key architectural decisions:
- 1 hero frame + edit chain for character consistency (NEVER independent Z-Image per scene)
- Inter-scene frame continuity. Scene N's end frame IS Scene N+1's start frame (same image file, no edit gap)

Overview

The Director skill runs a complete short film production from a text story. It breaks the story into scenes, generates start/end frames for each, creates video clips from frame pairs, and concatenates everything into a final video.

Manual install (npx, ZIP)
Claude Codenpx skills add artokun/comfyui-mcp --skill director -g -a claude-code
Claude Code (manual)mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/artokun/comfyui-mcp/tar.gz/1d5b12b1b499 \ | tar -xz -C ~/.claude/skills --strip-components=3 comfyui-mcp-1d5b12b1b499/plugin/skills/director
Windows (PowerShell)New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/c5eb71e15436d5fd336c/director.zip" -OutFile "$env:TEMP\director.zip"; Expand-Archive "$env:TEMP\director.zip" -DestinationPath "$HOME\.claude\skills" -Force
Claude.ai / desktopDownload the ZIP and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md17.8 KB
Read the files here
artokun/1d5b12b1 file
SKILL.md
Show the full text340 lines

Director — Story-to-Video Production Pipeline

Overview

The Director skill runs a complete short film production from a text story. It breaks the story into scenes, generates start/end frames for each, creates video clips from frame pairs, and concatenates everything into a final video.

The pipeline runs Story Planning → Z-Image Hero + Character Refs → Qwen Edit Chain (all frames) → WAN 2.2 FLF Video Clips → ffmpeg Concatenation.

Key architectural decisions:

  • 1 hero frame + edit chain for character consistency (NEVER independent Z-Image per scene)
  • Inter-scene frame continuity. Scene N's end frame IS Scene N+1's start frame (same image file, no edit gap)
  • Character reference images fed into Qwen Edit's extra image slots
  • State file persists to disk for context compaction survival
  • Each scene is independently retryable without affecting others
  • clear_vram between every model family switch

CRITICAL: Inspect modes + verify every output

This pipeline drives the user's live canvas across many stages, so two habits are non-negotiable:

  • Inspect node modes before each render. After loading any pack/template/subgraph and before panel_run, check each node's mode (panel_graph_outline marks [bypass]/[mute]; panel_query_graph detail rows carry it). A bypass node is skipped (passes input through); a mute node and everything downstream don't execute. If the path, branch, or switch you need is bypassed or muted, enable it with panel_set_node_mode (set the wanted node active, the unwanted one bypass/mute). Never assume a switch or route is already active.
  • Verify the output matches before moving on. Every Phase-N render is a gate. Look at the produced frame or clip (view it) and confirm it matches the intent BEFORE advancing or reporting progress. If it's wrong, diagnose (wrong prompt path? a bypassed/muted builder or switch? wrong widget? wrong ref image?), fix, and rerun. Do NOT declare a phase done or report progress you haven't verified.
  • Confirm VIDEO renders via the filesystem, not /history. For a VHS_VideoCombine / LTX / WAN clip, do NOT rely on get_history / queue (action:"status") to confirm it exists. VHS-style video nodes write the .mp4 but frequently do NOT register an output in ComfyUI's /history (prompt shows done, empty outputs, no error). Confirm the file with get_image (action:"list_outputs") (now lists videos too, tagged kind: "video") by filename_prefix + fresh mtime, then chain it forward with upload_image (action:"stage").
  • Bypass completed stages before queuing the next one. If you build the multi-stage pipeline on ONE canvas (e.g. Krea2 → LTX → WAN) rather than running each phase in isolation, once a stage has run and its output is captured/staged, panel_set_node_mode(mode:"bypass") that stage's nodes BEFORE you panel_run the next stage. Otherwise panel_run re-executes the whole graph and you pay for and wait on already-finished work, a real and costly failure mode. Keep only the active stage live; feed the prior output forward with upload_image (action:"stage") (bypass the producer, feed its captured output to the consumer's loader).

CRITICAL: Character Consistency

Independent Z-Image generations per scene produce different-looking characters. This was the #1 problem discovered during testing. The solution:

  1. Generate ONE hero frame with Z-Image. It establishes the main character, setting, and lighting
  2. Generate character reference images: close-up portraits of each character, key props, and the background
  3. Create ALL other scene frames via the Qwen Edit chain from the hero, with character refs in extra image slots
  4. This keeps the same face, clothing, and environment across every frame

8-Phase Pipeline

Phase 1: Story Planning       → Break story into scenes (Claude reasoning, no ComfyUI)
Phase 2: Hero + Refs          → Z-Image: 1 hero frame + character ref portraits + background ref
Phase 3: Hero Review          → Visual verify hero and refs, user approves
Phase 4: Edit Chain           → Qwen Edit: chain ALL scene frames from hero (with char refs in slots 2-3)
Phase 5: Frame Review         → Visual verify all frames, approve/reject/retry
Phase 6: Video Clips          → WAN 2.2 FLF dual Hi-Lo (one clip per scene)
Phase 7: Video Review         → Preview each clip
Phase 8: Final Assembly       → ffmpeg concat all clips into one MP4

State File Format

Saved at ~/code/comfyui-mcp/workflows/director_state_{project_id}.json. Updated after every edit or phase completion.

{
  "project_id": "story_20260216_143022",
  "created": "2026-02-16T14:30:22Z",
  "story": "Original user story text",
  "current_phase": 4,
  "orientation": "portrait",
  "hero_frame": { "file": "director_hero_00001_.png", "seed": 428571, "approved": true },
  "character_refs": {
    "man": "director_ref_man.png",
    "cat": "director_ref_cat.png",
    "woman": "director_ref_woman.png",
    "background": "director_ref_bedroom.png"
  },
  "scenes": [
    {
      "id": 1,
      "description": "Brief scene description",
      "edit_prompt_start": "Qwen Edit instruction to create start frame from source",
      "edit_prompt_end": "Qwen Edit instruction to create end frame from source",
      "edit_source_start": "hero",
      "edit_source_end": "hero",
      "video_prompt": "WAN motion description",
      "start_frame": { "file": "director_s1_start_00001_.png", "seed": 12345, "approved": true },
      "end_frame": { "file": "director_hero_00001_.png", "seed": null, "approved": true },
      "video_clip": { "file": "director_s1_00001.mp4", "seed": 11111, "approved": false },
      "status": "video_pending"
    }
  ],
  "final_video": null,
  "settings": {
    "start_frame_resolution": [832, 1472],
    "video_resolution": [480, 720],
    "video_frames": 81,
    "video_fps": 16
  }
}

Models Used Per Phase

Phase Model Family Key Models VRAM
2: Hero + Refs Z-Image redcraftRedzimageUpdatedJAN30_redzibDX1.safetensors ~17GB
4: Edit Chain Qwen Edit qwen_image_edit_2511_bf16.safetensors + Lightning LoRA ~17-18GB
6: Video Clips WAN 2.2 I2V Remix NSFW Hi+Lo (built-in lightning) ~22-24GB

CRITICAL: clear_vram between every model family switch.

Phase 1: Story Planning

Break the story into 2 to 6 scenes. For each scene, identify:

  • description: what happens (1 to 2 sentences)
  • start frame: what the opening frame looks like
  • end frame: what the closing frame looks like
  • video_prompt: motion description for FLF transition

Identify a hero frame, the single most representative scene image that establishes the main character and setting. This hero will anchor all other frames via Qwen Edit.

Also identify which character reference images are needed (portraits of each character, key props, background).

CRITICAL: Inter-Scene Frame Continuity

The end frame of Scene N must be the EXACT same image file as the start frame of Scene N+1. Do NOT create separate Qwen-edited start frames for subsequent scenes. That causes visible jumps at scene boundaries when the videos are concatenated.

The frame chain for video generation:

Scene 1: S1_start (unique)        → hero (end)
Scene 2: hero (= S1 end)          → S2_end
Scene 3: S2_end (= S2 end)        → S3_end
Scene 4: S3_end (= S3 end)        → S4_end
Scene 5: S4_end (= S4 end)        → S5_end

Only Scene 1 needs a unique start frame. All other scenes inherit their start from the previous scene's end.

Edit Chain Planning

The edit chain produces only end frames (plus Scene 1's unique start frame). Map which end frame derives from which source:

  • Some end frames edit directly from the hero
  • Later end frames may chain from earlier end frames
  • Keep chains shallow (max 4 to 5 deep) to minimize drift

Example chain:

Hero (man+cat on bed)
  ├─ S1 Start: edit hero → remove cat, man alone
  ├─ S2 End: edit hero → replace cat with woman
  │    └─ S3 End: edit S2End → both sit up, man startled
  │         └─ S4 End: edit S3End → sitting close, warm smiles
  │              └─ S5 End: edit S4End → warm embrace

Phase 2: Hero + Character References — Z-Image

Generate with Z-Image RedCraft DX1 (10 steps, CFG 1, euler/simple):

  1. Hero frame: the establishing shot with main character + key elements
  2. Character ref portraits: close-up of each character (man, woman, animal, etc.)
  3. Background ref: the setting without characters

Add to negative prompts for character refs to exclude wrong subjects (e.g., "woman, female" when generating man portrait).

Hero Frame Workflow Template
{
  "1": { "class_type": "CheckpointLoaderSimple", "inputs": { "ckpt_name": "redcraftRedzimageUpdatedJAN30_redzibDX1.safetensors" }},
  "2": { "class_type": "CLIPTextEncode", "inputs": { "clip": ["1", 1], "text": "<hero_prompt>" }, "_meta": { "title": "Positive" }},
  "3": { "class_type": "CLIPTextEncode", "inputs": { "clip": ["1", 1], "text": "3D, ai generated, semi realistic, illustrated, drawing, comic, digital painting, 3D model, blender, video game screenshot, render, smooth textures, CGI, text, writing, subtitle, watermark, logo, blurry, low quality, jpeg artifacts, grainy" }, "_meta": { "title": "Negative" }},
  "4": { "class_type": "EmptyLatentImage", "inputs": { "width": 832, "height": 1472, "batch_size": 1 }},
  "5": { "class_type": "KSampler", "inputs": {
    "model": ["1", 0], "positive": ["2", 0], "negative": ["3", 0], "latent_image": ["4", 0],
    "seed": 42, "steps": 10, "cfg": 1, "sampler_name": "euler", "scheduler": "simple", "denoise": 1
  }},
  "6": { "class_type": "VAEDecode", "inputs": { "samples": ["5", 0], "vae": ["1", 2] }},
  "7": { "class_type": "SaveImage", "inputs": { "images": ["6", 0], "filename_prefix": "director_hero" }}
}

Queue hero + all refs while Z-Image checkpoint is loaded (same checkpoint, different prompts).

Phase 3: Hero Review

Show hero frame and all character refs. User approves or requests regeneration with new seed.

Phase 4: Edit Chain — Qwen Image Edit

CRITICAL: Consistency Rules for Edit Prompts
  1. Always explicitly anchor clothing. "The man wears his grey t-shirt" in EVERY prompt
  2. Always state what doesn't change. "Same bedroom, same warm lighting, same clothing"
  3. Use strong emotion words. "extremely shocked and startled" >> "surprised"
  4. Include proportionality. "Her head and body should be proportional and natural looking"
  5. Prevent head enlargement. In embrace/close-up poses, Qwen Edit tends to enlarge heads. Add an explicit "do not enlarge her head, keep the same small natural size as in the original image"
  6. Describe the transformation, not just the end state
Workflow Template (with Character Reference Slots)
{
  "1": { "class_type": "UNETLoader", "inputs": { "unet_name": "qwen_image_edit_2511_bf16.safetensors", "weight_dtype": "default" }},
  "2": { "class_type": "LoraLoaderModelOnly", "inputs": { "model": ["1", 0], "lora_name": "Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors", "strength_model": 1 }},
  "3": { "class_type": "CLIPLoader", "inputs": { "clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors", "type": "qwen_image" }},
  "4": { "class_type": "VAELoader", "inputs": { "vae_name": "qwen_image_vae.safetensors" }},
  "5": { "class_type": "LoadImage", "inputs": { "image": "<source_scene.png>" }, "_meta": { "title": "Source Scene" }},
  "5b": { "class_type": "LoadImage", "inputs": { "image": "<character_ref.png>" }, "_meta": { "title": "Character Ref" }},
  "5c": { "class_type": "LoadImage", "inputs": { "image": "<background_ref.png>" }, "_meta": { "title": "Background Ref" }},
  "6": { "class_type": "TextEncodeQwenImageEditPlusAdvance_lrzjason", "inputs": {
    "clip": ["3", 0], "prompt": "<edit_prompt>", "vae": ["4", 0],
    "vl_resize_image1": ["5", 0],
    "vl_resize_image2": ["5b", 0],
    "vl_resize_image3": ["5c", 0],
    "target_size": 1024, "target_vl_size": 384,
    "upscale_method": "lanczos", "crop_method": "pad"
  }},
  "7": { "class_type": "ConditioningZeroOut", "inputs": { "conditioning": ["6", 0] }},
  "8": { "class_type": "KSampler", "inputs": {
    "model": ["2", 0], "positive": ["6", 0], "negative": ["7", 0], "latent_image": ["6", 1],
    "seed": 42, "steps": 4, "cfg": 1, "sampler_name": "euler", "scheduler": "simple", "denoise": 1
  }},
  "9": { "class_type": "VAEDecode", "inputs": { "samples": ["8", 0], "vae": ["4", 0] }},
  "10": { "class_type": "SaveImage", "inputs": { "images": ["9", 0], "filename_prefix": "director_s1_start" }}
}

Slots 5b and 5c matter. Feed character reference and background reference into vl_resize_image2 and vl_resize_image3. This helps the vision encoder maintain character appearance across edits.

Chain Execution

Edits are sequential; each depends on the previous output:

  1. Run edit, wait for completion
  2. Stage the output as the next stage's input with upload_image (action:"stage") (pass the output's { filename, subfolder?, type? }); it returns the registered input filename
  3. Use that returned filename as the image in the next edit's LoadImage
  4. Update state file after each edit

Independent edits (both from hero) can run in parallel.

CRITICAL: feeding an output into the next loader (don't guess paths)

To pipe ANY stage's output into the next stage's loader (LoadImage here, VHS_LoadVideo / LoadAudio in the video phases), call upload_image (action:"stage") with the output's { filename, subfolder?, type? } and drop the returned input filename into the loader's image/video/audio widget. For a file already on local disk, use upload_image with action "image" / "video" / "audio". NEVER copy the output file into, or guess, a filesystem input/ path. ComfyUI's input and output directories may be CUSTOM (--input-directory / --output-directory), so a guessed path makes the loader reject the file (Invalid image file) and wastes the render. upload_image (action:"stage") goes through the server API (/view → /upload/image), which resolves the real dirs correctly.

Timing
  • First edit: ~87s (model loading)
  • Subsequent edits: ~30-40s each (models cached)

Phase 5: Frame Review

For each frame, show via Read for visual inspection. User approves or provides feedback. Re-run individual edits without redoing the whole chain.

Phase 6: Video Clip Generation — WAN 2.2 FLF Dual Hi-Lo

Workflow Template

(Same as wan-flf-video skill: Remix NSFW Hi+Lo, 4-stack LoRA, ImageResizeKJv2, dual KSamplerAdvanced)

Key settings:

  • Portrait: width=480, height=720
  • 81 frames, 16fps = ~5 seconds per clip
  • uni_pc/beta sampler, CFG 1, 4 total steps (Hi: 0→2, Lo: 2→4)
  • ModelSamplingSD3 shift=5 on both UNETs
Morph LoRA

For transformation scenes (e.g., cat→woman), add morph LoRA to Hi/Lo Common stacks:

  • wan2.2_i2v_magical_morph_highnoise.safetensors → Hi Common slot 1 (strength 1.0)
  • wan2.2_i2v_magical_morph_lownoise.safetensors → Lo Common slot 1 (strength 1.0)

Use 1.0 strength; it tested without sparkle issues. Lower values (0.7-0.85) produce weaker morph effects that may look like a dissolve rather than a true morph.

Per-Scene Changes

Swap per scene: start/end image filenames, positive prompt text, noise_seed, filename_prefix.

All 5 clips can be queued at once. They run sequentially in ComfyUI, sharing loaded models.

Phase 7: Video Review

Report each clip's filename. User previews externally.

Phase 8: Final Assembly — ffmpeg Concat

cd "<ComfyUI_output_dir>"
printf "file 'director_s1_00001.mp4'\nfile 'director_s2_00001.mp4'\n..." > concat_list.txt
ffmpeg -f concat -safe 0 -i concat_list.txt -c copy director_final_{project_id}.mp4

All clips share resolution/codec/framerate, so copy-concat works without re-encoding.

Resumption Protocol

After context compaction:

  1. Read state file AND director_session_notes.md if it exists
  2. Check current_phase and per-scene status
  3. Skip approved assets, continue from incomplete point
  4. clear_vram before loading the model family for the current phase

Timing Estimates (RTX 4090)

Phase Per Scene 5 Scenes
Hero + Refs (Z-Image) ~10s each ~50s (one-time)
Edit Chain (Qwen 4-step) ~35s each ~280s (8 edits)
Video Clip (WAN FLF 81 frames) ~140s ~700s
VRAM swaps (3x clear_vram) ~30s each ~90s
Total generation ~19 min

Storytelling Props for Continuity

Use distinctive visual elements that transfer between characters/forms to create narrative connections:

  • A colored collar on an animal → becomes a choker/necklace on the human form
  • Eye color matching between animal and human
  • Distinctive clothing or accessories that persist across scenes
  • These "continuity props" reinforce the story visually

Prompt Engineering for Edit Chains

DO
  • "The man wears his grey t-shirt" (anchor clothing every time)
  • "Same bedroom, same warm amber lamplight, same white sheets"
  • "Extremely shocked, jaw dropped, eyes wide in total disbelief"
  • "Her head and body proportional and natural looking"
DON'T
  • Assume clothing/setting will be preserved automatically
  • Use mild emotion words ("surprised" → use "extremely shocked" instead)
  • Chain more than 5-6 edits deep without branching back to hero
  • Assume head proportions stay correct in embrace/hug poses; always add explicit size anchoring
WAN Video Prompts
  • Use motion verbs: "walks", "turns", "reaches", "sits up", "leans in"
  • AVOID: "magical", "enchanted", "mystical" (causes sparkle effects)
  • USE: "smoothly transforms", "seamlessly reshapes", "gradually"
  • Include scale cues: "grows into", "expands upward"

Sources

  • Official: none found.
  • Empirical: 8-phase pipeline, models-per-phase, and prompt rules from working graphs.
1---
2name: director
3description: Full production pipeline covering story to scenes, Z-Image start frames, Qwen Edit end frames, WAN FLF video clips, ffmpeg concatenation
4globs:
5 - "**/*.json"
6---
7 
8# Director — Story-to-Video Production Pipeline
9 
10## Overview
11 
12The Director skill runs a complete short film production from a text story. It breaks the story into scenes, generates start/end frames for each, creates video clips from frame pairs, and concatenates everything into a final video.
13 
14The pipeline runs Story Planning → Z-Image Hero + Character Refs → Qwen Edit Chain (all frames) → WAN 2.2 FLF Video Clips → ffmpeg Concatenation.
15 
16Key architectural decisions:
17- 1 hero frame + edit chain for character consistency (NEVER independent Z-Image per scene)
18- Inter-scene frame continuity. Scene N's end frame IS Scene N+1's start frame (same image file, no edit gap)
19- Character reference images fed into Qwen Edit's extra image slots
20- State file persists to disk for context compaction survival
21- Each scene is independently retryable without affecting others
22- `clear_vram` between every model family switch
23 
24## CRITICAL: Inspect modes + verify every output
25 
26This pipeline drives the user's live canvas across many stages, so two habits are non-negotiable:
27 
28- **Inspect node modes before each render.** After loading any pack/template/subgraph and before `panel_run`, check each node's `mode` (`panel_graph_outline` marks [bypass]/[mute]; `panel_query_graph` detail rows carry it). A `bypass` node is skipped (passes input through); a `mute` node and everything downstream don't execute. If the path, branch, or switch you need is bypassed or muted, enable it with `panel_set_node_mode` (set the wanted node `active`, the unwanted one `bypass`/`mute`). Never assume a switch or route is already active.
29- **Verify the output matches before moving on.** Every Phase-N render is a gate. Look at the produced frame or clip (view it) and confirm it matches the intent BEFORE advancing or reporting progress. If it's wrong, diagnose (wrong prompt path? a bypassed/muted builder or switch? wrong widget? wrong ref image?), fix, and rerun. Do NOT declare a phase done or report progress you haven't verified.
30- **Confirm VIDEO renders via the filesystem, not /history.** For a `VHS_VideoCombine` / LTX / WAN clip, do NOT rely on `get_history` / `queue` (action:"status") to confirm it exists. VHS-style video nodes write the .mp4 but frequently do NOT register an output in ComfyUI's `/history` (prompt shows done, empty outputs, no error). Confirm the file with `get_image (action:"list_outputs")` (now lists videos too, tagged `kind: "video"`) by `filename_prefix` + fresh mtime, then chain it forward with `upload_image (action:"stage")`.
31- **Bypass completed stages before queuing the next one.** If you build the multi-stage pipeline on ONE canvas (e.g. Krea2 → LTX → WAN) rather than running each phase in isolation, once a stage has run and its output is captured/staged, `panel_set_node_mode(mode:"bypass")` that stage's nodes BEFORE you `panel_run` the next stage. Otherwise `panel_run` re-executes the whole graph and you pay for and wait on already-finished work, a real and costly failure mode. Keep only the active stage live; feed the prior output forward with `upload_image (action:"stage")` (bypass the producer, feed its captured output to the consumer's loader).
32 
33## CRITICAL: Character Consistency
34 
35Independent Z-Image generations per scene produce different-looking characters. This was the #1 problem discovered during testing. The solution:
36 
371. Generate ONE hero frame with Z-Image. It establishes the main character, setting, and lighting
382. Generate character reference images: close-up portraits of each character, key props, and the background
393. Create ALL other scene frames via the Qwen Edit chain from the hero, with character refs in extra image slots
404. This keeps the same face, clothing, and environment across every frame
41 
42## 8-Phase Pipeline
43 
44```
45Phase 1: Story Planning → Break story into scenes (Claude reasoning, no ComfyUI)
46Phase 2: Hero + Refs → Z-Image: 1 hero frame + character ref portraits + background ref
47Phase 3: Hero Review → Visual verify hero and refs, user approves
48Phase 4: Edit Chain → Qwen Edit: chain ALL scene frames from hero (with char refs in slots 2-3)
49Phase 5: Frame Review → Visual verify all frames, approve/reject/retry
50Phase 6: Video Clips → WAN 2.2 FLF dual Hi-Lo (one clip per scene)
51Phase 7: Video Review → Preview each clip
52Phase 8: Final Assembly → ffmpeg concat all clips into one MP4
53```
54 
55## State File Format
56 
57Saved at `~/code/comfyui-mcp/workflows/director_state_{project_id}.json`. Updated after every edit or phase completion.
58 
59```json
60{
61 "project_id": "story_20260216_143022",
62 "created": "2026-02-16T14:30:22Z",
63 "story": "Original user story text",
64 "current_phase": 4,
65 "orientation": "portrait",
66 "hero_frame": { "file": "director_hero_00001_.png", "seed": 428571, "approved": true },
67 "character_refs": {
68 "man": "director_ref_man.png",
69 "cat": "director_ref_cat.png",
70 "woman": "director_ref_woman.png",
71 "background": "director_ref_bedroom.png"
72 },
73 "scenes": [
74 {
75 "id": 1,
76 "description": "Brief scene description",
77 "edit_prompt_start": "Qwen Edit instruction to create start frame from source",
78 "edit_prompt_end": "Qwen Edit instruction to create end frame from source",
79 "edit_source_start": "hero",
80 "edit_source_end": "hero",
81 "video_prompt": "WAN motion description",
82 "start_frame": { "file": "director_s1_start_00001_.png", "seed": 12345, "approved": true },
83 "end_frame": { "file": "director_hero_00001_.png", "seed": null, "approved": true },
84 "video_clip": { "file": "director_s1_00001.mp4", "seed": 11111, "approved": false },
85 "status": "video_pending"
86 }
87 ],
88 "final_video": null,
89 "settings": {
90 "start_frame_resolution": [832, 1472],
91 "video_resolution": [480, 720],
92 "video_frames": 81,
93 "video_fps": 16
94 }
95}
96```
97 
98## Models Used Per Phase
99 
100| Phase | Model Family | Key Models | VRAM |
101|-------|-------------|------------|------|
102| 2: Hero + Refs | Z-Image | `redcraftRedzimageUpdatedJAN30_redzibDX1.safetensors` | ~17GB |
103| 4: Edit Chain | Qwen Edit | `qwen_image_edit_2511_bf16.safetensors` + Lightning LoRA | ~17-18GB |
104| 6: Video Clips | WAN 2.2 I2V | Remix NSFW Hi+Lo (built-in lightning) | ~22-24GB |
105 
106CRITICAL: `clear_vram` between every model family switch.
107 
108## Phase 1: Story Planning
109 
110Break the story into 2 to 6 scenes. For each scene, identify:
111- description: what happens (1 to 2 sentences)
112- start frame: what the opening frame looks like
113- end frame: what the closing frame looks like
114- video_prompt: motion description for FLF transition
115 
116Identify a hero frame, the single most representative scene image that establishes the main character and setting. This hero will anchor all other frames via Qwen Edit.
117 
118Also identify which character reference images are needed (portraits of each character, key props, background).
119 
120### CRITICAL: Inter-Scene Frame Continuity
121 
122The end frame of Scene N must be the EXACT same image file as the start frame of Scene N+1. Do NOT create separate Qwen-edited start frames for subsequent scenes. That causes visible jumps at scene boundaries when the videos are concatenated.
123 
124The frame chain for video generation:
125```
126Scene 1: S1_start (unique) → hero (end)
127Scene 2: hero (= S1 end) → S2_end
128Scene 3: S2_end (= S2 end) → S3_end
129Scene 4: S3_end (= S3 end) → S4_end
130Scene 5: S4_end (= S4 end) → S5_end
131```
132 
133Only Scene 1 needs a unique start frame. All other scenes inherit their start from the previous scene's end.
134 
135### Edit Chain Planning
136 
137The edit chain produces only end frames (plus Scene 1's unique start frame). Map which end frame derives from which source:
138- Some end frames edit directly from the hero
139- Later end frames may chain from earlier end frames
140- Keep chains shallow (max 4 to 5 deep) to minimize drift
141 
142Example chain:
143```
144Hero (man+cat on bed)
145 ├─ S1 Start: edit hero → remove cat, man alone
146 ├─ S2 End: edit hero → replace cat with woman
147 │ └─ S3 End: edit S2End → both sit up, man startled
148 │ └─ S4 End: edit S3End → sitting close, warm smiles
149 │ └─ S5 End: edit S4End → warm embrace
150```
151 
152## Phase 2: Hero + Character References — Z-Image
153 
154Generate with Z-Image RedCraft DX1 (10 steps, CFG 1, euler/simple):
155 
1561. Hero frame: the establishing shot with main character + key elements
1572. Character ref portraits: close-up of each character (man, woman, animal, etc.)
1583. Background ref: the setting without characters
159 
160Add to negative prompts for character refs to exclude wrong subjects (e.g., "woman, female" when generating man portrait).
161 
162### Hero Frame Workflow Template
163 
164```json
165{
166 "1": { "class_type": "CheckpointLoaderSimple", "inputs": { "ckpt_name": "redcraftRedzimageUpdatedJAN30_redzibDX1.safetensors" }},
167 "2": { "class_type": "CLIPTextEncode", "inputs": { "clip": ["1", 1], "text": "<hero_prompt>" }, "_meta": { "title": "Positive" }},
168 "3": { "class_type": "CLIPTextEncode", "inputs": { "clip": ["1", 1], "text": "3D, ai generated, semi realistic, illustrated, drawing, comic, digital painting, 3D model, blender, video game screenshot, render, smooth textures, CGI, text, writing, subtitle, watermark, logo, blurry, low quality, jpeg artifacts, grainy" }, "_meta": { "title": "Negative" }},
169 "4": { "class_type": "EmptyLatentImage", "inputs": { "width": 832, "height": 1472, "batch_size": 1 }},
170 "5": { "class_type": "KSampler", "inputs": {
171 "model": ["1", 0], "positive": ["2", 0], "negative": ["3", 0], "latent_image": ["4", 0],
172 "seed": 42, "steps": 10, "cfg": 1, "sampler_name": "euler", "scheduler": "simple", "denoise": 1
173 }},
174 "6": { "class_type": "VAEDecode", "inputs": { "samples": ["5", 0], "vae": ["1", 2] }},
175 "7": { "class_type": "SaveImage", "inputs": { "images": ["6", 0], "filename_prefix": "director_hero" }}
176}
177```
178 
179Queue hero + all refs while Z-Image checkpoint is loaded (same checkpoint, different prompts).
180 
181## Phase 3: Hero Review
182 
183Show hero frame and all character refs. User approves or requests regeneration with new seed.
184 
185## Phase 4: Edit Chain — Qwen Image Edit
186 
187### CRITICAL: Consistency Rules for Edit Prompts
188 
1891. **Always explicitly anchor clothing.** "The man wears his grey t-shirt" in EVERY prompt
1902. **Always state what doesn't change.** "Same bedroom, same warm lighting, same clothing"
1913. **Use strong emotion words.** "extremely shocked and startled" >> "surprised"
1924. **Include proportionality.** "Her head and body should be proportional and natural looking"
1935. **Prevent head enlargement.** In embrace/close-up poses, Qwen Edit tends to enlarge heads. Add an explicit "do not enlarge her head, keep the same small natural size as in the original image"
1946. **Describe the transformation, not just the end state**
195 
196### Workflow Template (with Character Reference Slots)
197 
198```json
199{
200 "1": { "class_type": "UNETLoader", "inputs": { "unet_name": "qwen_image_edit_2511_bf16.safetensors", "weight_dtype": "default" }},
201 "2": { "class_type": "LoraLoaderModelOnly", "inputs": { "model": ["1", 0], "lora_name": "Qwen-Image-Edit-2511-Lightning-4steps-V1.0-bf16.safetensors", "strength_model": 1 }},
202 "3": { "class_type": "CLIPLoader", "inputs": { "clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors", "type": "qwen_image" }},
203 "4": { "class_type": "VAELoader", "inputs": { "vae_name": "qwen_image_vae.safetensors" }},
204 "5": { "class_type": "LoadImage", "inputs": { "image": "<source_scene.png>" }, "_meta": { "title": "Source Scene" }},
205 "5b": { "class_type": "LoadImage", "inputs": { "image": "<character_ref.png>" }, "_meta": { "title": "Character Ref" }},
206 "5c": { "class_type": "LoadImage", "inputs": { "image": "<background_ref.png>" }, "_meta": { "title": "Background Ref" }},
207 "6": { "class_type": "TextEncodeQwenImageEditPlusAdvance_lrzjason", "inputs": {
208 "clip": ["3", 0], "prompt": "<edit_prompt>", "vae": ["4", 0],
209 "vl_resize_image1": ["5", 0],
210 "vl_resize_image2": ["5b", 0],
211 "vl_resize_image3": ["5c", 0],
212 "target_size": 1024, "target_vl_size": 384,
213 "upscale_method": "lanczos", "crop_method": "pad"
214 }},
215 "7": { "class_type": "ConditioningZeroOut", "inputs": { "conditioning": ["6", 0] }},
216 "8": { "class_type": "KSampler", "inputs": {
217 "model": ["2", 0], "positive": ["6", 0], "negative": ["7", 0], "latent_image": ["6", 1],
218 "seed": 42, "steps": 4, "cfg": 1, "sampler_name": "euler", "scheduler": "simple", "denoise": 1
219 }},
220 "9": { "class_type": "VAEDecode", "inputs": { "samples": ["8", 0], "vae": ["4", 0] }},
221 "10": { "class_type": "SaveImage", "inputs": { "images": ["9", 0], "filename_prefix": "director_s1_start" }}
222}
223```
224 
225Slots 5b and 5c matter. Feed character reference and background reference into `vl_resize_image2` and `vl_resize_image3`. This helps the vision encoder maintain character appearance across edits.
226 
227### Chain Execution
228 
229Edits are sequential; each depends on the previous output:
2301. Run edit, wait for completion
2312. Stage the output as the next stage's input with `upload_image (action:"stage")` (pass the output's `{ filename, subfolder?, type? }`); it returns the registered input filename
2323. Use that returned filename as the `image` in the next edit's `LoadImage`
2334. Update state file after each edit
234 
235Independent edits (both from hero) can run in parallel.
236 
237### CRITICAL: feeding an output into the next loader (don't guess paths)
238 
239To pipe ANY stage's output into the next stage's loader (`LoadImage` here, `VHS_LoadVideo` / `LoadAudio` in the video phases), call `upload_image (action:"stage")` with the output's `{ filename, subfolder?, type? }` and drop the returned input filename into the loader's `image`/`video`/`audio` widget. For a file already on local disk, use `upload_image` with action `"image"` / `"video"` / `"audio"`. NEVER copy the output file into, or guess, a filesystem `input/` path. ComfyUI's input and output directories may be CUSTOM (`--input-directory` / `--output-directory`), so a guessed path makes the loader reject the file (`Invalid image file`) and wastes the render. `upload_image (action:"stage")` goes through the server API (`/view` → `/upload/image`), which resolves the real dirs correctly.
240 
241### Timing
242 
243- First edit: ~87s (model loading)
244- Subsequent edits: ~30-40s each (models cached)
245 
246## Phase 5: Frame Review
247 
248For each frame, show via `Read` for visual inspection. User approves or provides feedback. Re-run individual edits without redoing the whole chain.
249 
250## Phase 6: Video Clip Generation — WAN 2.2 FLF Dual Hi-Lo
251 
252### Workflow Template
253 
254(Same as wan-flf-video skill: Remix NSFW Hi+Lo, 4-stack LoRA, ImageResizeKJv2, dual KSamplerAdvanced)
255 
256Key settings:
257- Portrait: width=480, height=720
258- 81 frames, 16fps = ~5 seconds per clip
259- uni_pc/beta sampler, CFG 1, 4 total steps (Hi: 0→2, Lo: 2→4)
260- ModelSamplingSD3 shift=5 on both UNETs
261 
262### Morph LoRA
263 
264For transformation scenes (e.g., cat→woman), add morph LoRA to Hi/Lo Common stacks:
265- `wan2.2_i2v_magical_morph_highnoise.safetensors` → Hi Common slot 1 (strength 1.0)
266- `wan2.2_i2v_magical_morph_lownoise.safetensors` → Lo Common slot 1 (strength 1.0)
267 
268Use 1.0 strength; it tested without sparkle issues. Lower values (0.7-0.85) produce weaker morph effects that may look like a dissolve rather than a true morph.
269 
270### Per-Scene Changes
271 
272Swap per scene: start/end image filenames, positive prompt text, noise_seed, filename_prefix.
273 
274All 5 clips can be queued at once. They run sequentially in ComfyUI, sharing loaded models.
275 
276## Phase 7: Video Review
277 
278Report each clip's filename. User previews externally.
279 
280## Phase 8: Final Assembly — ffmpeg Concat
281 
282```bash
283cd "<ComfyUI_output_dir>"
284printf "file 'director_s1_00001.mp4'\nfile 'director_s2_00001.mp4'\n..." > concat_list.txt
285ffmpeg -f concat -safe 0 -i concat_list.txt -c copy director_final_{project_id}.mp4
286```
287 
288All clips share resolution/codec/framerate, so copy-concat works without re-encoding.
289 
290## Resumption Protocol
291 
292After context compaction:
2931. Read state file AND `director_session_notes.md` if it exists
2942. Check `current_phase` and per-scene status
2953. Skip approved assets, continue from incomplete point
2964. `clear_vram` before loading the model family for the current phase
297 
298## Timing Estimates (RTX 4090)
299 
300| Phase | Per Scene | 5 Scenes |
301|-------|-----------|----------|
302| Hero + Refs (Z-Image) | ~10s each | ~50s (one-time) |
303| Edit Chain (Qwen 4-step) | ~35s each | ~280s (8 edits) |
304| Video Clip (WAN FLF 81 frames) | ~140s | ~700s |
305| VRAM swaps (3x clear_vram) | ~30s each | ~90s |
306| **Total generation** | | **~19 min** |
307 
308## Storytelling Props for Continuity
309 
310Use distinctive visual elements that transfer between characters/forms to create narrative connections:
311- A colored collar on an animal → becomes a choker/necklace on the human form
312- Eye color matching between animal and human
313- Distinctive clothing or accessories that persist across scenes
314- These "continuity props" reinforce the story visually
315 
316## Prompt Engineering for Edit Chains
317 
318### DO
319- "The man wears his grey t-shirt" (anchor clothing every time)
320- "Same bedroom, same warm amber lamplight, same white sheets"
321- "Extremely shocked, jaw dropped, eyes wide in total disbelief"
322- "Her head and body proportional and natural looking"
323 
324### DON'T
325- Assume clothing/setting will be preserved automatically
326- Use mild emotion words ("surprised" → use "extremely shocked" instead)
327- Chain more than 5-6 edits deep without branching back to hero
328- Assume head proportions stay correct in embrace/hug poses; always add explicit size anchoring
329 
330### WAN Video Prompts
331- Use motion verbs: "walks", "turns", "reaches", "sits up", "leans in"
332- AVOID: "magical", "enchanted", "mystical" (causes sparkle effects)
333- USE: "smoothly transforms", "seamlessly reshapes", "gradually"
334- Include scale cues: "grows into", "expands upward"
335 
336## Sources
337 
338- **Official:** none found.
339- **Empirical:** 8-phase pipeline, models-per-phase, and prompt rules from working graphs.
340 
View all files on GitHub →

Details

Updated
Sep 21, 2026
License
MIT
Stars on the repo
★ 759
Checked
Source
artokun/comfyui-mcp ↗
Creator
artokun · 44 listings
View creator

Similar skills

See all →
MCPGet from zero to orchestrated multi-agent pipeline in 5⚡ NEXUS Quick-Start Guidemsitarzewski/agency-agents · by msitarzewski> Get from zero to orchestrated multi-agent pipeline in 5 minutes.★ 154k GitHub starsSkillStep 1 of the AI Video Editor pipelineclean-cut — the step-1 cut pipelinehassancs91/claude-youtube-editor · by hassancs91Step 1 of the AI Video Editor pipeline — turn raw talking-head footage into a clean master cut. Use when the user wants to "clean cut", "cut the raw footage", "remove filler / dead air / bad takes", "tighten the pacing", produce cuts.json, run the cut editor, or render a cleaned preview/master for a video-N project in this repo. Covers audio extraction, AssemblyAI transcription, authoring cuts.json (keeps/cuts/fluff categorized), the cut policy (content-aggressive, pause-natural ~0.5s), QA + review docs, the local cut-editor UI, tight/natural previews, the final 4K60 render, and producing edited-transcript.json as the handoff to /make-tsx. Not for building TSX overlays (that is /make-tsx) or the raw TSX authoring rules (that is vidtsx-2d-generator).★ 330 GitHub starsSkillMake an original animated music videoVocaloid-style MV pipeline (手書き / 文字PV)EGSECDA/vocaloid-style-mv-pipeline · by EGSECDAMake an original animated music video (MV / PV) for a song from its audio file plus lyrics, in the Vocaloid / J-pop lyric-video tradition: 手書き/tegaki (V家手书, 手描きMV, ボカロPV), 文字PV and kinetic typography (リリックモーション, リリックビデオ, 歌詞動画, 歌词视频, 动态歌词), anime-illustration MVs with an original character — for any mood, from dark ballads to bright upbeat summer pop. Renders to MP4 with a deterministic Canvas2D/WebGL2 engine in a headless browser: JIZURA lyric motion, AI-generated art, optional Blender toon 3D, beat-locked editing, 9:16 vertical/Shorts version. Use it whenever the user wants a music video, MV, PV, lyric video or beat-synced animation for a song, e.g. make an MV for my song", "turn this track into a lyric video", "给这首歌做个MV/PV", "做个V家手书", "この曲のMVを作って", ボカロPV作って", "縦型ショートも" — even if they only give a .wav/.mp3 and say "make a cool video for it". Not for editing existing footage or clip compilations.★ 169 GitHub starsSkillConstruction company AI agentConstruction Agent — Email → Project Management Pipelinehewi333/Mom-n-Pop-Skills · by hewi333Construction company AI agent — orchestrates email (Google Workspace), project management (JobTread Pave API), and file routing for a construction business. Handles email triage, attachment routing to JobTread, project status, task management, and daily briefings via Telegram. Reference implementation for a construction/trades business with an existing email→Drive→PM pipeline.★ 122 GitHub starsSkillTracking customer interactions, managing leadsCRM-Lite — Lightweight SQLite CRM for Small Businesshewi333/Mom-n-Pop-Skills · by hewi333Use when tracking customer interactions, managing leads, or building a lightweight CRM for small businesses without dedicated CRM software. Stores contacts, leads, activities, estimates, and communications in local SQLite.★ 122 GitHub starsSkillOrchestrates one narrated vertical short from ideask-pipeline: one video, idea to hand-offhowznguyen/shorts-kit · by howznguyenOrchestrates one narrated vertical short (TikTok, YouTube Shorts, Reels) from idea to upload-ready hand-off files, in the fixed order idea, facts, flow and visual choice, brief, narration, TTS, lint, scenes, still review, render, cover, normalize, encode, hand-off. Use when the user says "make a video about X", "start a new short", "take this idea to a finished video", "what's the next step", "where was I on this video", or asks how the whole pipeline fits together. Also when the user gives a video or audio file (or a folder of clips) to edit: "edit this video", "dựng video này", a .mov/.mp4 path. Points at the skill and the SOUL section that governs each step.★ 69 GitHub stars

More from artokun

SkillTrain custom LoRAs with ostris AI-ToolkitAI-Toolkit LoRA Trainer (WAN 2.2 & Z-Image)artokun/comfyui-mcp · by artokunTrain custom LoRAs with ostris AI-Toolkit. Covers WAN 2.2/2.1 (people, styles, video motion) and Z-Image (Turbo & Base, low-VRAM image LoRAs). Use when the user wants to train a WAN or Z-Image LoRA; covers local + RunPod setup, dataset prep, key params, and using the result in a ComfyUI workflow.★ 759 GitHub starsSkillAnime/illustration text-to-imageANIMA 1.0 (Anima Base Ultra) Text-to-Image Workflowsartokun/comfyui-mcp · by artokunAnime/illustration text-to-image (ANIMA 1.0, ~2B Cosmos DiT). Use for anime, manga, illustrated characters; accepts Danbooru tags + natural language; runs/trains on <6GB VRAM; includes anime inpainting via Anima-LLLite ControlNet★ 759 GitHub starsSkillAuthoring & Publishing ComfyUI Custom Nodesartokun/comfyui-mcp · by artokunAuthoring & publishing ComfyUI custom nodes to the Comfy Registry, covering node structure, pyproject.toml spec, comfy-cli publishing, and CI★ 759 GitHub starsSkillTrain a custom anime LoRA on the ANIMA base modelCitron Anima LoRA Trainerartokun/comfyui-mcp · by artokunTrain a custom anime LoRA on the ANIMA base model with Citron's local Gradio trainer (kohya sd-scripts), <6GB VRAM, character/style LoRAs; covers setup, dataset prep, training params, and using the result in the anima-base workflow★ 759 GitHub starsSkillDiscover Civitai models with the BUILT-IN downloadmodelCivitai + comfyui-mcpartokun/comfyui-mcp · by artokunDiscover Civitai models with the BUILT-IN download_model action:"search_civitai" and install/generate them locally. Find a checkpoint/LoRA/embedding on Civitai, download it into ComfyUI, and use its trigger words. Optionally pair the official Civitai MCP for community features (images browsing, posting, collections).★ 759 GitHub starsSkillDiagnose and fix video/image color OBJECTIVELYColor Correction (measure, don't eyeball)artokun/comfyui-mcp · by artokunDiagnose and fix video/image color OBJECTIVELY with the get_image (action:"analyze_color") tool (scopes/stats such as black/white points, contrast, saturation, clipping, cast) instead of eyeballing a contact sheet. Covers the "washed out" signature, why reference color-match (mkl/ColorMatch/ColorMatchAdobe) CAN'T add contrast a flat source lacks, the levels/contrast-stretch fix (core AdjustContrast / CurveEditor), the measure→fix→re-measure loop, the side-by-side sandbox pattern, and where to place the fix in a render graph (after decode, before save). Use when a render looks washed out / flat / dull / over-saturated / color-cast, or when deciding between a color-match and a contrast/levels fix.★ 759 GitHub stars