HI_Diffusers_Model_Loader
The Loader That Rebuilds Your Checkpoint as a High-Res Pipeline
- pipe
The name tells you exactly what this node does, which is more than most custom nodes manage. HI_Diffusers_Model_Loader is the first half of a two-node pack: it builds the pipeline, and Hi_Sampler runs it. You'll basically never use one without the other.
The whole point is HiDiffusion, Megvii's trick for generating at resolutions a model was never trained on. Train SD 1.5 at 512 and ask it for 2048 and you get the classic failure - duplicated faces, extra limbs, composition that falls apart. HiDiffusion attacks that with two ideas: RAU-Net, which downsamples the deep blocks of the U-Net so their receptive field matches what they saw at training resolution, and MSW-MSA, shifted window attention that cuts inference time by roughly 40–60% at high resolutions. This is native high-res generation, not the two-pass hi-res fix you build out of a second KSampler.
What sets this pack apart from the other HiDiffusion ports: it doesn't monkey-patch ComfyUI's sampler at all. The loader calls HuggingFace's from_single_file on your local checkpoint, loads the whole thing into a diffusers pipeline, applies the HiDiffusion patch to that UNet, and hands you a pipe object that only this pack's sampler understands. You're effectively running a self-contained diffusers generation inside the ComfyUI graph.
Inputs that actually matter
There are a dozen inputs, but you'll touch these:
function_choice-txt2imgorimg2img. Pick once here; it decides which pipeline class gets built and what the sampler expects.ckpt_name- your checkpoint, from your normalmodels/checkpointsfolder. The node auto-detects whether it's SD 1.5, SD 2.1, SDXL, Playground v2, or SDXL-inpaint. Unsupported architecture and it raisesunsupport model!!.scheduler- 19 choices (DDIM, Euler, the DPM++ family, and friends). Matches what you'd pick on a normal KSampler.apply_window_attn- default off. This is the MSW-MSA toggle. It speeds things up, but at resolutions that don't partition cleanly into windows the author's own code warns the quality drops. Start with it off.
The rest is the grab-bag: vae_id, unet_model for the SDXL Lightning/Hyper/LCM/DMD2 fast UNets, controlnet_model (SDXL ControlNets only - canny, tile, openpose, scribble, MistoLine, inpainting), and lora + lora_scale + trigger_words. One quirk: trigger_words isn't just a label - if you load a LoRA, those words get appended to your prompt at sample time. Keep them as the LoRA's actual trigger phrase.
Output
One output, pipe (type HIDIF_MODEL). It wires into Hi_Sampler's pipe input, and nowhere else.
Install
Standard custom-node fare:
cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_HiDiffusion_Pro.git
Or search ComfyUI_HiDiffusion_Pro in ComfyUI Manager. Then restart. There's no requirements.txt shipped, so the real dependencies come from your ComfyUI venv - and the ones that aren't already there will bite you. The README calls for diffusers >= 0.28.0 (the single-file loader needs at least 0.27.2), plus yaml, and the code also imports omegaconf and cv2. Diffusers and omegaconf often aren't in a stock ComfyUI install:
/path/to/ComfyUI/python_embeded/python -m pip install "diffusers>=0.28.0" omegaconf
Worth knowing before you start: the other HiDiffusion ComfyUI ports earned a reputation for wrecking installs by pinning an ancient torch==1.13.1. This pack doesn't touch torch - it just needs a recent diffusers, which is a much smaller ask.
Gotchas
- VRAM is the real cost. The code moves the pipeline to CUDA and enables xformers, VAE tiling, and model CPU offload automatically, but the README is blunt that SDXL at high resolution can blow through memory. On 8GB, plan on slow offloads or stick to SD 1.5.
- Style IP-Adapter disables HiDiffusion. If you wire in
ip_ckpt+clip_vision(frommodels/photomakerandmodels/clip_vision) for the style branch, the code callsremove_hidiffusionon the model. You can't have both - style transfer and the resolution patch don't run at the same time. - It loads via diffusers, so your checkpoint needs to be something diffusers can reconstruct. Fancy merged or experimental formats may refuse to load.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| function_choice | COMBO | 2 options: txt2img, img2img | |
| ckpt_name | COMBO | 0 options: | |
| vae_id | COMBO | 1 options: none | |
| unet_model | COMBO | 1 options: none | |
| controlnet_model | COMBO | 1 options: none | |
| lora | COMBO | 1 options: none | |
| lora_scale | FLOAT | 0.80.1–1 | — |
| trigger_words | STRING | best quality | — |
| scheduler | COMBO | 19 options: DDIM, Euler, Euler a, DDPM, DPM++ 2M, DPM++ 2M Karras, +13 | |
| apply_window_attn | BOOLEAN | false | — |
| ip_ckpt | COMBO | 1 options: none | |
| clip_vision | COMBO | 1 options: none |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| pipe | HIDIF_MODEL | — |