Nodes/ComfyUI Flux2 Untwisting RoPE/MiniMax H3 Untwist RoPE
ComfyUI Node

MiniMax H3 Untwist RoPE

Stop MiniMax H3 from copying your reference image frame-for-frame

By xmarre·Created 3 months ago·Updated 2 days ago· 4
MiniMax H3 Untwist RoPE
  • model
  • model
high_scale_start0.95
high_scale_end1.00
low_scale_start1.00
low_scale_end1.05
beta2.00
start_percent0.00
end_percent0.90
verbosefalse
reference_scopeimage_and_video
scale_temporal_axisfalse

You know the feeling: you feed MiniMax H3 a reference image hoping for style or character consistency, and it returns a frame-for-frame remake. Same pose, same composition, same camera. "Untwisting RoPE" is the training-free fix for exactly that, and this node is its MiniMax H3 implementation - the sibling of the pack's Flux.2 node, adapted for video.

It's the H3 half of ComfyUI-Untwisting-RoPE (xmarre), which implements a 2026 paper ("Untwisting RoPE: Frequency Control for Shared Attention in DiTs", arXiv:2602.05013). The idea: rotary position encoding splits into frequency bands, and high-frequency bands are what make attention copy reference structure - pose, layout - while low-frequency bands carry the looser "this image is about a red jacket" association. The node quietly turns down the high-frequency keys of your reference so H3 keeps the subject and mood without the tracing. No extra model downloads, no training, and nothing else in your pipeline changes.

How it actually works

H3 is a packed single-stream audio/video DiT - text, references, target audio and target video all live in one sequence. The node finds your references two ways: native identity from minimax_payload["refs"] and exact row ranges from the packed ref_img segments, then pairs them one-for-one. If the counts don't line up, it fails closed - no modulation, rather than touching the wrong rows.

Scaling happens after H3's fused RMSNorm + split-half RoPE and before attention, via an optimized_attention_override. Only the selected reference keys are scaled. Queries, values, text, target audio/video, and any audio reference stay untouched. H3's geometry (head_dim 128, t/h/w banks, 16 freqs per axis, a 32-channel unrotated tail) is handled for you - the tail always stays at 1.0, and the temporal t bank stays native unless you opt in.

The settings that matter

The defaults (high 0.95→1.00, low 1.00→1.05, beta 2.0, window 0→0.90) are deliberately restrained - these are empirical H3 starting values, not the paper's Flux numbers. The ones you'll actually touch:

  • high_scale_start / high_scale_end - the high-frequency (pose-copying) key scale. Moving it toward 1.0 relaxes the intervention; lowering it reduces pose/composition copying further.
  • low_scale_end - the low-frequency (semantic) gain. Creep it down if the reference pull gets too global.
  • end_percent - a real hard cutoff. It reads the actual sampler schedule, so at 0.90 the last ~10% of denoising is genuinely native attention.
  • reference_scope - image_and_video (default) hits ordinary image and pure-video refs; image_only restricts to images; all_visual_including_continuum is the experimental opt-in that also touches mixed video+audio refs and H3 Continuum carry-over context.
  • scale_temporal_axis - experimental. Keep it off until your spatial-only config is known-good.

The single output is a patched model, wired straight into your sampler in place of the vanilla H3 model.

Installing

ComfyUI Manager, searching "Untwisting RoPE", or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-Flux.2-Untwisting-RoPE

Then restart ComfyUI. That's the whole install - the pack adds no Python dependencies beyond a working ComfyUI/PyTorch. What you do need is ComfyUI recent enough to ship native H3 support plus the actual H3 weights; this node patches ComfyUI's native H3, it doesn't bring its own.

Gotchas

The pack's own diagnostics point the way: if a new artifact appears, set all four scale endpoints to 1.0 - that's an exact model-patch no-op and a clean control. If your reference isn't being modulated at all, check the scope (video_audio refs and Continuum context are excluded by default on purpose) rather than assuming a bug. Community reports on the Untwisting pack generally include some "Getting this error" threads, usually ComfyUI-version drift - and with H3's native layout still evolving, keep ComfyUI updated if the ref-to-row pairing complains. And one workflow tip that carries over from the Flux side: keep your reference dimensions in sync with your generation, because geometry drift is what makes reference attention misbehave.

Tune one knob at a time. The defaults get you most of the way.

Categorymodel_patches/Untwisting RoPE

Inputs (11)

NameTypeDefaultDescription
modelMODEL
high_scale_startFLOAT0.95-4–8Highest-frequency H3 reference-key scale at the start of the active window.
high_scale_endFLOAT1.00-4–8Highest-frequency H3 reference-key scale at the end of the active window.
low_scale_startFLOAT1.00-4–8Lowest-frequency H3 reference-key scale at the start of the active window.
low_scale_endFLOAT1.05-4–8Lowest-frequency H3 reference-key scale at the end of the active window.
betaFLOAT2.000.01–32Polynomial interpolation exponent across each scaled H3 RoPE frequency bank. Paper default is 2.
start_percentFLOAT0.000–1Start of the active denoising-progress window. 0 is the first sampling step.
end_percentFLOAT0.900–1End of the active denoising-progress window. Progress is derived from the actual sampler schedule so the final 10% is genuinely native.
verboseBOOLEANfalse
reference_scopeoptCOMBOimage_and_videoWhich native visual references may be untwisted. image_and_video includes ordinary image and pure-video refs only. image_only restricts modulation to image refs. all_visual_including_continuum also includes video+audio and Continuum context and is experimental.
scale_temporal_axisoptBOOLEANfalseExperimental. Also scale H3's temporal RoPE bank. Off keeps the H3 t bank native and applies the frequency schedule only to H/W; this is an H3 runtime default rather than a paper-derived temporal policy.

Outputs (1)

NameTypeDescription
modelMODEL