ComfyUI Node

DyPE for Flux2

Flux2 past 1024 without the twin-torsos — DyPE, the Flux2 edition

By ttulttul·Created 10 months ago·Updated 7 months ago· 62
DyPE for Flux2
  • model
  • model
width1024
height1024
auto_detecttrue
base_width1024
base_height1024
methodyarn
enable_dypetrue
dype_exponent2.0
base_shift2.02
max_shift2.35
editing_strength1.00
editing_modeadaptive

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, or base. Same trade-off as the Qwen node: YaRN for max sharpness, NTK if YaRN reads too jagged, base to 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.

Categorymodel_patches/unet

Inputs (13)

NameTypeDefaultDescription
modelMODELFlux2 model to patch with DyPE.
widthINT102416–16384Target output width in pixels.
heightINT102416–16384Target output height in pixels.
auto_detectBOOLEANtrueAutomatically derive patch size and base resolution from the model when possible.
base_widthINT102416–16384Training width used by the base Flux2 model when auto detection fails.
base_heightINT102416–16384Training height used by the base Flux2 model when auto detection fails.
methodCOMBOyarnSpatial RoPE extrapolation strategy.
enable_dypeBOOLEANtrueEnable Dynamic Position Extrapolation scaling.
dype_exponentFLOAT2.00–4Controls how strongly DyPE ramps across sampling timesteps.
base_shiftFLOAT2.020–10Baseline shift applied to the Flux2 noise schedule.
max_shiftFLOAT2.350–10Maximum shift applied when operating at the target resolution.
editing_strengthFLOAT1.000–1Scale DyPE while editing images (1.0 = full strength, 0.0 = disable DyPE scaling in edits).
editing_modeCOMBOadaptiveStrategy for tapering DyPE during edits.

Outputs (1)

NameTypeDescription
modelMODEL