r/StableDiffusion – Telegram
ComfyUI-LoaderUtils Load Model When It Need

Hello, I am **xiaozhijason** aka **lrzjason**. I created a helper nodes which could load any models in any place of your workflow.

# 🔥 The Problem Nobody Talks About

~~ComfyUI’s native loader has a dirty secret:~~ **~~it loads EVERY model into VRAM at once~~** ~~– even models unused in your current workflow. This wastes precious memory and causes crashes for anyone with <12GB VRAM. No amount of workflow optimization helps if your GPU chokes before execution even starts.~~

**Edit: Model loads into RAM rather VRAM and dynamic load it when used. So, it doesn't load all models into VRAM at once which is incorrect in the statement.**

# Enter ComfyUI-LoaderUtils: Load Models Only When Needed

I created a set of **drop-in replacement loader nodes** that give you **precise control over VRAM usage**. How? By adding a magical optional `any` parameter to every loader – letting you **sequence model loading** based on your workflow’s actual needs

https://preview.redd.it/46s01mhwck6g1.png?width=2141&format=png&auto=webp&s=ccfac9d74d1a970cb97e821db6ae6a8b3c211261

**Key innovation:**
 **Strategic Loading Order** – Trigger heavy models (UNET/Diffusion model) *after* text encoding
 **Zero Workflow Changes** – Works with existing setups (just swap standard loaders for `_Any` versions and connect the loader before it need)
 **All Loaders Covered:** Checkpoints, LoRAs, ControlNets, VAEs, CLIP, GLIGEN – \[full list below\]

# 💡 Real Workflow Example (Before vs After)

**Before (Native ComfyUI):**
`[Checkpoint] + [VAE] + [ControlNet]` → **LOAD ALL AT ONCE** → 💥 *VRAM OOM CRASH*

**After (LoaderUtils):**

1. Run text prompts & conditioning
2. *Then* load UNET via `UNETLoader_Any`
3. *Finally* load VAE via `VAELoader_Any` after sampling → **Stable execution on 8GB GPUs** 

# 🧩 Available Loader Nodes (All _Any Suffix)

|Standard Loader|Smart Replacement|
|:-|:-|
|||
|`CheckpointLoader`|→ `CheckpointLoader_Any`|
|`VAELoader`|→ `VAELoader_Any`|
|`LoraLoader`|→ `LoraLoader_Any`|
|`ControlNetLoader`|→ `ControlNetLoader_Any`|
|`CLIPLoader`|→ `CLIPLoader_Any`|
|*(+7 more including Diffusers, unCLIP, GLIGEN, etc.)*||

**No trade-offs:** All original parameters preserved – just add connections to the `any` input to control loading sequence!

https://redd.it/1pjvn14
@rStableDiffusion
Limited Deal: Perplexit AI PRO 1-Year Membership 90% Off!
https://redd.it/1pk2f3r
@rStableDiffusion
Z-Image first generation time

Hi, I'm using ComfyUI/Z-image with a 3060 (12GB VRAM) and 16 GB RAM. Anytime I change my prompt, the first generation takes between 250-350 seconds, but subsequent generations for the same prompt are must faster, around 25-60 seconds.

Is there a way to reduce the generation of the first picture to be equally short? Since others haven't posted this, is it something with my machine? (Not enough RAM, etc?)

https://redd.it/1pk13tx
@rStableDiffusion
Old footage upscale/restoration, how to? Seedvr2 doesn't work for old footage
https://redd.it/1pk4m9m
@rStableDiffusion