Nodes/RES4LYF/StableCascade_StageC_VAEEncode_Exact
ComfyUI Node Runs on cloud

StableCascade_StageC_VAEEncode_Exact

Encoding an image into Stage C's latent space at a size you actually chose

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
StableCascade_StageC_VAEEncode_Exact
  • image
  • vae
  • stage_c
width24
height24

Stable Cascade's whole pitch was aggressive compression - Stage C's latent space is much smaller relative to the image than a normal SD VAE's, which is how the Würstchen architecture got its speed and VRAM wins. That's great until you try to encode a reference image for img2img and the usual "derive the latent size from the input image" math stops mapping cleanly. StableCascade_StageC_VAEEncode_Exact sidesteps that by letting you set the Stage C latent's width and height directly instead of guessing.

How it works

It's a VAE encode like any other - image goes in, latent comes out - except the size fields aren't pixel dimensions and aren't inferred automatically. You're setting the exact Stage C latent grid you want back, which matters because Stage C's compression ratio isn't the same as a standard 4-channel SD VAE, so "just resize the image first" doesn't reliably land you on the size your Stage C sampler expects. This exists specifically for guide and img2img-style workflows, where you need an encoded reference latent that lines up with whatever your Stage C sampler is actually producing.

The inputs and outputs that matter

  • image (IMAGE) - your reference image to encode.
  • vae (VAE) - needs to be Stable Cascade's own Stage C VAE, not a normal SD/SDXL one.
  • width / height (INT, default 24, range 1–1024) - the exact Stage C latent dimensions you want, not pixel size. Match these to whatever your Stage C sampler's own latent is, or the encoded reference won't line up with it.
  • Output: stage_c (LATENT) - feed into a sampler's guide input, or wherever your workflow needs a Stage C-shaped latent.

How to install it

Via ComfyUI Manager: search RES4LYF, install, restart.

Manually:

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

Portable ComfyUI users: use the embedded Python's pip.exe instead of a venv pip. No extra model downloads for this node itself - you'll need Stable Cascade's own checkpoints and VAE, which is a separate download regardless of RES4LYF.

Common issues & troubleshooting

Plugging in the wrong VAE. This is the failure mode that bites hardest because it doesn't throw an error - it just quietly produces nonsense. Stage C needs its own VAE; an SDXL or SD1.5 VAE will "work" in the sense that the node runs, and the output will be garbage.

Size mismatch with your sampler. If the width/height you set here don't match the latent your Stage C sampler is actually generating, your img2img guide or dual-guide setup will be misaligned - the reference won't correspond spatially to what's being sampled. Check your sampler's own latent dimensions first and match this node to them, not the other way around.

Confusing these for pixel dimensions. The default of 24 is a giveaway that this is latent space, not pixels - don't set width/height here expecting them to behave like a normal image-resolution field.

CategoryRES4LYF/vae

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
vaeVAE
widthINT241–1024
heightINT241–1024

Outputs (1)

NameTypeDescription
stage_cLATENT