Nodes/ComfyUI_agilly1989_motorway/VAEEncodeTiled_motorway_edition
ComfyUI Node

VAEEncodeTiled_motorway_edition

Encode huge images (and video) without the OOM

By agilly1989·Created 2 years ago·Updated about a year ago· 7
VAEEncodeTiled_motorway_edition
  • MOTORWAY 🚌💨
  • MOTORWAY 🚌💨
INPUT_pixels_keypixels
INPUT_vae_keyvae
tile_size512
overlap64
temporal_size64
temporal_overlap8
OUTPUT_LATENT_keyLATENT

Encoding a 4K image or a long video into latent space is a memory hog - the whole frame stack goes through the VAE at once and small GPUs throw OOM errors for fun. VAEEncodeTiled is the answer: it processes the image in overlapping tiles, encoding one chunk at a time, and reassembles the latent. This _motorway_edition clone brings that tiled encode to the agilly1989 Motorway pipe, reading the image and VAE from the shared dict by key.

Motorway primer: start with MotorwayStart, then each _motorway_edition node swaps data wires for key strings, reading and writing a shared dict that flows down one MOTORWAY connection. These nodes are auto-generated clones of core ComfyUI nodes, so the tiling behavior is identical to stock VAEEncodeTiled.

What it does. It takes pixels and a vae and encodes to a latent, but the image is split into tiles first. tile_size (default 512) is the tile edge, overlap (default 64) keeps tile seams from showing. The temporal_size (64) and temporal_overlap (8) fields are the video part - per the stock tooltip, they're "only used for video VAEs" and control how many frames get encoded at once and how much they overlap. That's how you feed a long video clip into an img2img-style workflow without the encode being the thing that kills your run.

The inputs that matter. MOTORWAY is required. INPUT_pixels_key (default pixels) and INPUT_vae_key (default vae) point at the image and VAE in the dict - mind the case trap, since VAELoader_motorway_edition stores under VAE uppercase by default and you'll need to match that in INPUT_vae_key. OUTPUT_LATENT_key (default LATENT) is where the encoded latent lands. Output: the MOTORWAY port only.

Common issues. Tiling trades VRAM for time: big images take noticeably longer to encode tiled, and too-small overlap can leave faint seams in the latent that show up after sampling. The Motorway's key/case traps are the other recurring pain - 'MotorwayClass' object has no attribute 'hash_' is just "key not found," so double-check spellings before blaming the node. And the standing caveat: the pack's current main branch has the clone registration commented out in __init__.py, so if this node is missing from your menu, that's the version you're on.

Install via ComfyUI Manager (search "ComfyUI_agilly1989_motorway") or clone into custom_nodes, restart, no models to download. Solo-dev beta pack - the README literally says "it works on my system," which is a fine bar for a VRAM-saving wrapper like this one.

Categoryagilly1989 Nodes/Motorway-ed/_for_testing

Inputs (8)

NameTypeDefaultDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨
INPUT_pixels_keySTRINGpixels
INPUT_vae_keySTRINGvae
tile_sizeINT51264–4096
overlapINT640–4096
temporal_sizeINT648–4096Only used for video VAEs: Amount of frames to encode at a time.
temporal_overlapINT84–4096Only used for video VAEs: Amount of frames to overlap.
OUTPUT_LATENT_keySTRINGLATENT

Outputs (1)

NameTypeDescription
MOTORWAY 🚌💨MOTORWAY 🚌💨