I-Max
I-Max doesn't patch your sampler, it replaces it — and that's how 4K FLUX stops falling apart
- model
- vae
- positive
- negative
- latent_image
- High-Res Latent
Every other node in this pack patches the model. This one takes the wheel.
If you've used DyPE or SEGA, you know the drill: node after the loader, set width/height, keep your KSampler. I-Max is the odd one out. It sits exactly where your KSampler would sit, runs sampling itself - twice - and hands you a finished latent to decode. No sampler node, no scheduler node, no ModelSamplingFlux.
Why bother? Because FLUX is a roughly 1-megapixel model and Z-Image taps out around 1–2MP natively. Ask either for 2048² or 4096² and you get the classic high-res disaster set: tiled textures, doubled faces, limbs that quietly multiply. The old answer is hi-res fix - generate small, upscale, low-denoise second pass - and it still works. I-Max is the other answer: keep generating from noise at the big size, and give the model a low-resolution version of its own output to stay anchored to.
Two passes, one guidance latent
Pass A is a cheap low-resolution run. The exact size is derived from your target geometry, preserving the target's aspect ratio at roughly native pixel area - a 2048×1152 target doesn't get squashed into a square 1024×1024 guidance image. Its final clean prediction then becomes a fixed guidance latent for the whole of pass B. That upsampling happens in latent space, not through the VAE; re-encoding a decoded image distorts the latent statistics, which is why you'd previously see "noisy / muted, needs more steps" output.
Pass B runs at your target resolution. Each of its clean predictions gets pulled toward the Haar low-pass of that guidance - that's the Projected Flow correction, and its strength follows a schedule (cosine decay by default) so the anchor dominates early structure and fades out as fine detail is synthesized. Alongside that, an inference toolkit compensates for the resolution gap: an NTK-aware RoPE base multiplier, attention temperature scaled by sequence length, and text tokens duplicated once per native 1024px tile so the image/text token ratio stays in distribution.
I-Max owns both sigma schedules outright (time_shift_low 3.0, time_shift_high 6.0) - no model_sampling patch involved, and the SNR rebalance between the passes is yours to tune.
The inputs you'll actually touch
latent_image- an empty latent at the target size, e.g.EmptySD3LatentImageat 2048×2048. Z-Image shares Flux's 16-channel, 8× latent format, so the same node works. A content latent plusdenoise< 1 gives you img2img at the target size.steps_low/steps_high- 30 / 20 by paper default. The low pass is cheap; the high pass is where your GPU time goes.noise_seed- one generator, shared: pass A's start noise, then pass B's. Same seed, same image.cfg- leave at 1.0 on FLUX-dev. Theguidance_low(3.5) /guidance_high(5.0) embeds do the guidance work, and those two are FLUX-only - Z-Image is guidance-distilled, so they're ignored.
Everything else defaults sanely: ntk_factor 10 (the paper's Flux.1-dev value, 1.0 = plain RoPE), dwt_level 1, low_res_scale 1.0, proportional_attention and text_duplication on. On Z-Image Turbo, the one input you must change is guidance_strength - drop it to 0.25–0.5, because a distilled checkpoint can't re-sharpen after a full-strength correction, and you'll get swirls and flat-region noise instead. Step and shift tweaks won't fix that.
Output is a single High-Res Latent. Wire it into VAEDecode like you would a KSampler's.
Install
Via ComfyUI Manager, search ComfyUI-DyPE, or manually:
cd ComfyUI/custom_nodes/
git clone https://github.com/wildminder/ComfyUI-DyPE.git
Restart. That's genuinely it - the pack's requirements.txt is torch and numpy, both already there, and there are no model files to download. It does use ComfyUI's newer V3 schema (requires-comfyui >= 0.28.0), so on an ancient install, update core first. Nodes live under WMNodes/image.
Where it goes wrong
The model gate is real. I-Max accepts FLUX-family and Z-Image rectified-flow models only, and rejects everything else with an error rather than silently degrading. Qwen-Image and Anima users should use HiFlow or DyPE. Nunchaku is out too - its RoPE routes through model.pos_embed, so there's no seam for the NTK swap. Z-Image has its own guards: the multi-frame MingImage variant, the pixel-space variant (no VAE round trip to work on) and plain Lumina2 (trained at a different RoPE base) are each refused by name.
Don't stack RoPE patches. If a DyPE/SEGA/SPA node is already installed upstream, I-Max logs a takeover warning: its static NTK omega replaces that node's per-step dynamic scaling for the high-pass. Chain one scaling method, not two.
Cost is the honest complaint. You're running 30 + 20 steps and the second 20 are at 4K, so this is not a speed win - it's the price of native high-res from noise. The community's scepticism about native 4K generation is well earned: it's heavy, and artifacts don't vanish at 16 megapixels just because you anchored the structure. Which is precisely why the pack's own advice is to experiment rather than look for the magic setting.
Two smaller traps: a non-empty latent with denoise at 1.0 warns you that your input is being ignored (pass B restarts from pure noise), and the node declares itself uncacheable on purpose, so it reruns every queue - don't go hunting for a caching bug.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The FLUX-family flow model. | |
| vae | VAE | VAE — used for the latent/pixel geometry (downscale ratio); the guidance latent itself is built in latent space. | |
| positive | CONDITIONING | Positive conditioning. | |
| negative | CONDITIONING | Negative conditioning. | |
| latent_image | LATENT | Latent at the TARGET resolution (e.g. EmptySD3LatentImage at the desired output size). An empty latent is pure txt2img; a content latent + denoise < 1 is img2img. | |
| noise_seed | INT | 00–4294967295 | One shared generator: pass A's start noise, then pass B's img2img noise — same seed, same result (modulo the VAE encode sampling). |
| denoise | FLOAT | 1.000.05–1 | Img2img strength for PASS B only (KSampler convention); pass A always starts from pure noise. Ignored for an empty latent — that always runs the full schedule. |
| cfg | FLOAT | 1.00–20 | Classifier-free guidance for BOTH passes. FLUX-dev: leave at 1.0 — the guidance embeds below do the work. CFG is auto-skipped when the negative carries no tokens. |
| steps_low | INT | 301–200 | Pass A (low-resolution guidance) steps — paper: 30. |
| steps_high | INT | 201–200 | Pass B (target resolution) steps — paper: 20. |
| guidance_low | FLOAT | 3.50–20 | FLUX guidance embed written into a copy of the conditioning for pass A (paper/gradio 3.5). 0.0 keeps whatever a chained FluxGuidance set. |
| guidance_high | FLOAT | 5.00–20 | FLUX guidance embed for pass B (gradio 5.0). 0.0 keeps whatever a chained FluxGuidance set. |
| time_shift_low | FLOAT | 3.000.01–10 | Static flow shift of pass A's sigma schedule (paper: 3.0) — I-Max owns both schedules, no model_sampling patch is involved. |
| time_shift_high | FLOAT | 6.000.01–10 | Static flow shift of pass B's schedule (paper: 6.0) — the SNR re-balance between the passes. |
| ntk_factor | FLOAT | 10.01–100 | NTK-aware RoPE base multiplier for the high-resolution pass (paper: 10 for Flux.1-dev). 1.0 = plain RoPE. |
| dwt_level | INT | 11–8 | Haar low-pass level of the guidance projection (paper: 1). Higher = coarser guidance detail. |
| guidance_schedule | COMBO | cosine_decay | Projected-Flow guidance schedule (paper §2.2): cosine_decay is the README/gradio default; disable runs pass B as plain Euler. |
| guidance_strength | FLOAT | 1.000–2 | Linear scale on the Projected-Flow correction (1.0 = the paper's unscaled pull; 0 = disable). Distilled checkpoints (Z-Image Turbo) hallucinate swirls/noise at extrapolated targets at full strength — use 0.25-0.5 there. |
| proportional_attention | BOOLEAN | true | Scale the attention temperature with the joint sequence length (paper §2.3). Clamped to a no-op at/below the native 1024 px. |
| text_duplication | BOOLEAN | true | Duplicate the text tokens per native 1024 px tile so the image/text token ratio stays in distribution (paper §2.3). No-op at/below 1024 px. |
| low_res_scale | FLOAT | 1.000.25–2 | Scales the LOW-RES pass AREA (1.0 = the paper's native-area guidance; 0.5 halves it). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| High-Res Latent | LATENT | — |