ComfyUI Node

KfPGroupDraw

See all your curves before you waste a render on them

By dmarx·Created 3 years ago·Updated 2 years ago· 92
KfPGroupDraw
  • parameter_group
  • IMAGE
n64
show_legendtrue

Animation work has a special kind of waste: rendering sixty frames to discover your easing curve does the wrong thing. KfPGroupDraw is the antidote - it plots every curve inside a parameter group as a proper chart and hands you the chart as an IMAGE you can preview or save, before you run the sampler. It's the pack's "show me the curves" node, and if you're doing any serious keyframing work, it earns its place in your graph as a permanently attached sanity check.

The plots come from matplotlib, rendered to a tensor you can wire into any image preview or save node. Every curve in the group gets its own line, and here's where all that label-talk pays off: each line is labeled with its curve's label in the legend. Name your curves and the chart reads like a dashboard; leave them as "~curve~" and you'll get a chart that's technically accurate and completely useless.

Why you'd reach for it

Before any long animation, plot the group. Confirm the sum of your entangled curves stays near 1 (the README's prompt-superposition property), check that a multiplication envelope doesn't shove a parameter into an insane range, verify your ramp actually starts where you think it starts. This node is to keyframing what a preview is to an image - the cheap check that catches the expensive mistake. It's in the keyframed/experimental category, but in practice it's one of the most-used utilities in the pack.

The inputs that matter

  • parameter_group - the PARAMETER_GROUP to plot, force-input.
  • n - an INT, default 64, the number of sample points across the plot. Bump it up for curves with fast changes or fine detail; keep it low for a quick look.
  • show_legend - a BOOLEAN, default true. Turn it off for a clean chart when you don't need the labels.

Output is a single IMAGE - the rendered chart, which you'll typically route to a preview node. The plotting also adds a tiny epsilon offset around each keyframe so step-function ("previous"/"next" interpolation) behavior shows up as actual vertical jumps instead of misleading slanted lines - a small detail that makes the chart honest about hard cuts.

How it works

Under the hood it shares a plotting helper with the curve-drawing nodes. It builds an x-axis from the first n integers plus every keyframe time (so keyframes are always on the chart), evaluates each curve across that axis, draws a line per curve with its label as the legend entry, and scatter-plots the keyframe points themselves. The matplotlib figure is saved to a PNG buffer and converted to a [1, H, W, 3] image tensor.

Installing it

Part of ComfyUI-Keyframed. ComfyUI Manager: search "Keyframed". Or:

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

Restart ComfyUI. The pack pip-installs keyframed and toolz on first load. One environment note: this node needs matplotlib importable in ComfyUI's Python env - it's usually already there, but if the node errors on import, that's the dependency to check.

Troubleshooting

If the plot comes out blank, check your group actually has curves in it - an empty group plots nothing. If lines are labeled "~curve~" or with random strings, that's your cue to run KfSetCurveLabel before grouping. And if a curve looks right on the plot but wrong in the render, remember the plot samples n points plus keyframes: extremely fast changes between keyframes can be under-sampled at low n, so bump n up before trusting the picture.

Categorykeyframed/experimental

Inputs (3)

NameTypeDefaultDescription
parameter_groupPARAMETER_GROUP
nINT64
show_legendBOOLEANtrue

Outputs (1)

NameTypeDescription
IMAGEIMAGE