Qwen Image DyPE — Ultra High Resolution — by wallen0322
Generate Qwen images at 4K natively — this is the DyPE rope-scaling node
- model
- model
- width
- height
The old religion was: generate at ~1MP and upscale. It still works. But in late 2025 a paper called DyPE - Dynamic Position Extrapolation (arXiv 2510.20766) made native high-resolution generation real for diffusion transformers, and the community reaction was basically "wait, this is a much bigger deal than anyone's saying." QI_DyPE from wallen0322's QI pack is that trick, applied to Qwen-Image: it patches your loaded model so the attention position embeddings stretch dynamically as generation progresses, letting you run the sampler directly at 2K, 4K, even 8K instead of upscaling afterwards.
What DyPE actually does
Normally when you try to sample a DiT way past its training resolution, the position encoding extrapolates badly and you get repeating structures, double heads, and mush. DyPE fixes it by making the position-encoding scale dynamic per timestep. Early in the schedule the model runs at a high rope scale, so it lays down the large-scale composition for your big canvas. As generation proceeds, the scale eases back toward base. Result: coherent structure at native resolution instead of tiled artifacts.
The mechanism in this node, from the source: it clones the model, stores the original forward, and wraps it so that at every step it computes scale = base + (target·(t_norm^exponent) − base)·(1 − t_norm) and calls apply_rope_scaling(scale, method). The exponent (default 2) is the curve shape - how aggressively the scale falls off through the schedule.
The inputs that matter
- preset -
1Kup to8K (7680×4320), plus4K Wide (4096×2304)and4K Portrait (2304×4096). Pick the shape, not just the pixel count; these carry tuned exponents (2K runs at 1.5, 8K at 2.5). - mode -
T2IorEdit.Editbumps the exponent via the optionalpreserve_detailslider (default 0.8) so edits keep their geometry at high res, which matters because Qwen-Edit is the drift-prone one. - custom_width / custom_height - with preset set to
Custom, for any size between 512 and 8192 (64-step). - method -
yarn(default) /ntk/base- which rope-scaling scheme the patch applies. - enable_dype - flip off and the node just hands the model back unchanged; handy for an A/B test to see what the scaling is actually buying you.
Outputs: the patched model, plus width and height integers - wire those into your EmptyLatent so the latent size and the rope scale can't disagree.
Installing
Same pack as the other QI nodes - Manager search ComfyUI-QI-QwenEditSafe, or:
cd ComfyUI/custom_nodes
git clone https://github.com/wallen0322/ComfyUI-QI-QwenEditSafe
Restart. No dependencies beyond the pack, but you do need a Qwen-Image model loaded and a plan for the VRAM (see below).
Gotchas - be honest about the physics
- This node adds zero VRAM. It changes how the rope is scaled, not how much memory the sampler needs. A 20B Qwen at 8K native is a data-center job; on a consumer card you're still looking at a quantized model (GGUF or the Nunchaku INT4 loader) and you'll hit OOM before 4K on most setups. DyPE is what you do when you can afford the canvas.
- Native isn't automatically better than upscaling. The community debate is real: coherent detail matters more than raw pixels, and a 1080p image that's coherent beats a 4K one with a six-fingered hand. For portraits especially, a good upscale pipeline is often the smarter use of your GPU.
- The pack's
Editmode is the interesting case - high-res edits are where Qwen's offset problem gets worse, and the boosted exponent is aimed at exactly that. If that's your goal, this is the node worth fighting for.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| mode | COMBO | T2I | 2 options: T2I, Edit |
| preset | COMBO | 2K (2048×2048) | 8 options: Custom, 1K (1024×1024), 2K (2048×2048), 3K (3072×3072), 4K (4096×4096), 4K Wide (4096×2304), +2 |
| custom_width | INT | 2048512–8192 | — |
| custom_height | INT | 2048512–8192 | — |
| method | COMBO | yarn | 3 options: yarn, ntk, base |
| enable_dype | BOOLEAN | true | — |
| dype_exponent | FLOAT | 2.00.5–4 | — |
| preserve_detailopt | FLOAT | 0.800–1 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| width | INT | — |
| height | INT | — |