Chroma RoPE Patch
Push Chroma past its 1MP ceiling without retraining
- model
- Patched Model
Chroma1-HD is a 1024×1024 model. Nudge it to 1536 or 2048 and the usual Flux-family failure mode shows up: repeated tiles, doubled faces, anatomy that quietly repositions itself. This node is the "make the model actually understand where things are at a bigger canvas size" patch - it rewrites how Chroma (and any FLUX-architecture model) encodes position, so you can generate high-res natively instead of leaning entirely on upscalers. Zero retraining, zero model downloads, just a patched MODEL that plugs into your existing KSampler.
What it actually does
Flux-family models use rotary position embeddings (RoPE): each token gets rotated by frequency-scaled angles that encode where in the image it sits. Train at 1MP, then render at 4MP, and the position indices grow well past what the model ever saw. Naive extrapolation means the attention heads can't tell "far left" from "far right" reliably - that's your tiling and cloned limbs.
Chroma RoPE Patch swaps the model's position-embedding module for a flexible one and applies extrapolation tricks on top. Peeking at the source, apply_dype_to_flux() clones your model, pulls the existing pe_embedder out of the diffusion model, and patches in a replacement (1D RoPE for the time axis, 2D RoPE for the spatial H/W axes). It also wraps the UNet forward pass so the current noise level gets fed into the embedder every step - that's the "DyPE" part, timestep-dependent frequency modulation.
This pack is a fork of wildminder's ComfyUI-DyPE, extended with more RoPE methods. The DyPE technique itself (from the paper that sparked the "native 4K generation" buzz in late 2025) is genuinely well-regarded for coherence at high resolution - the catch is that coherence, not pixel count, is the hard problem.
The inputs that matter
- method - the extrapolation strategy.
yarn_freq_stretchis the default and the author's recommendation; it non-linearly stretches the frequency space so high-frequency (local detail) relationships survive while low frequencies extrapolate.yarn,dynamic_ntk,ntk,base(no extrapolation) round out the menu. - yarn_ratio - the main "how hard do I push" knob. Higher = more aggressive extrapolation. This is what you tweak when you go from 1536 to 2048.
- rope_percentage - p-RoPE: the fraction of dimensions that keep any positional info. 1.0 = standard RoPE; 0.0 = NoPE (pure semantic, position-blind). Fun fact: the README admits p-RoPE is "kinda not done right," so treat it as experimental.
- dype - on by default. Turn it off and you lose the timestep modulation that keeps early denoising coherent.
- yarn_ramp_type (how interpolated vs. extrapolated frequencies blend:
sqrtdefault,sigmoid,pow2,linear), plus advanced knobs like yarn_beta_fast/yarn_beta_slow (frequency cutoffs), timestep_period_min/max, and attn_ratio.
That max_pe_length default of 64 isn't arbitrary: 1024px ÷ 16 (latent downscale) = 64 position steps per axis. It's the length the model trained at. Leave it unless you know better.
Output: a single Patched Model that feeds straight into your KSampler, same as any model patch.
Installing it
No dependencies beyond torch and no model files to fetch - this is a pure code patch.
cd ComfyUI/custom_nodes
git clone https://github.com/Clybius/ComfyUI-Chroma-RoPE.git
Then restart ComfyUI. Or, easier: ComfyUI Manager → Install Custom Nodes → search ComfyUI-Chroma-RoPE. One gotcha worth knowing: this pack ships as a new-style ComfyUI extension using comfy_api - if the node doesn't show up, update ComfyUI first, don't blame the pack.
Where people get burned
The node hard-checks that your model has a pe_embedder and raises "This node is only compatible with Chroma/FLUX models" otherwise. That's not a bug - SD1.5/SDXL don't use RoPE this way, and the README flatly says non-FLUX architectures aren't supported.
Second, at native resolution this node does nothing visible. It only matters past training scale. If you're testing at 1024×1024 and "nothing changed," that's the feature working.
Third, the timestep/shift-type knobs are finicky. In r/comfyui threads about DyPE patches, users have reported base_shift/max_shift-style parameters making zero difference - partly because the effect is subtle until you're well past native res, partly because these wrappers are new. Change one thing at a time, keep dype on, and always test at the resolution you actually want. Expect to add sampling steps at 4K; Chroma is already slow, and it wants verbose prompts to stay coherent, so this node multiplies the cost of your usual mistakes rather than forgiving them.
Honest take: for a one-click 4K image, upscaling (SeedVR2 or a good 4x model) is still the more reliable play. Where this node earns its keep is when you want genuine 2–4MP composition - consistent faces and geometry that upscalers can't invent. It's a niche tool, but it's the right niche.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | The Chroma model to patch with DyPE. | |
| method | COMBO | yarn_freq_stretch | Position encoding extrapolation method (YARN Frequency Stretch recommended). |
| rope_percentage | FLOAT | 1.000–1 | p-RoPE: Proportion of dimensions to apply RoPE. 1.0=standard RoPE, 0.75=truncate lowest 25%, 0.0=NoPE (pure semantic). Applied on top of selected method. |
| yarn_ramp_type | COMBO | sqrt | YaRN ramp function type for frequency blending: linear, sigmoid (smooth transition), pow2 (aggressive), or sqrt (conservative). |
| dypeopt | BOOLEAN | true | Enable Dynamic Position Extrapolation (DyPE) with timestep-dependent frequency modulation. Provides better high-resolution coherence. |
| max_pe_lengthopt | FLOAT | 641–1024 | Advanced: Max shift for the noise schedule (mu) at high resolutions. Default is 64. |
| yarn_ratioopt | FLOAT | 1.000.01–10 | YaRN scaling ratio multiplier. Higher values increase extrapolation strength for high-resolution generation. |
| yarn_beta_fastopt | FLOAT | 321–1024 | YaRN beta_fast parameter: rotation cutoff for high-frequency dimensions (32=default, lower=more extrapolation). |
| yarn_beta_slowopt | FLOAT | 21–1024 | YaRN beta_slow parameter: rotation cutoff for low-frequency dimensions (2=default, higher=less extrapolation). |
| timestep_modulationopt | BOOLEAN | false | Enable timestep-dependent theta scaling. Modulates frequency periods based on diffusion noise level. |
| timestep_period_minopt | FLOAT | 10001–1000000 | Theta period at maximum noise (t=1.0). Lower values = higher frequencies during early denoising. |
| timestep_period_maxopt | FLOAT | 100001–100000000 | Theta period at minimum noise (t=0.0). Higher values = lower frequencies during final refinement. |
| attn_ratioopt | FLOAT | 1.0000–10 | Attention scaling factor. Applies attention temperature scaling to RoPE embeddings (1.0=normal). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Patched Model | MODEL | The Chroma model patched with DyPE. |