Extensions/CWK_Wan2.2_Nodes
ComfyUI Extension

CWK_Wan2.2_Nodes

A ComfyUI custom node package for Wan 2.2 Image-to-Video generation workflows.

By cowneko·Created 2 months ago·Updated 2 months ago· 2
cowneko/CWK_Wan2.2_Nodes
Nodes6
On cloudLocal install
CategoryCWK/wan22
Stars2
Updated2 months ago
Readme

CWK_Wan2.2_Nodes

A ComfyUI custom node package for Wan 2.2 Image-to-Video generation workflows. Provides a multi-clip prompt composer with a fully custom canvas UI, a looping pipeline engine for long-form video generation, LoRA management, and an interactive image prep node.


Nodes

CWK Wan2.2 Prompt Composer

The centrepiece of the package. A multi-block prompt timeline built entirely with a custom JavaScript/LiteGraph canvas — no native ComfyUI widgets mixed in.

Features:

  • Any number of prompt blocks, each with its own prompt text, duration (seconds), seed, and two independent LoRA stacks (high-noise / low-noise)
  • Per-block enable/disable/invert toggle
  • Live stats bar showing enabled block count and total duration in seconds
  • Bulk controls: enable all, disable all, randomise all seeds
  • Button to activate VHS animated video generation preview (requires ComfyUI-VideoHelperSuite to be installed)
  • Preset system: save and load named preset collections to .json files in ComfyUI/user/default/ via the ComfyUI userdata API. Collections are managed (rename, delete) from the Load & Manage Presets panel without leaving ComfyUI
  • Outputs a WAN22_PIPELINE object consumed by the splitter or loop nodes

Outputs: pipeline (WAN22_PIPELINE)


CWK Wan2.2 Pipeline Splitter

For static (non-looping) multi-clip graphs. Takes a WAN22_PIPELINE and a clip_index and extracts the data for that specific clip.

Inputs: pipeline, clip_index

Outputs: prompt, frame_count, lora_stack_high, lora_stack_low, seed


CWK Wan2.2 LoRA Applier

Applies a LORA_STACK to a model/clip pair one LoRA at a time using ComfyUI's standard LoraLoader. Safe to use inside looping graphs.

Inputs: model, clip, lora_stack

Outputs: model, clip


CWK Wan2.2 Loop Open

Loop entry point. Manages per-clip iteration state across ComfyUI re-queues. On each re-queue it advances to the next pipeline clip and emits its data. Automatically resets when the pipeline changes or all clips are done.

Inputs: pipeline, start_image, overlap, overlap_mode, overlap_side, force_reset

Outputs: current_image, prev_latent, prompt, frame_count, lora_stack_high, lora_stack_low, clip_seed, loop_state


CWK Wan2.2 Loop Close

Loop accumulator and exit point. Blends newly generated frames into the running accumulation using linear or sqrt cross-fades, then either re-queues for the next clip or returns the final accumulated video.

Inputs: loop_state, new_images, new_latent, final_only

Outputs: images, final_latent

The final_only flag controls whether intermediate clips are forwarded to a video-combine node (False) or suppressed until the loop is complete (True, default).

Overlap modes:

  • blend_linear — standard linear cross-fade (default)
  • blend_sqrt — sqrt-weighted cross-fade, softer transitions
  • replace — hard cut, no blending

CWK Wan2.2 Image Prep

An interactive image preparation node for Wan 2.2 I2V. Features a pure JavaScript/canvas drag-and-resize crop frame drawn directly on the node, with browser-side image upload.

Features:

  • Upload an image directly from your browser (no external LoadImage node required)
  • Drag and resize a crop frame locked to the chosen output aspect ratio
  • Resolution presets: 16:9 (832×480), 16:9 (1280×720), 9:16 (480×832), 9:16 (720×1280), 1:1 (1024×1024)
  • Configurable upscale method, frame rate, sampler, scheduler, steps, and CFG scale — all passed directly as outputs for downstream KSampler nodes

Outputs: image, width, height, frame_rate, scheduler, sampler_name, total_steps, split_steps, cfg_scale


Installation

Via ComfyUI Manager (recommended)

Search for CWK Wan2.2 Nodes and click Install.

Manual

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

Restart ComfyUI. No additional Python dependencies beyond what ComfyUI already provides (torch, numpy, Pillow).


Repository layout

CWK_Wan2.2_Nodes/
├── __init__.py                      # Package entry point, registers web directory
├── nodes.py                         # All Python node definitions
└── web/
    ├── cwk_wan22_prompt_composer.js  # Prompt Composer canvas UI
    └── web_cwk_wan_image_prep.js     # Image Prep canvas UI

Requirements

  • ComfyUI (any recent build)
  • Python ≥ 3.10
  • torch, numpy, Pillow (all standard ComfyUI dependencies)
  • A Wan 2.2 model loaded in your ComfyUI setup

License

MIT — see LICENSE.txt.