ComfyUI Node

Crossover

Mixing models by frequency — keep the texture of one, the structure of the other

By ljleb·Created 3 years ago·Updated about a month ago· 101
Crossover
  • a (delta|param|weight)
  • b (delta|param|weight)
  • alpha (0.5)
  • tilt (0.0)
  • recipe
merge_checkpointingfalse

Most merges are weighted sums - every weight gets the same blend ratio, and you hope the mixture keeps the good parts. Crossover Mecha Recipe does something genuinely different: it blends A and B in the frequency domain. High-frequency components (the fine detail, the texture) can come from one model while low-frequency components (the overall structure, the composition) come from the other. Same alpha, but the math splits the merge by what the weights actually encode instead of averaging blindly.

This is one of the more distinctive methods in the Mecha pack, and the kind of thing you'd never get out of the merge tab of a classic UI.

How it works

Under the hood (in sd-mecha's crossover method): each tensor is transformed with an FFT, a frequency-domain filter is built, the two spectra are blended per-frequency, and the result is inverse-transformed back. The filter's cutoff is controlled by alpha, and tilt rotates the cutoff plane.

Inputs that matter:

  • a (delta|param|weight) and b (delta|param|weight) - the two models (or deltas) you're crossing.
  • alpha (0.5) - the blend point, as a MECHA_RECIPE. 0 = all A, 1 = all B, but unlike a weighted sum, how it mixes depends on frequency, not just ratio.
  • tilt (0.0) - rotates the frequency cutoff. 0 is a straight low/high split; as tilt approaches 1.0 the method degenerates toward a plain lerp (a weighted sum). Between those, you get a directional split you can use to make the transition asymmetric.
  • merge_checkpointing - the usual cache toggle.

Output: one recipe (MECHA_RECIPE).

The feel of it

The mental model that works: if model A is a "style" model and model B is a "structure" model, alpha near 0.5 with a sensible tilt keeps A's structural skeleton and B's fine texture (or vice versa) instead of producing the generic "average of both" look that plain interpolation gives. It's fiddlier than a weighted sum - you'll spend a run or two just feeling out alpha/tilt - but for merges that keep losing detail, it's often the only method that doesn't.

Install & gotchas

ComfyUI Manager → search mechaMecha Merge Node Pack, or:

cd ComfyUI/custom_nodes
git clone https://github.com/ljleb/comfy-mecha.git
pip install -r comfy-mecha/requirements.txt

Restart; only dependency is sd-mecha==1.1.7.

Two things to know before you burn time: alpha outside [0, 1] is rejected by the filter code (it raises rather than silently misbehaving - good news, since the failure mode would be a weird merge), and this is slower than a weighted sum because of the FFT round-trips on every tensor. On big models the speed difference is real but not painful - the pack still merges key-by-key to keep memory flat. If you just want a quick blend, use Weighted Sum; if you want a blend that respects detail vs. structure, this is the one.

Categorymecha

Inputs (5)

NameTypeDefaultDescription
a (delta|param|weight)MECHA_RECIPE
b (delta|param|weight)MECHA_RECIPE
alpha (0.5)optMECHA_RECIPE0.5
tilt (0.0)optMECHA_RECIPE0
merge_checkpointingoptBOOLEANfalseSpeeds up an entire branch of a merge graph that does not change often in exchange of memory. - true: store the first output of this recipe node on cpu memory in fp16. On subsequent workflow executions, as long as the inputs do not change, the cached keys are returned after being cast to the original device and dtype. - false: do not store the output. The recipe and its inputs will re-execute on subsequent workflow executions. Note that the memory used to checkpoint the output is distinct from the cache feature. In general, you probably want to either use this *or* a cache unit, but not both at the same time because the memory adds up. The difference between merge checkpointing and cache is that merge checkpointing completely re-merges from scratch if any input changes. Merge checkpointing is also generally much faster than cache in the fast path.

Outputs (1)

NameTypeDescription
recipeMECHA_RECIPE