Nodes/SimpleSyrup/VAE Encode (Options)
ComfyUI Node

VAE Encode (Options)

Control the encode, not just the decode

By Artificial-Sweetener·Created 3 months ago·Updated 12 days ago· 2
VAE Encode (Options)
  • pixels
  • vae
  • latent
use_tilingfalse
tile_size512
overlap64
temporal_size64
temporal_overlap8

People fuss over decode because that's where you can see the damage - grey images, seam lines, OOM crashes. But encode has the same memory problem in reverse, and Comfy hides the escape hatch in exactly the same way. VAE Encode (Options) is the mirror of the pack's VAE Decode (Options): one encode node with an explicit use_tiling switch and the tile parameters for Comfy's native tiled encoder, including temporal tiling for video.

How it works

Same pattern as its decode sibling. With use_tiling off, it expands into Comfy's standard VAEEncode - which keeps the automatic tiled retry after OOM. Flip it on and it expands into VAEEncodeTiled, forwarding tile_size, overlap, temporal_size, and temporal_overlap. No new VAE machinery is involved; you're getting Comfy's own tiled encode, just with parameters you picked instead of the fallback's guess.

You feel the difference on the input side. Encoding a large reference image into latent space - say, a 2K source you're feeding into img2img or inpainting - is where encode tiling actually earns its keep. The stock node will get there eventually through its OOM retry, but it'll do it with whatever default tile it chose, and you won't know what that was until the seams show up.

The inputs

  • use_tiling - the master switch, off by default (plain Comfy behavior).
  • pixels and vae - the image going in and the VAE doing the work. Use the VAE that matches your checkpoint; a mismatched VAE is how encodings come back subtly wrong or straight-up noisy.
  • tile_size (default 512) - larger tiles encode faster but use more memory. Start at 512 and step down toward 256 when you're bumping the ceiling.
  • overlap (default 64) - shared pixels between tiles; too little invites seams, too much re-encodes the same area.
  • temporal_size (default 64) and temporal_overlap (default 8) - only for video VAEs: frames per temporal tile and the overlap between them. Ignore for stills.

The single latent output feeds a sampler's samples input, or chains into conditioning-based workflows.

When to reach for it

For everyday txt2img at native resolution, don't bother - plain VAEEncode is fine, and the node's author would tell you the same. It earns its place in two spots: big-source img2img where you want to decide the tiling upfront, and video work where bounding frames-per-tile matters for memory. If you've ever built a toggle contraption to switch between VAEEncode and VAEEncodeTiled, this replaces it with one node and a boolean.

Installing it

It ships in the SimpleSyrup pack. ComfyUI Manager: search SimpleSyrup, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Artificial-Sweetener/SimpleSyrup.git
cd SimpleSyrup
../venv/bin/python -m pip install -r requirements.txt

No model downloads - it delegates entirely to Comfy's native VAE nodes. One thing worth knowing: the pack also has Simple VAE Encode, which is a different idea entirely (it reuses the source latent when the graph proves the image is an unmodified decode). Use that one to skip lossy round trips, use this one to control how a real encode tiles.

CategorySimpleSyrup/Latent

Inputs (7)

NameTypeDefaultDescription
use_tilingBOOLEANfalseUse ComfyUI's tiled VAE node. Disabled uses normal ComfyUI VAE behavior, including its automatic tiled retry after out-of-memory.
pixelsIMAGEImage to encode into latent space.
vaeVAEVAE used for the selected encode or decode operation.
tile_sizeINT51264–4096Tile size in pixels. Larger tiles are faster but use more memory.
overlapINT640–4096Overlap between tiles in pixels. Larger overlaps reduce seams but do more work.
temporal_sizeINT648–4096For video VAEs, number of frames to encode at once.
temporal_overlapINT84–4096For video VAEs, number of overlapping frames between temporal tiles.

Outputs (1)

NameTypeDescription
latentLATENTLatent produced by ComfyUI's selected VAE encode node.