Nodes/Latent Tools/LTBlendLatent
ComfyUI Node

LTBlendLatent

Blend Two Latents the Way You'd Blend Images

By Machines-of-Disruption·Created about a year ago·Updated 8 months ago· 27
LTBlendLatent
  • latent1
  • latent2
  • LATENT
mode
ratio0.500
seed0

LTBlendLatent combines two latent tensors using any of eight blend modes. In this pack's world - where the whole game is controlling the starting noise - it's the "mix my noise patterns" node. Keep one seed, generate a Gaussian-noise latent and a uniform-noise latent, blend them at a ratio you dial, and hand the result to LTKSampler. You get images that live somewhere between two noise regimes instead of fully in either.

It also does the more classic latent trick: wire in the latents of two images you encoded and interpolate between them in latent space. That's real, and it's why people reach for a blend node at all - latent interpolation is one of those moves that just keeps working.

How it works

Element-wise math on the two tensors. The modes:

  • interpolate - latent1 * ratio + latent2 * (1 - ratio). The standard crossfade.
  • add, multiply - plain arithmetic.
  • max, min - per-element extremes.
  • abs_max, abs_min - pick whichever element has the larger/smaller absolute value (matters when signs differ, which noise latents do constantly).
  • sample - builds a random mask and picks per-element from either latent.

The inputs that matter

  • latent1, latent2 - the two LATENTs. They must be identical shapes.
  • mode - the 8-way dropdown above.
  • ratio - 0 to 1, and the tooltip is explicit: only used for sample and interpolate. In every other mode it's ignored, which trips people up when they expect a "strength."
  • seed - only used by sample, to make the random mask reproducible.

Where people get burned

Shape mismatch is a hard error - the node asserts both latents have the same shape, and since a LATENT is really a dict wrapping the tensor, wiring two latents of different resolutions dies immediately. Keep them generated at the same width/height.

The other gotcha is that sample seeds the global torch RNG, so it's sensitive to whatever else ran before it in the graph. If your sampled blend changes unexpectedly when unrelated things in the workflow change, that's why.

Installing it

Part of xl0's Latent Tools pack. ComfyUI Manager → search Latent Tools → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/xl0/latent-tools

Restart, and it's under LatentTools. The pack's only dependency is lovely-tensors (Manager handles it; manual installs may need pip install lovely-tensors). No models, no downloads - pure tensor math, so it's free to run.

CategoryLatentTools

Inputs (5)

NameTypeDefaultDescription
latent1LATENT
latent2LATENT
modeCOMBO8 options: interpolate, add, multiply, abs_max, abs_min, max, +2
ratioFLOAT0.5000–1Blend ratio (0.0 to 1.0), only used for mode=sample and mode=interpolate
seedINT00–18446744073709550000See of the random sampling (mode=sample

Outputs (1)

NameTypeDescription
LATENTLATENT