Nodes/ComfyUI-Foveated_Diffusion/Foveated VAE Decode (FovDiff)
ComfyUI Node

Foveated VAE Decode (FovDiff)

The decode half of the foveation trick — and the only node that's optional

By ruwwww·Created 2 months ago·Updated 2 months ago· 1
Foveated VAE Decode (FovDiff)
  • samples
  • vae
  • foveation_mask
  • image
blend_modehard
blend_sigma8.0

Here's the honest pitch: you will probably not need this node on your first successful run. FoveatedVAEDecode only matters when you've set decode_mode: merge on the pack's FoveatedKSampler - that's the mode that decodes the high-res and low-res regions separately and stitches them in pixel space. If you left the sampler on its default direct mode, you use a plain stock VAEDecode and this page is just context. Good to know, because half of the "why is my image weird" posts you'd otherwise write come from mixing those two up.

The reason merge mode exists at all is edge quality. In direct mode the sampler reconstructs the full grid inside latent space and the boundary between fovea and periphery is handled implicitly, which is fast and usually fine. Merge mode is the belt-and-suspenders path: the high-res latent is decoded as-is, the same latent is average-pooled down by the lr_factor and decoded at its native low resolution, then bicubic-upscaled and blended against the high-res image. The pack block-aligns the mask first, so the blend boundary doesn't cut through the middle of a token block and leave a seam.

Inputs you'll actually touch

  • samples - the LATENT from FoveatedKSampler, and vae - your Klein VAE. Both are exactly what you'd feed a normal VAEDecode.
  • foveation_mask - the same FOVEATION_MASK object the sampler used. Same latent source, same mask, or the geometry drifts and you get artifacts where the two regions disagree.
  • blend_mode - hard (default) or soft_gaussian. hard is a crisp cut at the fovea boundary; soft_gaussian blurs that boundary so the transition is gradual.
  • blend_sigma - the author's tooltip says it plainly: "Gaussian blur sigma for soft boundary." Only does anything when blend_mode is soft_gaussian. Default 8.0 is a reasonable starting point; crank it if you see a visible ring around the high-res region, drop it if everything looks mushy.

Output is a single image, ready for SaveImage or whatever follows.

When to actually use it

Choose decode_mode: merge on the sampler when you're pushing a small fovea (small radius, high lr_factor) and the boundary between regions is where your eye lands anyway - high-detail work where a latent-space blend leaves a visible step. Otherwise, direct plus the stock VAEDecode is faster, simpler, and the two nodes you already know. The pack itself treats merge as the option, not the default.

One install note, since it applies to every node in this pack: there's no requirements.txt, so if you cloned manually you're relying on your ComfyUI already having einops - it usually does, but pip install einops in your ComfyUI environment is the fix if the nodes refuse to load. And as always with this pack: Klein only, mask and latent shapes must agree. FoveatedVAEDecode is the one node in the five that you can skip entirely and still have a working, fast workflow - treat it as the refinement knob, not a requirement.

Categoryfoveated_diffusion

Inputs (5)

NameTypeDefaultDescription
samplesLATENT
vaeVAE
foveation_maskFOVEATION_MASK
blend_modeCOMBOhard2 options: hard, soft_gaussian
blend_sigmaFLOAT8.00–64Gaussian blur sigma for soft boundary.

Outputs (1)

NameTypeDescription
imageIMAGE