LatentMix_AS
Blend two latents with a simple 0–100 weight
- samples_to
- samples_from
- LATENT
LatentMix_AS is the weighted-blend sibling of LatentAdd_AS: instead of just adding two latents, it mixes them according to a blend percentage you set. One dial, two latents in, one latent out. It's about as simple as latent interpolation gets.
It belongs to flyingshutter's As_ComfyUI_CustomNodes pack - a dependency-free collection the author describes as a playground. No models, no requirements.txt, just torch and a few standard library imports that ComfyUI already has.
How it works
The blend is a linear interpolation between the two latent tensors:
out = samples_to * (blend / 100) + samples_from * ((100 - blend) / 100)
Here's the counterintuitive bit, and it's worth getting straight before you use it: high blend values favor samples_to, low values favor samples_from. blend = 100 gives you all of samples_to; blend = 0 gives you all of samples_from. If you're used to "100 means the second input," flip your thinking.
The inputs
samples_to- theLATENTthat dominates at high blend values.samples_from- theLATENTthat dominates at low blend values.blend- aFLOATfrom 0 to 100 (default 0, so the node starts at puresamples_from).
Output is a single LATENT at the same resolution as the inputs.
Where you'd use it
The classic use is interpolation between two images for animation or exploration: encode image A and image B, then step blend from 0 to 100 across frames and decode each step to get a smooth morph. Because it operates in latent space rather than pixel space, the transition tends to be more "semantic" than a pixel crossfade - subjects warp into each other rather than just fading. That's the fun part, and it's the same trick that powers a lot of latent-interpolation animation workflows.
You can also use it as a poor man's strength control: mix a fresh, strongly-condtioned latent with a stable base latent to tune how far the output wanders.
Installing it
cd ComfyUI/custom_nodes
git clone https://github.com/flyingshutter/As_ComfyUI_CustomNodes
Restart ComfyUI and it's under ASNodes (or ComfyUI Manager → search "As_ComfyUI_CustomNodes"). No extra dependencies to install.
Common issues
- Forgetting the direction. New users expect "blend 100" to mean "all of the second input." Here it means all of
samples_to. If your morph looks backwards, flip the inputs. - Shape mismatch. Both latents must have the same spatial and channel dimensions. Different resolutions error out; keep them matched.
- Mixed-model latents. Blending latents from different models or different VAEs gives meaningless noise (the KB's notes on latent spaces explain why: a VAE defines the space, and different spaces don't compose). Use latents from the same model.
For latent interpolation, this is one of the most straightforward tools in the pack. Just don't let the blend direction surprise you halfway through a 40-frame morph.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| samples_to | LATENT | — | |
| samples_from | LATENT | — | |
| blend | FLOAT | 00–100 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |