Extensions/Wan 2.2 5B Video Studio (Auto-Ratio TI2V, FunControl & 3-Stage Polish)
ComfyUI Extension

Wan 2.2 5B Video Studio (Auto-Ratio TI2V, FunControl & 3-Stage Polish)

All-in-one ComfyUI custom nodes and unified workflow for Wan 2.2 5B: aspect-ratio auto-sizing (4n+1 frames), lazy Standard TI2V / FunControl mode router, temporal MKL color matching, 3-stage preview-to-2x-48fps polish pipeline, and SageAttention safe fallback.

By kama0630-cmyk·Created a day ago·Updated about 8 hours ago· 0
kama0630-cmyk/ComfyUI-Wan22-5B-Video-Studio
Nodes—
On cloudLocal install
Stars0
Updatedabout 8 hours ago
Readme

ComfyUI-Wan22-5B-Video-Studio

Wan 2.2 5B Video Studio

An integrated, model-agnostic ComfyUI studio rig and custom node pack for Wan 2.2 5B in a single unified workflow (workflows/Wan22_5B_Video_Studio.json) — combining Auto-Ratio TI2V (Photo/Text-to-Video), Lazy FunControl Motion & Dance Transfer (with audio sync), Temporal MKL Color Matching, and a 3-Stage Preview-to-2x-48fps Master Pipeline, with beginner-friendly sticky-note guides on every Zone.

Hardware Compatibility: Runs on any Wan 2.2 5B-capable GPU (8GB–12GB+ VRAM; FP16, FP8, and GGUF Q4–Q8 supported). Stage 2 (RIFE 48fps), Stage 3 (RealESRGAN 2x), and SageAttention ship bypassed by default so first-time runs start cleanly with zero missing-file errors.
Verification Environment: Tested and verified on NVIDIA RTX 3080 Ti (12GB VRAM).

Visual Quick-Start (Zero-Error Setup in 3 Clicks)

Visual Quick-Start Cheat Sheet


Key Features

  1. Single Unified Workflow + Built-In Sticky-Note Manual (Wan22_5B_Video_Studio.json)

    • One clean workflow covers both Mode 1 (Standard TI2V) and Mode 2 (FunControl Motion Transfer) — no separate workflow files needed.
    • Ships with no bundled or promoted diffusion models or LoRAs (Power Lora Loader is 100% empty).
    • Pick any .safetensors Wan 2.2 5B model out-of-the-box, or follow the Zone 1 Sticky Note to swap UNETLoader for UnetLoaderGGUF (ComfyUI-GGUF) to run Q4–Q8 quantized models anytime.
  2. Zero-Crop Auto-Ratio & 4n+1 Frame Calculator (Wan22StudioAutoSize)

    • Automatically detects your input photo's aspect ratio (portrait, square, or widescreen) and scales to 16px-aligned dimensions up to max_size (720 for speed or 1024 for sharp detail) — eliminating forced 16:9 center-crop distortion.
    • Converts duration_sec × fps into strict Wan 2.2 4n + 1 frame counts (1s=25f, 3s=73f, 5s=121f).
    • Disconnect start_image on Wan22ImageToVideoLatent anytime to run pure Text-to-Video using fallback_width / fallback_height.
  3. Lazy Mode Router (Wan22StudioModeSwitch)

    • Switches cleanly between 1: [Standard TI2V] and 2: [FunControl] with zero wasted VRAM or load time — the inactive mode's model loader and reference video are completely skipped by ComfyUI's lazy evaluation.
    • Routes Mode 2's reference video audio cleanly into Stage 1–3 outputs when FunControl is active.
  4. 3-Stage Preview-to-Master Pipeline & Temporal MKL Color Lock

    • Stage 1 (24fps Native Preview — Active by default): Uses ComfyUI's built-in VAEDecodeTiled (zero extra decoder weights) so you can roll seeds fast and preview motion cleanly.
    • Stage 2 (48fps + MKL Color Match — Bypassed by default): Wan22StudioColorMatch (pure PyTorch MKL / Mean-Std) locks skin tones and contrast across all frames back to your original input photo, followed by RIFE VFI (2x, 24fps → 48fps).
    • Stage 3 (2x RealESRGAN + 48fps Master — Bypassed by default): Upscales frames 2x with RealESRGAN_x2.pth at true 48fps (fixing the common double-RIFE 96fps-at-60fps slow-motion bug). Always enable Stage 2 + Stage 3 together for true 1.0x speed audio/video sync.

Stage 1 Preview vs Stage 2+3 Master

Auto-Ratio Portrait TI2V & FunControl Motion Transfer


1. Installation

Step 1 — Install This Pack

  • Option A (1-Click via ComfyUI-Manager / Comfy Registry — Recommended):
    Search for Wan 2.2 5B Video Studio in ComfyUI-Manager (or click Install Missing Custom Nodes after dropping workflows/Wan22_5B_Video_Studio.json onto ComfyUI), or install via Comfy CLI:
    comfy node install wan22-5b-video-studio
    
  • Option B (Inside ComfyUI Manager → Install via Git URL):
    Paste the URL below and restart ComfyUI:
    https://github.com/kama0630-cmyk/ComfyUI-Wan22-5B-Video-Studio
    
  • Option C (Terminal git clone):
    cd ComfyUI/custom_nodes
    git clone https://github.com/kama0630-cmyk/ComfyUI-Wan22-5B-Video-Studio.git
    cd ComfyUI-Wan22-5B-Video-Studio
    pip install -r requirements.txt
    

Step 2 — Install Required & Optional Community Node Packs

Install via ComfyUI Manager or git clone inside ComfyUI/custom_nodes/:

| Custom Node Pack | Repository | Required? | Purpose in Workflow | | :--- | :--- | :---: | :--- | | rgthree-comfy | https://github.com/rgthree/rgthree-comfy | Yes | Power Lora Loader, Fast Groups Bypasser | | ComfyUI-VideoHelperSuite | https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite | Yes | VHS_VideoCombine, VHS_LoadVideo | | ComfyUI-Frame-Interpolation | https://github.com/Fannovel16/ComfyUI-Frame-Interpolation | Optional (Stage 2) | RIFE VFI (24fps → 48fps, bypassed by default) | | ComfyUI-KJNodes | https://github.com/kijai/ComfyUI-KJNodes | Optional | PathchSageAttentionKJ (bypassed by default; safe fallback included) | | ComfyUI-GGUF | https://github.com/city96/ComfyUI-GGUF | Optional (GGUF users) | UnetLoaderGGUF if you prefer .gguf Q4–Q8 checkpoints |

Restart ComfyUI completely after installing custom nodes, then drag and drop workflows/Wan22_5B_Video_Studio.json onto the ComfyUI canvas.


2. Models & 1-Command Downloader

Required Base Models

  1. Shared Text Encoder & Wan 2.2 VAE: umt5_xxl_fp8_e4m3fn_scaled.safetensors (models/text_encoders/) and wan2.2_vae.safetensors (models/vae/) — download both in one command using --group encoders below.
  2. Any Wan 2.2 5B TI2V Diffusion Model (.safetensors in models/diffusion_models/ or unet/, or .gguf in models/unet/ if swapping to UnetLoaderGGUF) selected in Zone 1.
  3. (Optional for Mode 2) Any Wan 2.2 Fun-Control 5B Model (.safetensors or .gguf) selected in Zone 1 → [Mode 2].
  4. Power Lora Loader ships 100% empty — add your own Wan 2.2 LoRAs if desired.

1-Command Helper Script (Shared Encoders + Optional 2x Upscaler)

# Interactive menu
python download_optional_models.py

# Or download by group
python download_optional_models.py --list
python download_optional_models.py --group encoders
python download_optional_models.py --group upscaler
python download_optional_models.py --group all

(Pass --models-dir /path/to/ComfyUI/models if your models folder is in a non-standard location. rife47.pth auto-downloads automatically on first Stage 2 run via ComfyUI-Frame-Interpolation.)
(Note: If installed via Comfy Registry, download download_optional_models.py directly from this GitHub repository — excluded from the Registry archive for strict offline security compliance.)

| Group / Zone | Model | Target Folder (ComfyUI/models/...) | Official Source | | :---: | :--- | :--- | :--- | | encoders (Zone 1) | umt5_xxl_fp8_e4m3fn_scaled.safetensors | text_encoders/ | Comfy-Org / Wan 2.1 Text Encoder | | encoders (Zone 1) | wan2.2_vae.safetensors | vae/ | Comfy-Org / Wan 2.2 VAE | | upscaler (Stage 3) | RealESRGAN_x2.pth | upscale_models/ | ai-forever / Real-ESRGAN |


3. Beginner Step-by-Step Guide

A. Mode 1 — Standard TI2V (Photo-to-Video or Text-to-Video)

  1. Pick Your Model (Zone 1): Select your Wan 2.2 5B TI2V .safetensors in [Mode 1] UNETLoader (or replace it with UnetLoaderGGUF if using .gguf). Leave [Mode 2] untouched — lazy evaluation skips it completely.
  2. Load a Photo & Set Length (Zone 3A): Load any photo in [Mode 1] LoadImage. Set max_size (720 for faster drafts, 1024 for sharp portrait/widescreen) and duration_sec (1–10s).
    • Pure Text-to-Video? Simply unlink start_image on Wan22ImageToVideoLatent and set fallback_width / fallback_height in Wan22StudioAutoSize.
  3. Write Motion Prompt (Zone 2): Describe subject motion, camera motion, fabric/hair movement, and lighting.
  4. Stage 1 Draft (24fps): Leave Stage 1 ON and Stage 2 / Stage 3 OFF in Stage Render Switch, then click Queue Prompt.
  5. Polish Winner (48fps + 2x Upscale): When you find great motion, set KSampler control_after_generate to fixed, turn Stage 2 + Stage 3 ON together in Stage Render Switch, and click Queue Prompt again.

B. Base Model vs. Fast / Speed LoRA Sampler Presets (Zone 4 KSampler)

| Setup | Steps | CFG | Sampler | Scheduler | Notes | | :--- | :---: | :---: | :--- | :--- | :--- | | Base Wan 2.2 5B (No LoRA, Default) | 20 | 5.0 | uni_pc | simple | Negative prompt active; clean physics & stability | | With Fast / Acceleration LoRA | 6–8 | 1.0 | euler | beta | Add your LoRA in Power Lora Loader; CFG 1.0 skips negative |

C. Mode 2 — FunControl Motion & Dance Transfer

(Ships Muted (mode=2) by default in Zone 3B so Mode 1 runs with zero missing-file errors even if you don't own a Fun-Control model yet.)

  1. Toggle Zone 3B ON inside Zone 4 → Mode 2 Muter Switch.
  2. Select your Wan 2.2 Fun-Control 5B model in Zone 3B → [Mode 2] Fun-Control 5B Model (.safetensors or swap to UnetLoaderGGUF).
  3. Load your driving motion video in Zone 3B → VHS_LoadVideo and target character image in [Mode 2] Target Character Image.
  4. Switch Unified Mode Switch (Zone 4) to 2: [FunControl] Motion & Dance Transfer and click Queue Prompt. Reference audio is routed automatically to the output MP4.

FunControl Quality Tip (Canny vs. DWPose): The built-in Canny node also extracts background lines, which can clash with your target character's background if the driving clip has a busy scene. For noticeably cleaner motion transfer, use a clean/simple-background driving video, or swap Canny for a human-skeleton preprocessor (DWPose / OpenPose from comfyui_controlnet_aux).

D. Verified Timings on Reference Hardware (RTX 3080 Ti 12GB VRAM)

  • Mode 1 Stage 1 (784×1024 portrait, 73 frames / 3s @ 24fps, Base 20 steps): 179.0s
  • Mode 1 Stage 2+3 (RIFE 48fps + RealESRGAN 2x → 1568×2048, 145 frames): +129.1s
  • Mode 2 FunControl GGUF Q8_0 (576×768, 49 frames / 2s @ 24fps, 20 steps): 68.4s

Credits & Attribution

Integrated workflow rig and controller nodes built upon open-source work by Alibaba Wan Team (Wan 2.2 5B & Fun-Control), comfyanonymous (ComfyUI & split text encoders/VAE), city96 (ComfyUI-GGUF), rgthree (rgthree-comfy), Kosinkadink (ComfyUI-VideoHelperSuite), Fannovel16 (ComfyUI-Frame-Interpolation), kijai (ComfyUI-KJNodes), and xinntao / ai-forever (RealESRGAN).

MIT License — see LICENSE.