Nodes/ComfyUI-Keyframed/Curve_1 + Curve_2
ComfyUI Node

Curve_1 + Curve_2

Do arithmetic on whole curves, not just numbers

By dmarx·Created 3 years ago·Updated 2 years ago· 92
Curve_1 + Curve_2
  • curve_1
  • curve_2
  • KEYFRAMED_CURVE

Curve_1 + Curve_2 is one of those nodes that quietly unlocks everything else in this pack. The core idea of ComfyUI-Keyframed is that your animation parameters aren't numbers, they're curves - and curves, unlike numbers, can be added, subtracted, and multiplied as whole objects. This node is addition, and it's the foundation for the pack's marquee "prompt superposition" workflow, where several prompts each get a weight curve and you add the weighted conditionings together so every prompt contributes at every frame, each taking turns being strongest.

So when would you reach for it? Any time two influences should both apply: an overall style weight curve plus a per-scene emphasis curve, or the sum of a fast wiggle and a slow drift. You add curves instead of trying to express the combination as one hand-drawn line.

How it works

Both inputs must be KEYFRAMED_CURVES (a raw number won't do - that's what the Constant-Valued Curve node is for; add a curve plus a constant curve and you've got your baseline). The addition happens at the union of the keyframes of both curves: every timestamp that appears in either curve becomes a timestamp in the result, and at each one the values are summed. The README calls this out explicitly, and it's the single most useful thing to internalize about curve arithmetic - the output curve carries all the shape of both parents, not just the points where they happened to agree.

The implementation is a deep copy of each input followed by curve_1 + curve_2 from the keyframed library, so your source curves are left untouched - wire the same curve into five different operators and they all see the original.

The inputs

  • curve_1, curve_2 (both required) - the curves to add. Both are forceInput, so they must come from wire, not from typing.

The output

KEYFRAMED_CURVE, ready for further arithmetic, plotting, or feeding into a Parameter Group.

How to install it

Standard pack install - ComfyUI Manager → search ComfyUI-Keyframed, or clone manually:

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

then restart ComfyUI. No model files; the pack's only real dependency is the keyframed Python library (plus toolz), installed automatically on first import if missing.

Troubleshooting

Two gotchas, both real. First, "union of keyframes" cuts both ways: if your two curves were built at different resolutions - one from a dense string, one drawn coarsely - the sum will contain every keyframe from both, and the plot can look busier than either input. That's expected behavior, not a bug. Second, remember the identity value for addition is zero, which means an empty or unconnected slot on the x10 variant contributes nothing; for the plain two-input version there's no subtlety - just don't leave one input unplugged, because a missing wire means an error, not a silent zero.

Categorykeyframed

Inputs (2)

NameTypeDefaultDescription
curve_1KEYFRAMED_CURVE
curve_2KEYFRAMED_CURVE

Outputs (1)

NameTypeDescription
KEYFRAMED_CURVEKEYFRAMED_CURVE