ComfyUI Node

KfCurveDraw

Actually see the curve you just built, before it ruins your animation

By dmarx·Created 3 years ago·Updated 2 years ago· 92
KfCurveDraw
  • curve
  • IMAGE
n64
show_legendtrue

Every curve node in this pack produces a KEYFRAMED_CURVE, and curves are invisible until you plot them. KfCurveDraw is the plotting node - feed it a curve and it renders a matplotlib chart as an IMAGE you can preview right in ComfyUI. It's the node that stops you from discovering, twenty frames into a render, that your carefully built weight curve has a spike to 7 in the middle.

It's marked experimental, which is honest - the code is a thin wrapper around matplotlib with a few rough edges - but for its one job it's genuinely the most useful debugging tool the pack has. The pattern is simple and worth adopting: every time you build or combine curves, drop a KfCurveDraw on the end, look at the plot, then delete it. Thirty seconds that saves you an hour.

How it works

The node samples your curve at a grid of points and plots it. The keyframe positions themselves are marked as scatter dots on top of the line, so you can see both the shape and the actual timestamps you defined - which is exactly what you need when you're checking whether that union-of-keyframes arithmetic did what you thought. The implementation takes care of one subtlety you don't need to think about: it samples slightly to each side of keyframes too, so step-function behavior (a previous or next interpolation) shows up as a real step rather than a misleading diagonal.

The inputs

  • curve (required, forceInput) - the KEYFRAMED_CURVE to draw.
  • n (default 64) - how many sample points to use. More points = smoother line; 64 is fine for most curves.
  • show_legend (default true) - whether to draw the legend, which uses the curve's label. If you have several curves of interest, a label is how you tell them apart on the plot.

The output

IMAGE - a tensor you can preview with any image-preview node or save out. It's a real IMAGE, so it also flows through the standard save/display machinery.

How to install it

Installs with the whole pack: ComfyUI Manager → search ComfyUI-Keyframed, or

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

then restart ComfyUI. No models to download. One honest dependency note: this node renders with matplotlib, which isn't listed in the pack's own requirements.txt but arrives transitively through the keyframed library (a declared dependency), so a normal install gets it. If matplotlib somehow isn't present in your environment, the keyframed pip install will pull it in.

Troubleshooting

If your plot looks wrong, first suspect the curve, not the plotter - a jagged or spiky plot is usually telling you the truth about your keyframes. If the legend is missing or wrong, the curve has no label or an unexpected one (a reminder that unlabeled curves get randomly generated labels, so set labels with the YAML node or the Set Curve Label node if you care). And because it sits in the keyframed/experimental category, don't be surprised if its behavior shifts between pack updates - it's the sort of utility the author iterates on.

Categorykeyframed/experimental

Inputs (3)

NameTypeDefaultDescription
curveKEYFRAMED_CURVE
nINT64
show_legendBOOLEANtrue

Outputs (1)

NameTypeDescription
IMAGEIMAGE