Nodes/ComfyUI-STARFlow/STARFlow VAE Decode
ComfyUI Node

STARFlow VAE Decode

The boring node that finishes every STARFlow image

By RyukoMatoiFan·Created 8 months ago·Updated 2 months ago· 0
STARFlow VAE Decode
  • samples
  • vae
  • image
vae_scaling0.1822

Every STARFlow T2I workflow ends here, and this node is gloriously unglamorous: it takes the latent that STARFlowSampler hands you and turns it into a viewable image. No sampler math, no prompts, no API. You wire it between the sampler and a SaveImage, and it just does its job. If you've used VAEDecode on a normal SD workflow, you already know the shape of this thing - the difference is that STARFlow doesn't live in the same latent space as the checkpoints ComfyUI was built around, so it needs its own decoder node instead of the core one.

Why it exists

STARFlow is Apple's normalizing-flow T2I model, ported to ComfyUI by this pack. Flow models don't denoise with epsilon prediction the way SD 1.5 or SDXL do, and they keep their latents scaled differently too. The STARFlowSampler outputs a plain LATENT, but you can't just feed that to the stock VAEDecode and expect the right colors and brightness - the scale is off. STARFlowVAEDecode fixes the scale, then calls the exact same vae.decode() the core node uses. It's a thin wrapper with one important number inside it.

The inputs that matter

  • samples - the LATENT from STARFlowSampler. Non-negotiable.
  • vae - the decoder. The README is explicit: use ComfyUI's core VAELoader with sd-vae-ft-ema.safetensors, because STARFlow was trained on stabilityai/sd-vae-ft-ema. You can experiment with other SD-family VAEs, but start with the one the model actually trained against.
  • vae_scaling - the one number to know about. Default is 0.18215, which is the SD1.x scaling factor and the correct value for sd-vae-ft-ema. The tooltip spells out the alternative: 0.13025 for SDXL. If your output looks washed out or too contrasty, this is the knob to touch, not the sampler.

The output is a single IMAGE, ready for SaveImage, PreviewImage, or anything else in your chain.

Installation

This is the same install for every node in the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/RyukoMatoiFan/ComfyUI-STARFlow
pip install -r ComfyUI-STARFlow/requirements.txt   # into your ComfyUI python env
# restart ComfyUI

The requirements.txt is deliberately light - just transformers>=4.40 and sentencepiece>=0.2, because torch, einops, and safetensors already ship with ComfyUI. If you prefer, ComfyUI Manager will find the pack if you search for "ComfyUI-STARFlow".

Then grab the three T2I pieces: starflow_3B_t2i_256x256.safetensors into ComfyUI/models/starflow/, FLAN-T5-XL encoder weights into ComfyUI/models/text_encoders/, and sd-vae-ft-ema.safetensors into ComfyUI/models/vae/. Converted checkpoints and checksums live at huggingface.co/AkaneTendo25/starflow.

Common issues

The only real gotcha here is pairing the wrong VAE. If you feed it a VAE that isn't sd-vae-ft-ema-trained, you'll get output that's technically decoded but looks wrong - muddy or oversaturated. And if your images come out looking scaled somehow, double-check vae_scaling is still 0.18215; someone (or an old workflow) may have left it at an SDXL value. Neither failure is exotic, but both are instantly fixable.

Honestly, that's the whole node. Set it, forget it, move on to the part of the workflow that's actually fun.

CategorySTARFlow

Inputs (3)

NameTypeDefaultDescription
samplesLATENTLatent samples to decode
vaeVAEVAE decoder (use ComfyUI's VAELoader)
vae_scalingoptFLOAT0.18220.01–2VAE scaling factor (0.18215 for SD1.x/SD2.x, 0.13025 for SDXL)

Outputs (1)

NameTypeDescription
imageIMAGE