DyPE for Flux2
Flux2 past 1024 without the twin-torsos — DyPE, the Flux2 edition
- model
- model
Flux2 is a flow-matching model with a positional quirk: it uses a 4-axis RoPE layout - index, height, width, and text. When you generate past its native resolution, the spatial axes go out of distribution and the model starts stitching repeated structure into your frame. DyPE for Flux2 is the sibling of the Qwen Image DyPE node, tuned for exactly that layout. The headline difference: it extrapolates only the height and width axes, and leaves the text axis static, so your prompt conditioning stays put while the canvas expands.
If you're coming from the Qwen version, the mental model transfers one-to-one. Early sampling keeps positions near the native training size so composition holds; later steps ramp the spatial grid outward so the model can lay down high-frequency detail on the full canvas. What changes is the wiring - Flux2's axis arrangement means a spatial-axis selector rather than a blanket extrapolation - and the noise-schedule defaults: base_shift is 2.02 and max_shift 2.35 here, versus 1.15/1.35 on Qwen, reflecting Flux2's own shift requirements.
Inputs that matter:
model- Flux2 checkpoint to patch.width/height- target render resolution, and they must match your latent.auto_detect- on by default, derives patch size and base resolution from the model;base_width/base_height(1024) are the fallback if it can't.method-yarn(default),ntk, orbase. Same trade-off as the Qwen node: YaRN for max sharpness, NTK if YaRN reads too jagged,baseto disable extrapolation for testing.enable_dype/dype_exponent- the ramp toggle and its aggression (higher = stays closer to native res longer).base_shift/max_shift- the Flux2-tuned shift pair (2.02 → 2.35).editing_strength(default 1.0) /editing_mode(adaptive) - for img2img and inpainting: lower the strength to keep original structure intact.
Output. One model, patched, ready to hand to the KSampler. Same as the Qwen node - a MODEL out, nothing else.
Install. Same pack, same path as every other node in it - ttulttul/ComfyUI-FlowMatching-Upscaler. ComfyUI Manager, search "ComfyUI-FlowMatching-Upscaler", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/ComfyUI-FlowMatching-Upscaler
No model downloads, no exotic deps (numpy, torch, einops, aiohttp - all already in a stock ComfyUI). Restart and it registers under model_patches/unet.
Gotchas. The obvious one: this is the Flux2 node, not the Qwen node, and they're not interchangeable - wrong node for your model, and the 4-axis patch won't match up. The subtler one is the resolution mismatch again: if the patched model is told one resolution while the latent is another, you get a pass that runs clean and still comes out subtly wrong. And budget for VRAM - native 4K on a flow transformer is a memory event, full stop. This node's whole job is letting you generate big natively; if you'd rather generate small and climb, the same pack's Flow Matching Progressive Upscaler is the other door, and they even stack - DyPE for composition at size, the upscaler for detail climbs.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Flux2 model to patch with DyPE. | |
| width | INT | 102416–16384 | Target output width in pixels. |
| height | INT | 102416–16384 | Target output height in pixels. |
| auto_detect | BOOLEAN | true | Automatically derive patch size and base resolution from the model when possible. |
| base_width | INT | 102416–16384 | Training width used by the base Flux2 model when auto detection fails. |
| base_height | INT | 102416–16384 | Training height used by the base Flux2 model when auto detection fails. |
| method | COMBO | yarn | Spatial RoPE extrapolation strategy. |
| enable_dype | BOOLEAN | true | Enable Dynamic Position Extrapolation scaling. |
| dype_exponent | FLOAT | 2.00–4 | Controls how strongly DyPE ramps across sampling timesteps. |
| base_shift | FLOAT | 2.020–10 | Baseline shift applied to the Flux2 noise schedule. |
| max_shift | FLOAT | 2.350–10 | Maximum shift applied when operating at the target resolution. |
| editing_strength | FLOAT | 1.000–1 | Scale DyPE while editing images (1.0 = full strength, 0.0 = disable DyPE scaling in edits). |
| editing_mode | COMBO | adaptive | Strategy for tapering DyPE during edits. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |