Nodes/ComfyUI-bleh/BlehLatentBlend
ComfyUI Node

BlehLatentBlend

Mixing two latents together, properly

By blepping·Created 3 years ago·Updated 2 months ago· 142
BlehLatentBlend
  • samples1
  • samples2
  • LATENT
samples2_percent0.50
blend_mode

Sometimes you don't want to pick between two latents, you want a bit of both. That's the whole job of BlehLatentBlend: feed it two LATENTs and a mix ratio, get one LATENT back that's some blend of the two. It sounds trivial - just average the tensors, right? - but how you blend two latents changes the result more than you'd expect, which is why this node exposes a genuinely huge list of blending methods instead of just doing a straight lerp.

Where this actually gets used

The obvious case is combining two separately-generated latents - maybe two seeds of the same prompt, maybe a base pass and a variant - into something in between, without round-tripping through pixel space first. It's also a handy building block if you're doing manual noise injection or hand-rolled multi-pass workflows: blend a fresh noise latent into a partially-denoised one at some ratio, or fade between a "before" and "after" state of a latent instead of hard-cutting.

Because it works directly on the compressed latent tensor, it's cheap. No VAE decode, no re-encode, no lossy round trip - you're just doing math on the same 4- or 16-channel tensor the sampler already produces.

Inputs and outputs

  • samples1 / samples2 - the two LATENT inputs. They need to be the same shape; this isn't doing any resizing for you (that's what BlehLatentScaleBy is for).
  • samples2_percent - a float, default 0.5, controlling how much of samples2 gets mixed in. At 0 you get pure samples1, at 1 pure samples2.
  • blend_mode - a dropdown with an absurd number of options (the schema reports 486 choices). Most of that bulk is stacked variants and reversed-argument versions of a much smaller set of real ideas. The ones worth knowing:
    • a_only / b_only - pass-through, ignoring the ratio. Useful for A/B testing a workflow without rewiring it.
    • bislerp - normalized spherical-ish interpolation between the two tensors. This is the same family of math ComfyUI's own built-in latent scaling uses by default (comfyanonymous wrote the original bislerp implementation), so it's a safe, well-behaved starting point.
    • slerp / hslerp - spherical linear interpolation; hslerp is pitched as smoothing transitions between orientation and color specifically.
    • colorize - supposedly transfers color from one to the other rather than blending structure. Your mileage will vary - the pack author is upfront that some of these are experimental and "may or may not work that way."
    • cosinterp / cuberp - cosine and cubic interpolation curves, if linear blending feels too flat.

Output is a single LATENT, ready to go straight into another sampler, a VAEDecode, or wherever you'd normally send a latent.

Installing it

BLEH is one repo with a pile of nodes in it, so you install it once and get all of them:

  • ComfyUI Manager - search "ComfyUI-bleh", install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/blepping/ComfyUI-bleh, then restart ComfyUI.

There's no requirements.txt to fight with for this node specifically - it doesn't need extra Python packages or model downloads. (Other nodes in the same pack, like the TAE video encode/decode pair, do need model files - that's a per-node thing, not a pack-wide one.)

Common issues

Shape mismatch errors. Both latents have to match in dimensions - same width/height/frame-count, same batch. If one came out of a differently-sized generation, scale it first (BlehLatentScaleBy or the built-in latent upscale nodes) before blending.

A blend mode does nothing, or does something weird. This whole node is built around a shared scaling/blending library the pack uses everywhere, and it's honest about the fact that a chunk of the exotic modes - anything with random in the name, the more obscure numbered variants - are experimental and might get changed or removed later. If you get a strange result from an unfamiliar mode, that's not necessarily you doing something wrong; start from bislerp or a_only/b_only and work outward from there.

You expected color transfer and got mush. colorize and similar named modes are aspirational names, not guarantees - the author flags several of these as "may or may not work that way." Treat the exotic modes as an experimentation playground rather than a documented feature with a fixed contract.

Categorylatent

Inputs (4)

NameTypeDefaultDescription
samples1LATENT
samples2LATENT
samples2_percentFLOAT0.50
blend_modeCOMBO486 options: a_only, b_only, bislerp_wrong, slerp, colorize, cosinterp, +480

Outputs (1)

NameTypeDescription
LATENTLATENT