HiDiffusion SDXL
Generate 2048px-plus SDXL images directly, without the duplicated subjects
- image_out
SDXL was trained at 1024×1024, and every pixel past that is where the fun dies: stretched limbs, doubled faces, subjects sprouting a second head at the edge of frame. The usual answer is a two-pass hires fix or a tiled upscale. This node is a third path - it patches a Megvii research technique called HiDiffusion onto an SDXL checkpoint so it can paint natively at 2048, 3072, even 4096 pixels on the long side, no second denoising pass required. The pack's own sample is a 4096×2304 landscape.
It's the flagship of Stefano Flore's ("AI Wiz Art") HiDiffusion pack, and it's the only one of the four nodes that lets you point at your own locally downloaded checkpoint instead of auto-downloading a stock model.
What it actually does
HiDiffusion (the Megvii paper, late 2023) attacks the two failure modes of high-res generation. First, RA-UNet: the UNet's downsamplers and upsamplers are swapped for "resolution-aware" versions that adapt their feature maps to the actual canvas size, so the model's receptive field stays sane when the image is huge. Second, MSW-MSA: the global self-attention - the layer that eats memory and time quadratically as resolution climbs - is replaced with shifted-window attention that works on local patches. You get the quality and a speedup, which is why the paper's marketing was "one line of code for 2K/4K."
The node hides all of that behind one panel. Pick a checkpoint, type your prompt, hit generate. The whole diffusers pipeline runs inside the node - this is not wired into a Load Checkpoint / KSampler graph. That's the trade: dead simple, but you lose ComfyUI's modularity. If you want HiDiffusion bolted onto your normal graph instead, there are other packs for that.
The inputs that matter
The important stuff:
- ckpt_name - any SDXL
.safetensorsfrom yourComfyUI/models/checkpointsfolder. This is the whole appeal over the other nodes in the pack. - width / height - default 2048×2048, but go wild. Every doubling of both roughly quadruples VRAM pressure, so keep an eye on that.
- apply_raunet and apply_window_attn - the two HiDiffusion mechanisms, both on by default. Turn
apply_raunetoff and you're back to ordinary SDXL struggling at high res. - optimizations - on by default; enables xformers attention, model CPU offload, and VAE tiling. This is what lets a 2048 render fit on consumer cards. Leave it on unless you're chasing speed.
- steps / guidance_scale / scheduler - the SDXL node is the only one with real sampler control: 17 schedulers (DDIM, DPM++ 2M, Euler, UniPC…). Default 50 steps / CFG 7.5 is a sane start.
eta (default 1.0) only matters for DDIM. seed is self-explanatory. The lone output is image_out (an IMAGE), which you wire into a SaveImage or any downstream node.
One genuinely useful tip from the community: at extreme sizes you may need to crank CFG well past 7.5 for coherent composition - a redditor pushing 2048+ reported running 20.
Install
Easiest via ComfyUI Manager - search "ComfyUI HiDiffusion". Or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/florestefano1975/ComfyUI-HiDiffusion
Restart ComfyUI. Drop an SDXL checkpoint in ComfyUI/models/checkpoints and you're set.
Where people get burned
The README is unusually honest: the pack is under development, users have reported bugs and crashes, and the author removed requirements.txt deliberately to avoid dependency conflicts. That means nothing auto-installs. If the nodes fail to load, read the console error and pip install the missing piece manually - the code hard-depends on diffusers, transformers, and xformers (every node calls xformers attention unconditionally). xformers is the fiddly one: it must match your CUDA/PyTorch version.
Also manage expectations: this pack peaked in April–May 2024 and hasn't been meaningfully maintained since. It still works on a current ComfyUI, but treat it as a fun experiment for one-off big renders, not a daily-driver sampler.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| ckpt_name | COMBO | 0 options: | |
| apply_raunet | BOOLEAN | true | — |
| apply_window_attn | BOOLEAN | true | — |
| optimizations | BOOLEAN | true | — |
| positive_prompt | STRING | Standing tall amidst the ruins, a stone golem awakens, vines and flowers sprouting from the crevices in its body. | — |
| negative_prompt | STRING | blurry, ugly, duplicate, poorly drawn face, deformed, mosaic, artifacts, bad limbs | — |
| steps | INT | 501–200 | — |
| guidance_scale | FLOAT | 7.51–99 | — |
| eta | FLOAT | 1.000–1 | — |
| scheduler | COMBO | 17 options: DDIM, DPM++ 2M, DPM++ 2M Karras, DPM++ 2M SDE, DPM++ 2M SDE Karras, DPM++ SDE, +11 | |
| width | INT | 20480–9999999 | — |
| height | INT | 20480–9999999 | — |
| seed | INT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image_out | IMAGE | — |