Nodes/ComfyUI Extra Samplers/GeometricCFGGuider
ComfyUI Node

GeometricCFGGuider

Blend two prompts geometrically, not by averaging

By Clybius·Created 3 years ago·Updated 2 years ago· 104
GeometricCFGGuider
  • model
  • cond1
  • cond2
  • negative
  • GUIDER
cfg8.0
geometric_alpha0.50

GeometricCFGGuider is the pack's answer to "what if I could blend two positive prompts mid-sampling, but not by averaging them?" It's from ComfyUI Extra Samplers by Clybius, and it outputs a GUIDER that mixes two conditionings using a geometric - not arithmetic - combination.

Here's the mechanism, and it's the whole point of the node. Each step, it runs the model on both positive conditionings (cond1 and cond2) and the negative, then blends the two positives in the complex domain: cond1^(1-alpha) * cond2^alpha. At geometric_alpha = 0.5 you get the geometric mean of the two prediction tensors; at 0 or 1 you get one side or the other. Then the blended result feeds the normal classifier-free-guidance calculation against your negative. The code is literally a complex-power interpolation before the standard cfg_function call.

Why geometric instead of arithmetic? If you've tried averaging two prompt embeddings and gotten muddled mush, that's the arithmetic mean fighting between two directions in latent space. Geometric blending is the tinkerer's trick to keep both concepts structurally present - it's the same idea as merging checkpoints by multiplying in latent space rather than adding. Whether you find it magical or marginal is genuinely a "test on your own prompt and seed" question; some subjects take to it, some don't.

The inputs that matter:

  • cond1 / cond2 - the two positive conditionings (from your positive prompt text-encoders).
  • geometric_alpha - the blend weight, 0 to 1. 0.5 = even geometric mix; default is 0.5.
  • negative - the negative conditioning, used for the CFG extrapolation.
  • cfg - the classifier-free-guidance scale applied to the blended prediction. Default 8; tune like you would a KSampler's CFG.

Output: a single GUIDER, wired into the guider input of a custom sampler node along with your conditionings.

The honest caveat: this is a niche tool for people who already know they want prompt-blending in latent space. If you're new, the returns are subtle and hard to judge - two separate runs, one per prompt, is a better use of your time until you've hit this node's specific wall. It's also a "you'll know it's working when it works" node, so keep a fixed seed while you sweep geometric_alpha.

Install is the shared pack routine - ComfyUI Manager → "ComfyUI Extra Samplers", or:

cd ComfyUI/custom_nodes
git clone https://github.com/Clybius/ComfyUI-Extra-Samplers

then restart. No model downloads; dependency is kornia. If you're after blending two positives additively instead of geometrically, that's the ScaledCFGGuider in the same pack - same idea, different math.

Categorysampling/custom_sampling/guiders

Inputs (6)

NameTypeDefaultDescription
modelMODEL
cond1CONDITIONING
cond2CONDITIONING
negativeCONDITIONING
cfgFLOAT8.00–100
geometric_alphaFLOAT0.500–1

Outputs (1)

NameTypeDescription
GUIDERGUIDER