Nodes/ComfyUI-BCNodes/SeedVR2 VAE Encode
ComfyUI Node

SeedVR2 VAE Encode

SeedVR2 VAE Encode — Encodes a Whole Clip Without the VRAM Bill

By 0xBeycan·Created 23 days ago·Updated 3 days ago· 2
SeedVR2 VAE Encode
  • pixels
  • vae
  • LATENT
◄tile_size1024►
◄overlap256►
◄temporal_size64►
◄temporal_overlap8►

The problem it solves

SeedVR2's OOM reputation is real and earned. It isn't the model being sloppy - it's that the pipeline holds a whole clip on the GPU at once, and a whole clip at 1080p is more than a consumer card has.

Concretely: ComfyUI's stock VAE Encode (Tiled) for this VAE moves the entire batch to the GPU first, after making a full float32 x × 2 − 1 copy in system RAM - then encodes it slice by slice. So VRAM grows with the frame count on top of the encoder's fixed working set, and the fixed working set for a whole 1080p frame is over 28 GB on a 32 GB card. 897 frames at 1080p do not fit in one tile. The native node will fail regardless of how much RAM you have.

This node runs the identical slice loop, with the same causal memory cache and the same x × 2 − 1, but it builds each 4-frame input slice on the GPU only when that slice's turn comes. VRAM is then the encoder's working set no matter how long the clip is, and the float32 copy in RAM is gone entirely.

What it takes and gives back

Inputs are pixels (the frames from BC_SeedVR2Resize's image output - already padded to a multiple of 16 and to 4n+1 frames) and vae (the SeedVR2 VAE). One output: LATENT, shape (1, 16, T', H/8, W/8), float32 - the same thing the native tiled encode produces.

You also get four tiling widgets, tile_size (1024), overlap (256), temporal_size and temporal_overlap. Trust the tooltips on the last two: they're ignored, exactly as the SeedVR2 VAE ignores them in the native tiled node, because this is a causal VAE that slices time by itself. Setting them does nothing. Go tune something else.

Spatial tiling is the native one: same tile grid, same cosine blend on the latent grid, same count normalisation as tiled_vae - tile by tile, one causal cache at a time, with the blend accumulated in float32 in RAM. If tile_size covers the frame you get one tile and no blending at all, which is what you want if it fits.

Picking a tile size

At 1080p, a whole-frame tile (2048) just fits a 32 GB card. A 1024 tile needs roughly half that. Start at 1024 unless you have headroom and a reason.

The node also checks free VRAM against its working set before starting and, when it's short, unloads every other model - the DiT is staged in RAM by ComfyUI and reloads on demand. That's deliberate: ComfyUI's own loader won't evict one "dynamic" model for another, which is exactly what made the native decode fail when it ran next to a resident DiT. With enough VRAM nothing is unloaded, but expect a slower first run when it does.

It logs progress next to the progress bar - one line at the start (897 frames, 6 tile(s) x 224 slice(s), where the tile count tells you at a glance whether your tile_size covered the frame) and then an update every 10 s with slice, tile, frame, VRAM and an ETA.

Install

Manager: search ComfyUI-BCNodes, install, restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/0xBeycan/ComfyUI-BCNodes

Nothing to pip install for this node - the pack's requirements.txt backs two unrelated nodes. Type BCNodes in the node library; the SeedVR2 four are under BCNodes/seedvr2.

Where people get burned

This is a video node. For a single image, the README's own advice is to send BC_SeedVR2Resize's image to the stock VAE Encode (Tiled) instead. Wiring one frame through the video path works but gains you nothing over the core node.

Feed it Resize's image, not the raw frames. The padding to /16 and 4n+1 isn't cosmetic - the VAE expects it.

There's a parity test if you don't believe it. tests/parity_seedvr2_video.py --vae … --tile … checks the output against VAE.encode_tiled (expected: identical latent) and prints both peak VRAMs. Worth running once on your own card before you trust a 900-frame overnight job to a node you just installed.

Start smaller than you think. The whole point is that VRAM is now flat over clip length, so the only cost of a conservative tile is time. tile_size 1024 with overlap 256 is the default for a reason. If your VRAM is tight, that's the knob - and dropping it is much better than discovering the limit three quarters of the way through a long clip.

CategoryBCNodes/seedvr2

Inputs (6)

NameTypeDefaultDescription
pixelsIMAGEFrames from SeedVR2 Resize `image` (padded to /16 and 4n+1 frames).
vaeVAE—
tile_sizeINT102464–4096Spatial tile in pixels, as VAE Encode/Decode (Tiled). A tile that covers the frame means no tiling.
overlapINT2560–4096—
temporal_sizeINT648–4096Ignored, as it is by the SeedVR2 VAE in VAE Encode/Decode (Tiled): the causal VAE slices time itself.
temporal_overlapINT84–4096Ignored, as it is by the SeedVR2 VAE in VAE Encode/Decode (Tiled).

Outputs (1)

NameTypeDescription
LATENTLATENT—