Extensions/FeiHou WanAnimate2 Plus
ComfyUI Extension

FeiHou WanAnimate2 Plus

Long-video context windows, sequential sampling, and seam correction for ComfyUI Wan Animate2.

By FX-FeiHou·Created 2 days ago·Updated 2 days ago· 1
FX-FeiHou/ComfyUI-FeiHou-WanAnimate2-Plus
Nodes3
On cloudLocal install
CategoryFeiHou/WanAnimate2
Stars1
Updated2 days ago
Readme

FeiHou-WanAnimate2-Plus

中文说明 · MIT License

Version 0.6.0

This package provides two ComfyUI nodes for Wan Animate2 long-video renders:

  • FeiHou-WanAnimate2 Context Options: native context-window sampling with a real-output-frame UI.
  • FeiHou-WanAnimate2ToVideo: automatic sequential sampling with native pixel-space continuation between short segments.

It uses ComfyUI's native Animate2 context-window handler, but displays the window values in real output frames like WanVideo Context Options:

  • context_frames = 81 is converted internally to 21 latent frames.
  • context_overlap = 32 is converted internally to 8 latent frames.
  • context_stride = 4 is converted internally to one latent-frame stride.

The node also replaces the separate WanAnimate2Cache node. Its bounded cache options prevent one pose-branch cache from being retained forever for every context window.

Installation

Copy or symlink this folder into ComfyUI's custom_nodes directory, then restart ComfyUI:

F:\Ai\ComfyUI-aki-v3.2\ComfyUI\custom_nodes\FeiHou-WanAnimate2-Plus

Context-window workflow wiring

Replace this pair:

LightX2V LoRA -> Context Windows (Manual) -> WanAnimate2Cache -> sampler model

with:

LightX2V LoRA -> FeiHou-WanAnimate2 Context Options -> sampler model

Recommended initial settings:

context_schedule: standard_static
context_frames: 81
context_stride: 4
context_overlap: 32
pose_cache_mode: disabled
cache_dtype: int8

cpu_lru is the safest cache mode for VRAM. gpu_lru can be faster if it fits; disabled has the lowest cache memory requirement and is the recommended starting point for very long renders.

This node reduces sampling/cache VRAM; a very long source video can still require additional chunked VAE encode or decode support.

Automatic segment-loop workflow wiring

Use this path when one short segment fits in VRAM but the full Animate2 video does not, and you prefer segment-by-segment sampling over context windows:

ModelSamplingSD3 ──> FeiHou-WanAnimate2ToVideo model output ──> BasicScheduler + SamplerCustom model
                       └── positive / negative / latent ──────> original SamplerCustom inputs
SamplerCustom ──> original TrimVideoLatent (trim_amount = 0) ──> original VAEDecode

The new node replaces only WanAnimate2ToVideo; keep the original SamplerCustom, TrimVideoLatent, and VAEDecode. Set frame_window_size to the largest 4*n+1 segment that fits, such as 81. Feed the complete video length to length. At every boundary, the node internally decodes the previous segment's last five pixel frames and VAE-encodes them into the next segment's two-latent continue_motion condition. The first segment is kept intact; later segments omit their two newly sampled warm-up latents. The full generated video is still decoded once by the original downstream VAEDecode node.

FeiHou-WanAnimate2 Context Options must be bypassed or removed for this mode. The two long-video strategies cannot be stacked.

Optional seam colour matching

For the small low-frequency colour/exposure shift that can remain after segment continuation, add FeiHou-WanAnimate2 Seam Color Match immediately after VAEDecode:

VAEDecode ──> FeiHou-WanAnimate2 Seam Color Match ──> video output node

Set its frame_window_size to the same value as FeiHou-WanAnimate2ToVideo (normally 81). The node builds its reference from stable four-corner background pixels before each seam, then individually matches the next transition_frames frames with a bounded RGB gain/offset. It does not VAE-encode, resample, or alter motion/geometry. Start with strength = 1.00, analysis_frames = 16, and transition_frames = 10; lower the strength if the source intentionally changes lighting at a seam.