DyPE
Push Flux, Qwen and Z-Image past their native resolution
- model
- Patched Model
Every diffusion model has a resolution it was trained on - usually around a megapixel, so 1024x1024 for Flux and Z-Image. Ask it for a lot more than that in one pass and it falls apart in a very specific way: repeated patterns, a second head, cloned fingers, that "too-strong-JPEG" mush when a body gets small in the frame. The usual fix is to generate at native size and then upscale (hires fix, ControlNet Tile, SeedVR2). DyPE takes the other road. It lets the model natively render at 4K and beyond in a single pass, coherently, without the tiling breakdown.
That's the pitch, and it's a genuinely different tool from an upscaler. An upscaler takes a finished small image and adds pixels or invents detail. DyPE changes what the model can draw in the first place.
How it actually works
The trick is in the positional encoding. Diffusion transformers use RoPE (rotary position embeddings) to know where each patch sits in the image, and those embeddings are calibrated for the training resolution. Push way past it and the position math goes out of range - that's the real source of the repeats and structural drift, not a lack of detail.
DyPE ("Dynamic Position Extrapolation") is a training-free patch that rescales those position embeddings dynamically at every denoising step. Diffusion resolves an image coarse-to-fine - big shapes early, fine texture late - so DyPE leans on low-frequency (structure) handling in the early steps and shifts toward high-frequency (detail) as sampling progresses. It costs nothing at inference: no extra steps, no extra passes, it just retunes the encodings on the fly.
One honest caveat, straight from the README: even with DyPE you're asking a ~1-megapixel-trained model to paint 16 megapixels at 4096x4096. It's dramatically better than raw, but it's not magic - expect the occasional artifact at the extreme end.
The node, and the inputs that matter
It's a single node under model_patches/unet. Drop it between your model loader and your KSampler: loader → DyPE → KSampler. It outputs one thing, a Patched Model (MODEL), which is your original model with the positional trick baked in - it doesn't touch CLIP or the VAE. The name says "DyPE for FLUX," but that undersells it: model_type also covers Nunchaku (quantized Flux), Qwen Image, and Z-Image (Lumina 2). Leave model_type on auto and it detects the architecture for you.
The handful you'll actually set:
width/height- the big one. Set these to match your Empty Latent Image exactly. This is what tells DyPE how far past native you're pushing; if they disagree with your actual canvas, the scaling is calibrated for the wrong target.base_resolution- the model's native size.1024for Flux and Z-Image,1328for Qwen.method- defaults tovision_yarn, which handles odd aspect ratios best and is the right starting point.yarnis the classic version (can stretch geometry at extreme ratios),ntkis stable but softer,baseis off.dype_exponent- your main quality knob.1.0for 2K–3K,2.0for 4K+, and3.0–4.0if you hit speckle noise (below).
dype_scale, enable_dype, yarn_alt_scaling, dype_start_sigma, base_shift and max_shift are all exposed too, but the defaults are sane - leave them alone until you have a reason.
Installing it
Easiest path is ComfyUI Manager: search ComfyUI-DyPE and hit Install. Manually, drop into your custom_nodes folder and clone:
cd ComfyUI/custom_nodes && git clone https://github.com/wildminder/ComfyUI-DyPE.git
Then restart ComfyUI. That's the whole thing - the README is explicit that there are no extra dependencies to pip-install and no model files to download. For a high-res node that's a refreshingly clean install.
Where people get tripped up
- Speckle noise at 4K+. Fine areas like hair and eyes can pick up high-frequency grain - a side effect of stretching attention past its limits. Raise
dype_exponentto3.0–4.0, or run a smoothing/detailer LoRA. - width/height not matching the latent. The single most common self-inflicted wound. If the node's dimensions don't equal your Empty Latent Image, you get worse results than DyPE off. Keep them in sync.
- Z-Image needs
vision_yarnorntk. Z-Image uses a very low RoPE base frequency, and standardyarncan produce artifacts on it. The node already force-enables isotropic scaling for Z-Image to stop vertical stretching, but pick one of those two methods. - There's no magic preset. The README says it and it's true - the right
methodanddype_exponentshift with your prompt and target resolution. Budget a few test gens.
Last thing worth knowing: DyPE and upscaling aren't rivals, they stack. The pattern that shows up in high-res pipelines is DyPE for a coherent large base pass, then a generative upscaler like SeedVR2 for final detail - that's how people reach absurd resolutions like 8K–16K without the whole thing dissolving into repeats. DyPE handles coherence at scale; the upscaler handles crispness.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The model to patch with DyPE. | |
| width | INT | 102416–8192 | Target image width. Must match the width of your empty latent. |
| height | INT | 102416–8192 | Target image height. Must match the height of your empty latent. |
| model_type | COMBO | auto | Specify the model architecture. 'auto' usually works |
| method | COMBO | vision_yarn | Position encoding extrapolation method. |
| yarn_alt_scaling | BOOLEAN | false | [YARN Only] Alternate scaling for ultra-high resolutions. Not used for 'vision_yarn'. |
| enable_dype | BOOLEAN | true | Enable or disable DyPE |
| base_resolution | INT | 1024256–4096 | The native training resolution. |
| dype_start_sigma | FLOAT | 1.000–1 | When to start decaying the scaling effect (1.0 = Start, 0.5 = 50% through generation). |
| dype_scaleopt | FLOAT | 2.00–8 | Controls DyPE magnitude (λs). Default is 2.0. |
| dype_exponentopt | FLOAT | 2.00–1000 | Controls DyPE decay speed (λt). Higher = Faster decay. 2.0=Quadratic. |
| base_shiftopt | FLOAT | 0.500–10 | Advanced: Base shift for the noise schedule (mu). |
| max_shiftopt | FLOAT | 1.150–10 | Advanced: Max shift for the noise schedule (mu) at high resolutions. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Patched Model | MODEL | The model patched with DyPE. |