Zsq Latent
Blend, subtract, and walk latents without leaving the graph
- samples1
- samples2
- LATENT
Zsq Latent is a pocket calculator for latent space. Feed it two latents, pick an operation, and it adds, subtracts, scales, or interpolates them before you hand the result to a sampler. If that sounds like something you'd use for one fun experiment and then forget, you're probably right - but when you want it, it's genuinely handy, and it's one of the few nodes in this pack that does something core ComfyUI makes you assemble from four separate nodes (LatentAdd, LatentSubtract, LatentMultiply, LatentInterpolate).
Quick context for the "latent" part: a latent is the compressed tensor your VAE produces - 4 channels at 1/8 resolution for the SD1.5, SDXL, and Flux family. Add or subtract two latents and you're blending or contrasting the compressed representations, which decodes into a rough blend of the two images. It's not magic and it's not precise, but it's how people pull off latent morphs, style walks, and the "mix these two generations" trick without ever going back to pixels.
Mechanically the node is simple, and mostly well-built. add and subtract do elementwise +/−, with a nice touch: samples2 is reshaped to match samples1 (bilinear upscale plus batch repeat), so you can feed it latents of different sizes without a shape error. multiply scales one latent by multiply_multiplier (−10 to 10). interpolate is spherical interpolation - it normalizes both latents, blends them by interpolate_ratio, then renormalizes and rescales to the norm-blended magnitude. That's the classic latent "walk" math, the same idea behind a lot of morphing demos.
Now the honest warning, because you will hit it: as shipped, interpolate mode crashes. The dispatcher calls self.interpolate(samples1, interpolate_ratio) and never passes samples2, so you get a TypeError the moment you select it. The math is all there; the wiring isn't. Stick to add, subtract, and multiply, and treat interpolate as broken until the author patches the dispatch. (interpolate_ratio defaults to 1.0 anyway, which would mean "all of samples1" - so it wasn't ready for prime time.)
The inputs that matter are just these: samples1 and samples2 are the two LATENT inputs (grab them off a VAE Encode or a previous KSampler run), mode is the operation dropdown, and the two sliders only apply in their own mode. The output is a single LATENT - wire it into a KSampler for a re-denoise, or straight to VAE Decode if you just want to eyeball the blend.
Install is the same for every node in this pack: ComfyUI Manager, search "zsq_prompt", and hit install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/windfancy/zsq_prompt
then restart ComfyUI. The pack's requirements.txt pulls in heavy dependencies - transformers, opencv-python, onnx, ultralytics, timm - but almost all of that pays for the pack's image and segment nodes, not this one. No model downloads needed here. The README is essentially empty (a handful of reference links), so don't go looking for docs there.
One pack-level gotcha worth knowing: ComfyUI Manager sometimes reports zsq_prompt as conflicting with other packs even when you don't have it installed. A user hit exactly that while installing ReActor and never found zsq_prompt anywhere - the answer was to ignore the message. If a workflow you load doesn't actually use these nodes, the conflict warning is noise.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| samples1 | LATENT | — | |
| samples2 | LATENT | — | |
| mode | COMBO | 4 options: add, subtract, multiply, interpolate | |
| multiply_multiplier | FLOAT | 1.00-10–10 | — |
| interpolate_ratio | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |