SD-CN Animation Vid2Vid
Stylize an existing video into any checkpoint's look, frame by coherent frame
- model
- vae
- positive
- negative
- raft_model
- frames
- control_net
- frames
This is the node that made the original SD-CN-Animation famous in the first place, and it's the reason this pack still has a reason to exist in the Wan/LTX era. Feed it any video - a dance clip, a drone shot, a scene from a film - and it re-renders it through whatever Stable Diffusion checkpoint you load, while keeping the frames glued together. Where plain img2img-on-every-frame gives you the classic strobe-flicker mess, Vid2Vid uses optical flow to know where each pixel should be in the next frame, so the style carries through instead of resetting every 1/24th of a second.
How it works
The motion backbone here is RAFT (the "Recurrent All-Pairs Field Transforms" optical flow model from Princeton - the ~20MB raft-things.pth weights). Per frame:
- RAFT estimates bidirectional optical flow between consecutive input frames. Where forward flow disagrees with backward flow, the algorithm knows a region is occluded - something got covered or revealed.
- The previous styled frame is warped forward along the flow, so the style travels with the motion instead of being re-invented.
- The warped result is blended with the current input frame (controlled by
blend_alpha), then occlusion areas are inpainted by SD atprocessing_strength. - A low-denoise
fix_frame_strengthrefine pass cleans up, and a histogram match against the input frame locks the colors.
It's the same two-pass philosophy as Txt2Vid, but grounded in real motion estimates from actual footage instead of a model's guess about the next frame.
Inputs that matter
Mostly the same KSampler set as Txt2Vid (model, vae, positive/negative, steps, cfg, sampler/scheduler, seed), plus raft_model from a Load RAFT Model node and frames from a video loader like VHS_LoadVideo.
The Vid2Vid-specific dials, which are worth understanding because they're what stop ghosting:
processing_strength- main stylization denoise. The README's sweet spot is 0.75–0.85.fix_frame_strength- 0.1–0.2 refine pass, or 0 to skip.blend_alpha- the warped-styled-vs-original-input blend. Higher keeps more of the original video's structure; lower leans on the stylized warp.occlusion_mask_blur- smooths the mask that decides what gets regenerated. 2–4 is the starting range.occlusion_mask_trailing- blend the current occlusion mask with the previous frame's to cut ghosting. Enable it if moving subjects leave afterimages.- The three
occlusion_mask_*_multiplierknobs weight the flow-consistency vs. frame-difference signals that build the mask; leave them alone until you're debugging.
Optional control_net + cn_strength: this one is a genuine highlight. Unlike most video stylization setups, the ControlNet hint is the current input frame, automatically, every frame. A depth or lineart ControlNet preserves structure, so your style lands on the footage rather than replacing it.
Output is the styled frames IMAGE batch → VHS_VideoCombine.
Install
ComfyUI Manager (search "ComfyUI-SD-CN-Animation"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/pxl-pshr/ComfyUI-SD-CN-Animation
Restart. Deps are opencv-python, scikit-image, scipy; the ~20MB raft-things.pth auto-downloads from Hugging Face into ComfyUI/models/RAFT/ on first launch.
Gotchas
You need at least 2 input frames or the node refuses with a clear error. The algorithm's known weakness - the original author admitted it in 2023 - is ghosting and occasional flicker on fast, complex motion; that's what occlusion_mask_trailing and the mask multipliers exist to fight. Also manage your expectations on speed: two sampling passes per frame means a 30-second clip at 24fps is a serious session, even with steps dropped to 10–12. And if you're just after a quick "cartoon-ify my video," a per-frame img2img with a good ControlNet is faster; this node is for when the flicker drives you up a wall.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| vae | VAE | — | |
| positive | CONDITIONING | — | |
| negative | CONDITIONING | — | |
| raft_model | RAFT_MODEL | — | |
| frames | IMAGE | — | |
| seed | INT | 00–18446744073709550000 | — |
| steps | INT | 151–200 | — |
| cfg | FLOAT | 5.50–100 | — |
| sampler_name | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 | |
| processing_strength | FLOAT | 0.850–1 | Denoising strength for main stylization pass |
| fix_frame_strength | FLOAT | 0.150–1 | Denoising strength for refinement pass (0 to skip) |
| blend_alpha | FLOAT | 1.000–1 | Blend between warped styled frame (0) and current input frame (1) |
| occlusion_mask_blur | FLOAT | 3.00–10 | Gaussian blur applied to occlusion mask |
| occlusion_mask_flow_multiplier | FLOAT | 5.00–10 | Weight for flow-based occlusion detection |
| occlusion_mask_difo_multiplier | FLOAT | 2.00–10 | Weight for original frame difference occlusion |
| occlusion_mask_difs_multiplier | FLOAT | 0.00–10 | Weight for styled frame difference occlusion |
| occlusion_mask_trailing | BOOLEAN | false | Blend current occlusion with previous to reduce ghosting |
| control_netopt | CONTROL_NET | — | |
| cn_strengthopt | FLOAT | 1.000–10 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| frames | IMAGE | — |