Nodes/OmniNodes/Latent Blend πŸŒ€
ComfyUI Node

Latent Blend πŸŒ€

Blending Latents Like Photoshop, But Nobody Can See What You're Doing

By TensorVizionΒ·Created 3 months agoΒ·Updated about 8 hours agoΒ· 0
Latent Blend πŸŒ€
  • latent_a
  • latent_b
  • mask
  • latent
  • blend_info
β—„blend_modeβ–Ύβ–Ί
β—„ratio0.50β–Ί
β—„strength1.00β–Ί
β—„normalize_outputfalseβ–Ί

Latent Blend does to two latents what a Photoshop layer blend does to two images - except the two inputs are compressed VAE tensors, so you're blending the underlying representation of two images rather than the pixels. That's the trick and the trap at once: it happens before decoding, so what comes out is a genuinely new latent, not a composite. Sample it and you get an image that's neither A nor B but something the model thinks sits between them. Same idea as Latent Interpolate, but that node walks a path from A to B frame by frame; this one fuses them into one latent, then you sample once.

How it works

Pick a blend_mode and a ratio, and it does the math element-wise on the tensors. The menu is a mix of plain and Photoshop-flavored:

  • lerp - A*(1-ratio) + B*ratio. The boring, predictable one, and often the right one.
  • add / subtract / multiply - the arithmetic primitives.
  • screen, overlay, hardlight, difference - the classic compositing modes, applied to normalized latent values.
  • spatial_mask - the interesting one: use an actual MASK to blend spatially, A outside the mask, B inside. That's latent-space region swapping without a trip to pixel space.

strength scales how hard the blend applies (1.0 = full blend, lower = closer to A). normalize_output renormalizes the result afterward - worth trying on if the output comes out of range and downstream looks washed out. There's also a blend_info text output that tells you what it actually did, which is handy when you forget which mode you left set.

Inputs and outputs that matter

  • latent_a / latent_b - two LATENTs. Should be the same shape (same model family and resolution) or the math gets weird.
  • blend_mode - the dropdown above.
  • ratio - 0 to 1, which input wins.
  • mask (optional) - only used by spatial_mask mode.

Outputs are latent and blend_info. Wire latent into a KSampler with a low denoise, or straight to VAE Decode if you want to see the raw blend.

Where it earns its keep

The classic use is style mixing: generate A with one prompt, B with another, then blend in latent space and sample at low denoise to get a composition that borrows structure from A and mood from B. Because it's a latent-space operation, the blend happens where the model can still "fix" it during sampling - a pixel-space blend leaves a hard seam you'd have to inpaint. The honest caveat: latent channels aren't RGB. A "screen" blend at ratio 0.5 isn't a predictable 50% color mix; it's an approximation of one. Treat modes other than lerp and spatial_mask as experiments, and keep the strength low until you see what they do.

Install

Same as the rest of OmniNodes - pure PyTorch/NumPy, no extra installs:

cd ComfyUI/custom_nodes
git clone https://github.com/TensorVizion/OmniNodes

Restart ComfyUI and find it under TensorVizion/Latent. ComfyUI Manager (search "OmniNodes") is the easy route. You'll know it loaded when the terminal shows [OmniNodes] βœ… Loaded.

Troubleshooting

  • Output looks like static or flat gray. The blend pushed values outside the latent's normal range. Turn on normalize_output, or lower strength.
  • Spatial mask ignores the mask. spatial_mask is the only mode that reads the mask input - if you've got a mask connected but the mode is set to lerp, it's silently ignored.
  • A and B are different resolutions. Resize the latents so they match, or the element-wise math will fail or produce garbage. Latents from the same workflow usually already match.

If you're coming from image-space blending, expect a discovery curve: the first few blends will surprise you. Lower the strength, run it through a cheap sample, and build intuition from what actually comes out instead of what you'd guess from the mode name.

CategoryTensorVizion/Latent

Inputs (7)

NameTypeDefaultDescription
latent_aLATENTβ€”
latent_bLATENTβ€”
blend_modeCOMBO9 options: lerp, add, subtract, multiply, screen, overlay, +3
ratioFLOAT0.500–1β€”
strengthFLOAT1.000–3β€”
normalize_outputBOOLEANfalseβ€”
maskoptMASKβ€”

Outputs (2)

NameTypeDescription
latentLATENTβ€”
blend_infoSTRINGβ€”