ComfyUI Node

Flux.2 Untwist RoPE

Adds reference latents to a Flux/Flux.2 model and scales only reference image keys in single-stream attention according to RoPE frequency bands.

By xmarre·Created 3 months ago·Updated 3 months ago· 1
Flux.2 Untwist RoPE
  • model
  • reference_latent
  • model
high_scale_start0.25
high_scale_end0.75
low_scale_start1.00
low_scale_end1.40
beta2.00
start_percent0.00
end_percent1.00
start_single_block0
end_single_block999
reference_latents_methodindex
qk_adain_strength0.00
verbosefalse
Categorymodel_patches/Flux2 Untwisting RoPE

Inputs (14)

NameTypeDefaultDescription
modelMODEL
high_scale_startFLOAT0.25-4–8Scale for highest-frequency reference-key RoPE channels at the start of the active window. <1 reduces positional copying.
high_scale_endFLOAT0.75-4–8Scale for highest-frequency reference-key RoPE channels at the end of the active window.
low_scale_startFLOAT1.00-4–8Scale for lowest-frequency reference-key RoPE channels at the start of the active window.
low_scale_endFLOAT1.40-4–8Scale for lowest-frequency reference-key RoPE channels at the end of the active window. >1 increases global style/reference pull.
betaFLOAT2.000.01–32Polynomial interpolation exponent from high-frequency to low-frequency scales. Paper default is 2.
start_percentFLOAT0.000–1
end_percentFLOAT1.000–1
start_single_blockINT00–999
end_single_blockINT9990–999
reference_latents_methodCOMBOindexHow Flux positions appended reference latent tokens. index keeps the spatial grid aligned and differs only by image index; offset/uxo use spatial offsets.
qk_adain_strengthFLOAT0.000–1Optional StyleAligned-style AdaIN on target image Q/K token statistics. 0 preserves native Flux.2 behavior.
verboseBOOLEANfalse
reference_latentoptLATENTEncoded reference image latent. You may leave this unconnected if your conditioning already supplies ref_latents.

Outputs (1)

NameTypeDescription
modelMODEL