Nodes/CWK_Wan2.2_Nodes/CWK Wan2.2 Prompt Composer
ComfyUI Node

CWK Wan2.2 Prompt Composer

One node to script an entire Wan 2.2 video, scene by scene

By cowneko·Created 3 months ago·Updated 3 months ago· 2
CWK Wan2.2 Prompt Composer
    • pipeline
    frame_rate16.0
    pipeline_data[]

    This is the node the whole CWK_Wan2.2_Nodes pack is built around. Where most video workflows make you rewire a KSampler section for every shot you want, the Prompt Composer lets you write out an entire multi-clip video up front: a timeline of blocks, each with its own prompt, duration, seed, and LoRA stack, and then a single WAN22_PIPELINE object flows out the back and drives everything downstream. If you've ever stitched five separate Wan renders together in an editor and sworn at the cuts, this is the "plan first, generate later" version of that.

    Why it exists

    Wan 2.2's native context is roughly 81 frames - a few seconds at typical frame rates. Anything longer is chunking, and chunking without a plan is where long-form video dies: prompts drift, seeds wander, LoRAs switch mid-clip. The Composer front-loads the whole shoot. Each block becomes one clip, and the clip's data (prompt, frame count, seed, LoRAs) is packaged so the Loop nodes or the Splitter can hand it to a sampler one shot at a time.

    How it works

    The UI is a fully custom JavaScript/LiteGraph canvas - there are no stock ComfyUI widgets to fight with. You add blocks, type a prompt, set a duration in seconds, assign a seed, and attach two independent LoRA stacks. The two stacks aren't a gimmick: Wan 2.2 denoises in a high-noise pass (motion, composition) and a low-noise pass (detail), and the community standard is to run speed LoRAs on the low-noise pass only. That's what lora_stack_high and lora_stack_low are for.

    Under the hood, the JS serializes everything into the pipeline_data JSON string input, and the backend parses it into the pipeline. Disabled blocks are filtered out before anything reaches a sampler. Frame count per clip is round(duration × frame_rate) + 1, and each block keeps its own seed so you can lock one shot while rerolling the next. There's a live stats bar showing enabled block count and total seconds, plus bulk controls (enable all, disable all, randomize all seeds) that you'll use more than you expect.

    The only manual input worth touching is frame_rate (default 16 - leave it unless your whole graph runs at something else). pipeline_data is hidden behind the canvas.

    Presets and the preview toggle

    Two features are worth knowing about. First, presets: Save Preset / Load & Manage Presets stores named collections as JSON in ComfyUI/user/default/ through ComfyUI's /api/userdata/ endpoint, so you can keep a library of video scripts and swap them without leaving the app. Second, there's a toggle that turns on VHS animated previews while sampling - it flips the VHS.LatentPreview setting for you. That one genuinely requires ComfyUI-VideoHelperSuite installed, or it just doesn't do anything.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/cowneko/CWK_Wan2.2_Nodes.git
    

    or search CWK Wan2.2 Nodes in ComfyUI Manager, then restart. No extra Python dependencies beyond ComfyUI's own torch/numpy/Pillow. VHS is optional and only needed for the preview toggle.

    Troubleshooting

    • You see a plain node with a raw JSON field, no timeline - the JS extension failed to load. Early builds had a real WEB_DIRECTORY registration bug that did exactly this; update the pack and hard-refresh the browser.
    • Preset save silently 404s - ComfyUI's userdata route only accepts a single path segment; the code sanitizes filenames to one token, so don't put slashes in collection names.
    • LoRA blocks do nothing - the names you type must match filenames in your ComfyUI/models/loras folder exactly, because downstream application (via the pack's LoRA Applier) resolves them against that directory.

    It's a single-maintainer pack with zero community footprint, so don't expect a tutorial ecosystem around it - but the Composer is the rare custom UI that's genuinely nicer than the stock alternative for the job.

    CategoryCWK/wan22

    Inputs (2)

    NameTypeDefaultDescription
    frame_rateFLOAT16.01–120
    pipeline_dataSTRING[]

    Outputs (1)

    NameTypeDescription
    pipelineWAN22_PIPELINE