Nodes/ComfyUI-Keyframed/Add Conditions
ComfyUI Node

Add Conditions

The glue that turns several weighted prompts into one

By dmarx·Created 3 years ago·Updated 2 years ago· 92
Add Conditions
  • conditioning_1
  • conditioning_2
  • CONDITIONING

Conditionings are the thing your sampler actually reads, and this node is how you combine two of them into one. Add Conditions takes two CONDITIONING objects and returns their sum - both the cross-attention tensors and the pooled outputs get added together. It's the compositional glue for the pack's signature trick: take several prompts, weight each one with its own curve, and add them all into a single conditioning that carries every prompt at once.

Think of it as the conditioning-level version of Curve_1 + Curve_2, but instead of summing curves it sums what the curves are attached to. In the README's manual prompt-transition workflow, each prompt gets a weight curve, each weighted conditioning is produced (via Apply Curve to Conditioning), and then they're stacked together with nodes like this one before hitting the KSampler. The one rule the README states plainly: when you combine weighted conditionings, the weights should roughly sum to 1 - and if you're short, fill with an empty prompt rather than letting the total drift below 1.

How it works

Both inputs are deep-copied, then the tensors are added element-wise and the pooled outputs are added likewise. The result is a single CONDITIONING that behaves like any other - feed it straight into a sampler or into the negative/positive input of a KSampler, and it's indistinguishable from a conditioning that was never split apart. It's simple, which is the point: this is plumbing, and it's meant to be invisible.

The inputs

  • conditioning_1, conditioning_2 (both required) - the two conditionings to combine.

The output

CONDITIONING - the summed conditioning, ready to wire onward.

How to install it

Part of the ComfyUI-Keyframed pack - one install covers every node. ComfyUI Manager → search ComfyUI-Keyframed, or

cd ComfyUI/custom_nodes
git clone https://github.com/dmarx/ComfyUI-Keyframed

then restart ComfyUI. No models; the pack's dependency is the keyframed library (plus toolz), auto-installed on first import.

Troubleshooting

Two real gotchas. First, both inputs must have the same number of conditioning entries - the node asserts this, so a mismatch throws an error rather than silently misbehaving; if you hit it, the usual cause is one input having been batched by an earlier node. Second, adding conditionings does not normalize: if each of two prompts is weighted 1, the sum is 2, and the sampler will read double-strength conditioning. That's often exactly what you don't want, which is why the "sum to 1" guidance exists - keep your per-prompt weights on curves that stay under 1, or build the weighting into the curves before you add.

Categorykeyframed

Inputs (2)

NameTypeDefaultDescription
conditioning_1CONDITIONING
conditioning_2CONDITIONING

Outputs (1)

NameTypeDescription
CONDITIONINGCONDITIONING