Universal Latent Upscaler
The 'universal' latent upscaler that ships with no weights
- latent
- upscaled_latent
Latent upscaling is the hi-res-fix shortcut. Instead of decoding to pixels, upscaling, and re-encoding - a whole VAE round trip - you stretch the latent itself and let a second KSampler pass at low denoise (0.3β0.5) rebuild the detail. Cheaper on VRAM, faster, and the tradeoff is that your stretch has to be decent enough for the second pass to fix. This node's pitch is that it's universal: auto-detect whether you're feeding a 4-channel latent (SD 1.5, SDXL) or a 16-channel one (Flux, Wan), and load the right neural upscaler on the spot.
The auto-detection is real and it's the best part. The catch is what the pitch doesn't say: the models aren't in the repo.
How it works
Required input is a single latent. Two optional controls: strength (0β2, default 1.0) and model_type (auto / advanced / legacy, default auto). Output is upscaled_latent, a LATENT you feed straight into the second sampler.
In auto mode it counts channels. Four channels β the "advanced" model, a small convnet with 8 residual blocks and a PixelShuffle upscale. Sixteen β the "legacy" Wan VAE model, an encoder + transposed-conv stack with a residual connection. Both are trained to take a 32Γ32 latent tile to 64Γ64 - a 2x spatial upscale, which at the usual 8x latent downscale works out to roughly 4x the pixels.
The strength slider is the useful one. Below 1.0 it blends the neural result with a plain bilinear upscale of the original latent - genuinely handy when the network's output looks too aggressive or slightly off, and a cheap way to get "a little help" instead of a full neural stretch. It also pads or truncates mismatched channel counts rather than failing, and prints a warning (but proceeds) if your latent isn't 32Γ32.
The catch you need to know about
That neural network needs weights, and the pack ships none for this node. The models/ folder in the repo holds only the resizer .pt files used by this pack's other upscaler, "π Universal NN Latent Upscale *DRE". This node instead goes hunting for best_model.pth, final_advanced_upscaler.pth, real_wan_vae_upscaler_best.pth, or simple_wan_vae_upscaler.pth in ComfyUI-relative paths - files that exist only if you ran the author's training scripts first.
Feed it a 4-channel latent in auto mode with no weights and it raises a FileNotFoundError that, in so many words, tells you to run the "DENRAKEIW SUPERHERO" training script. The repo does bundle that machinery (advanced_trainer.py, train_advanced_upscaler.py, plus dataset-prep scripts), so the intended path is: train an upscaler on your VAE's latents, then use this node. Most people do not want to train an upscaler just to get a hi-res fix.
If out-of-the-box NN latent upscaling is what you actually want, reach for the sibling node instead: "π Universal NN Latent Upscale *DRE" (class UniversalNNLatentUpscale_DRE). It's the Ttl/ComfyUi_NNLatentUpscale-derived one, and its SD 1.5 / SDXL / Flux / Wan 2.2 .pt weights are bundled. Same pack, no training required. This WanNNLatentUpscaler is the older custom one, kept around for its self-trained 4ch path and 16ch Wan support.
Fitting it into a workflow, and where it trips
This is the VRAM-cheap rung of upscaling, not the quality king. Most of the community has migrated to pixel-space upscalers - SeedVR2 for detail, ESRGAN for plain pixels - because the VAE round trip got cheap and neural latent stretches have a reputation for slight blur or color shifts. Treat it as the budget latent path in a hi-res-fix chain, and don't expect it to out-resolve a pixel upscaler.
Two real traps:
- It expects a 4D
[B, C, H, W]latent. A Wan 2.x video latent is[B, 16, T, H, W]- 5D - and the node will choke on the shape unpacking. Single frames only. - If your second pass comes back mushy, drop
strengthto 0.5β0.8 and let the sampler do the detail work, rather than trusting a 1.0 neural stretch.
Install
Same pack as everything else here: ComfyUI Manager (search "DenRakEiw_Nodes") or
cd ComfyUI/custom_nodes
git clone https://github.com/DenRakEiw/DenRakEiw_Nodes
cd DenRakEiw_Nodes
pip install -r requirements.txt
This node itself only needs torch, which ComfyUI already provides - the heavy requirements.txt (kornia, diffusers==0.32.2, OpenCV) serves the pack's other nodes. Worth knowing so the install time doesn't surprise you.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | β | |
| strengthopt | FLOAT | 1.00β2 | β |
| model_typeopt | COMBO | auto | 3 options: auto, advanced, legacy |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| upscaled_latent | LATENT | β |