Nodes/RyanOnTheInside/Flex Latent Blend βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
ComfyUI Node

Flex Latent Blend βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜

Composite two latents together, reactively

By ryanontheinsideΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 852
Flex Latent Blend βš‘πŸ…‘πŸ…žπŸ…£πŸ…˜
  • latents
  • latent_2
  • opt_feature
  • LATENT
β—„strength1.00β–Ί
β—„feature_threshold0.00β–Ί
β—„feature_paramβ–Ύβ–Ί
β—„feature_moderelativeβ–Ί
β—„blend_modeMixβ–Ί
β—„blend_strength0.50β–Ί

Most of the time you blend two things at the pixel level, after the VAE has already decoded them into an image. Flex Latent Blend works one step earlier, in latent space - the compressed representation the sampler actually operates on. That matters because latent-space blending behaves differently than pixel blending: you're not averaging colors, you're combining the compressed structure the model will use to generate detail, which can produce smoother, more "generative" transitions than a straight image crossfade. It's one of the "Flex" target nodes in RyanOnTheInside's pack - the same author behind ComfyStream and Daydream's real-time reactive video work - meaning the blend itself can be driven by an audio, motion, or other reactive signal instead of sitting at one fixed ratio.

How it works

You give it two latents, latents and latent_2, and a blend_mode borrowed straight from image-editor vocabulary: Mix, Add, Multiply, Screen, or Overlay. Mix is a straightforward crossfade; Add and Screen tend to brighten/combine; Multiply darkens and intersects; Overlay is the contrasty compromise. blend_strength sets how much of the second latent gets folded in. The feature_param field is where reactivity comes in - as shipped it can target blend_strength, so an incoming FEATURE (audio energy, brightness, whatever) can push the blend ratio up and down instead of holding it static, with feature_mode deciding whether that push is relative (centered on your set value) or absolute (scaled from zero to the ceiling).

Inputs and outputs that matter

  • latents / latent_2 (required, LATENT) - the two latents to blend. They need matching shapes; a resolution or batch mismatch will error like any other latent op in ComfyUI.
  • blend_mode - Mix, Add, Multiply, Screen, or Overlay.
  • blend_strength (default 0.5, 0–1) - how much of latent_2 comes through.
  • opt_feature (optional, FEATURE) - connect to make blend_strength react over time.
  • Output - a single LATENT, ready for your sampler or VAE Decode.

Installing it

Via ComfyUI Manager: search "RyanOnTheInside," install, restart. By hand:

cd ComfyUI/custom_nodes
git clone https://github.com/ryanontheinside/ComfyUI_RyanOnTheInside.git
cd ComfyUI_RyanOnTheInside
pip install -r requirements.txt

then restart ComfyUI. This node is pure tensor math - no model weights involved, so once the pack's Python dependencies are installed it's ready to use immediately.

Common issues & troubleshooting

Shape mismatch errors. Both latents have to come from the same resolution and batch size; a Flex Latent Blend fed one latent from a 512Γ—512 pipeline and another from 1024Γ—1024 will throw the same tensor-shape error any core ComfyUI latent node would. Resize or re-encode upstream, not here.

Blown-out, artifacted results at high strength. Add and Screen can push latent values well outside the range the sampler expects, especially near blend_strength 1.0 - if your output decodes to noisy garbage or blown highlights, that's usually the blend mode pushing values out of bounds rather than a bug. Drop to Mix, or pull blend_strength down, before assuming something's broken.

Feature modulation looks inert. Same checklist as the rest of the Flex family: confirm feature_param isn't left on a value that doesn't apply, and that feature_threshold isn't set high enough to gate out your actual feature range.

CategoryRyanOnTheInside/FlexFeatures/Targets/Latents

Inputs (9)

NameTypeDefaultDescription
strengthFLOAT1.000–1Overall strength of the effect (0.0 to 1.0) Higher values create more dramatic changes, while lower values are more subtle.
feature_thresholdFLOAT0.000–1Threshold for feature activation (0.0 to 1.0)
feature_paramCOMBOChoose which parameter of the effect to modulate Each effect type has different parameters you can control. Hover over each option to see what it does.
feature_modeCOMBOrelativeHow to apply the feature modulation: - relative: Changes are centered around the original value - absolute: Changes scale directly from zero to the maximum
latentsLATENTInput latent tensor to be processed (LATENT type)
latent_2LATENTSecond latent tensor to blend with (LATENT type)
blend_modeCOMBOMixType of blending operation ('Add', 'Multiply', 'Screen', 'Overlay')
blend_strengthFLOAT0.500–1Strength of the blending effect (0.0 to 1.0)
opt_featureoptFEATUREOptional feature input for modulation Connect any feature node here to control the effect. Features can come from audio, motion, color, or other sources.

Outputs (1)

NameTypeDescription
LATENTLATENTβ€”