Nodes/ComfyUI-Keyframed/Get Curve From Parameter Group
ComfyUI Node

Get Curve From Parameter Group

Fishing a labeled curve back out

By dmarx·Created 3 years ago·Updated 2 years ago· 92
Get Curve From Parameter Group
  • parameter_group
  • KEYFRAMED_CURVE
curve_labelMy Curve

A parameter group is a bundle of curves you can move around the graph as one unit - the pack's answer to "I have six animated parameters and I don't want six wires running everywhere." But a bundle you can't open isn't a bundle, it's a box. KfGetCurveFromPGroup is how you open it: give it a group and a curve label, and it returns that one curve, so you can route it somewhere specific or inspect it on its own.

This is the exact inverse of KfAddCurveToPGroup. That node stuffs a curve into a group under its label; this one pulls a curve back out by that same label. Together they let you collect curves, manipulate the collection, and extract individual members when something downstream wants just one.

Why you'd reach for it

Groups earn their keep when you have a cluster of related animated values - prompt weight, CFG, and denoise all driven by curves you want to treat as a set. Add them all to one group, maybe apply a group-wide operation (KfPGroupCurveAdd, KfPGroupCurveMultiply), then extract each one where the sampler needs it. The extract step is the payoff: your graph stays tidy until the moment a single value needs to become a number.

The inputs that matter

  • curve_label - a string, default "My Curve". This is the lookup key, and it must match the label exactly as the curve was named when it went into the group. Case-sensitive, whitespace-sensitive.
  • parameter_group - the PARAMETER_GROUP, force-input.

Output is a single KEYFRAMED_CURVE. Note the node deepcopys the curve it finds, so the group is left untouched - editing or relabeling the extracted curve won't change what's still in the group.

How it works

Under the hood it's one dict lookup: a ParameterGroup stores its curves in a parameters dict keyed by label, and the node reads parameter_group.parameters[curve_label]. That's why labels matter so much in this pack - every add/extract/plot operation is really working against that dict. Because it's a plain dict access, an unmatched label raises a KeyError, which shows up in ComfyUI as a node error.

Installing it

Part of ComfyUI-Keyframed (dmarx's pack wrapping his keyframed library). ComfyUI Manager: search "Keyframed". Or:

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

Restart ComfyUI. The pack auto-installs keyframed and toolz on first load; no model downloads.

Troubleshooting

The KeyError on a bad label is the whole troubleshooting story. When it happens: check the exact label string on the curve (use KfSetCurveLabel and pick something boring and typo-proof), check for trailing spaces, and make sure you actually added the curve to this group - if you created a fresh group somewhere else, the label won't be in it. One more gotcha: the curve's label is whatever it was when added. Renaming a curve after it's in a group doesn't rename the group's key, so extract by the label it had when it went in.

Categorykeyframed/parameter group

Inputs (2)

NameTypeDefaultDescription
curve_labelSTRINGMy Curve
parameter_groupPARAMETER_GROUP

Outputs (1)

NameTypeDescription
KEYFRAMED_CURVEKEYFRAMED_CURVE