Nodes/comfyui-vae-float32/ANDRO VAE Encode
ComfyUI Node

ANDRO VAE Encode

The encode half of the float32 round trip — and where precision quietly dies

By AndreiOrehov·Created 28 days ago·Updated about 18 hours ago· 4
ANDRO VAE Encode
  • pixels
  • vae
  • latent
  • report
precisionfloat32

ANDRO VAE Encode is the mirror image of its bigger sibling in this pack. ANDRO VAE Decode rescues precision on the way out of a latent; this node stops the encoder from throwing it away on the way in. Stock VAEEncode casts your pixels to the VAE's working dtype - almost always bfloat16 - before the weights ever see them. Feed it a float32 EXR plate and that plate's precision is discarded at the door, no matter how many bits the file holds. This node defaults to precision: float32, so the pixels you hand in are what the encoder actually encodes.

When you'd actually reach for it

On its own, encode precision rarely matters. A fresh PNG from a sampler is 8-bit; nobody is losing anything encoding that. It matters the moment your input is a float32 plate - a decoded EXR sequence you're pushing through img2img, a re-encode after a decode-encode round trip for video extension, an upscaled float pass - and you want the next latent to carry what you already paid for in VRAM and disk. The two ANDRO nodes are one system: decode in float32, save to EXR, then later encode that EXR back in float32 instead of watching the bf16 cast flatten it to 77 levels before the model runs.

One thing this node does that the stock one won't: it measures the incoming range before encoding and puts it in a report output. If a plate arrives already carrying values outside [0,1] - shadows crushed, highlights blown relative to the model's expectations - that's seen and named, not discovered three nodes downstream.

Inputs and outputs

  • pixels - the image to encode. As above, it keeps its precision here only if precision is float32.
  • vae - the VAE that belongs to the model you're feeding. This matters more than it sounds: a VAE is trained together with its model. Pairing one model's latents with another's VAE doesn't fail loudly, it just decodes wrong - the KB's single most repeated VAE mistake. Use the one that came with your checkpoint.
  • precision - float32 (default) or vae default, for a stock-faithful cast.

Outputs are the encoded latent and a report string with the range of what went in, measured before the latent exists.

Install and context

ComfyUI-Manager → search comfyui-vae-float32 → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/AndreiOrehov/comfyui-vae-float32

Restart and look under ANDRO - the whole pack lives in one category and is coloured alike on the canvas so you can see at a glance which nodes belong to it. It's from the same author as the decode node (Andrei Orehov / Andromediastudio), ships under Apache-2.0, and carries the same reach-into-private-API caveat: it touches vae.vae_dtype and the model weights, which aren't public ComfyUI API. Nothing here is a magic quality knob for ordinary 8-bit workflows - if you're generating straight to PNG and never regrading, you don't need this. Its whole reason to exist is the person whose frames land in an EXR pipeline and get pushed hard under a grade, where the headroom is actually spent.

CategoryANDRO

Inputs (3)

NameTypeDefaultDescription
pixelsIMAGEThe image to encode. A float32 EXR plate keeps its precision here only if precision is float32.
vaeVAEThe VAE that belongs to the model. A VAE is trained together with its model - pairing one model's latents with another's VAE does not fail loudly, it just decodes wrong.
precisionCOMBOfloat32'vae default' casts the plate to the VAE's dtype (usually bfloat16) before the weights see it, which throws away a float32 EXR's precision at the door.

Outputs (2)

NameTypeDescription
latentLATENTThe encoded latent.
reportSTRINGThe range of what was handed in, measured BEFORE the latent exists, so out-of-range input is seen rather than inferred afterwards.