Nodes/ComfyUI-SUPIR/SUPIR Encode
ComfyUI Node Runs on cloud

SUPIR Encode

Getting an image into SUPIR's latent space without the denoise pass

By kijai·Created 2 years ago·Updated 3 months ago· 2,303
SUPIR Encode
  • SUPIR_VAE
  • image
  • latent
use_tiled_vaetrue
encoder_tile_size512
encoder_dtypeauto

This is the plain half of SUPIR_first_stage - encoding only, no denoising. SUPIR uses its own VAE, separate from a standard ComfyUI VAE, so you can't just wire an image into a regular VAE Encode node and expect the sampler to accept the result. This node is how you get an image into SUPIR's latent space when you've decided you don't want the "first stage" denoise-and-blur pass applied on the way in.

That decision matters more than it looks. SUPIR_first_stage bundles this same encode step with a denoising pass that cleans up compression artifacts and noise - genuinely useful on a degraded source, but a net negative on an image that's already clean, since it adds blur that then has to be undone by the sampler. Reaching for this node instead of first_stage is the right call when your source is already sharp, or when you've already run your own preprocessing (a different upscaler, your own denoise, whatever) and just need the result converted into SUPIR's latent space to hand off to the sampler.

Inputs and outputs that matter

Required: SUPIR_VAE (from either model loader), image, use_tiled_vae (defaults on - processes the image in chunks to control memory use), encoder_tile_size (default 512, only relevant with tiling on), and encoder_dtype (leave on auto unless troubleshooting a load issue).

Output: a single latent, which feeds into SUPIR_conditioner and SUPIR_sample exactly like the latent output of SUPIR_first_stage would.

How to install it

ComfyUI Manager: search "SUPIR", install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-SUPIR
pip install -r ComfyUI-SUPIR/requirements.txt

Portable: python_embeded\python.exe -m pip install -r .... Wants a reasonably current PyTorch; xformers is optional and auto-detected. This node doesn't load model files itself - it consumes SUPIR_VAE from an upstream loader node, which needs a SUPIR checkpoint and an SDXL checkpoint in ComfyUI/models/checkpoints.

Common issues

The one mistake worth flagging explicitly: feeding this node's output straight into a standard ComfyUI sampler. It won't work - SUPIR_encode produces a latent shaped for SUPIR's own VAE space and sampler, and the only node built to consume it correctly is SUPIR_sample. If you're trying to mix SUPIR into a broader non-SUPIR pipeline, you need to go all the way through SUPIR_sample and SUPIR_decode before you're back to something ordinary nodes can use.

Memory behavior mirrors the rest of the VAE-side nodes - it scales with input resolution, and use_tiled_vae is there to keep that manageable on smaller cards. If you're hitting out-of-memory errors here specifically, dropping encoder_tile_size further is the first lever to pull before assuming you need a bigger GPU.

Given how few people reach for this node directly compared to SUPIR_first_stage or the all-in-one SUPIR_Upscale, double check it's actually what you want: if you're not deliberately skipping the denoise pass for a reason, SUPIR_first_stage does the same job plus the restoration cleanup in one step.

CategorySUPIR

Inputs (5)

NameTypeDefaultDescription
SUPIR_VAESUPIRVAE
imageIMAGE
use_tiled_vaeBOOLEANtrue
encoder_tile_sizeINT51264–8192
encoder_dtypeCOMBOauto3 options: bf16, fp32, auto

Outputs (1)

NameTypeDescription
latentLATENT