Nodes/ComfyCollectorNodes/Curve From Core (CCN)
ComfyUI Node

Curve From Core (CCN)

Bring ComfyUI's native curves into the CCN curve world

By valkymaera·Created 4 months ago·Updated 10 days ago· 1
Curve From Core (CCN)
  • core_curve
  • curve
debugfalse

ComfyUI added native curves to its core, and this pack's curves predate them - so the author built bridges. Curve From Core (CCN) is the direction that converts ComfyUI's native CURVE (from the core CurveEditor node, {points, interpolation} format) into a CCN_CURVE (Hermite keyframes with tangents). Wire a native curve in, get a CCN curve out, and feed it to the pack's Curve Sample or Curve CFG Guider.

How it works

The conversion is exact for the two native interpolation modes that map cleanly onto Hermite keyframes: monotone_cubic and linear. For those, the control points become CCN keyframes with tangents computed via Fritsch–Carlson monotone slopes - the source explicitly mirrors MonotoneCubicCurve._compute_slopes from comfy_api so the converted curve evaluates identically to the core implementation. For anything more exotic - analytical curves or LUT-based CurveInput subclasses whose shape isn't recoverable from control points alone - it resamples through the public interface at a fixed 33-point resolution instead.

There's a subtle detail in the source worth respecting: core evaluates duplicate-x points as step discontinuities by taking the last point's y at the shared x, while CCN's evaluator would take the first. The converter shifts the earlier members of a duplicate-x run a hair left (1e-9) so steps land correctly on both sides. In other words, the author has thought about the edge cases, and step-shaped curves survive the trip.

Inputs and outputs

core_curve in (the native CURVE), debug if you want conversion details printed, and curve (a CCN_CURVE) out. That's it.

Install

ComfyUI Manager → search ComfyCollectorNodes → Install → restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes

Restart, no pip step. Under the (CCN) suffix.

When to use it

Only when you're living in both worlds. If everything in your workflow is native ComfyUI curves, you don't need this - and this pack's own guider only accepts CCN_CURVE, so the only real reason to convert native→CCN is to drive the pack's curve tools with a curve you drew in core's editor (or received from another node). The reverse trip, CCN→native, is Curve To Core, which is the direction you'd use to hand a drawn CCN curve to a native consumer. It's a quiet interoperability node, and it does its one job carefully. One note: older ComfyUI installs may lack the comfy_api curve support, in which case only raw dict/list curves can arrive - if your core install is new enough to have CurveEditor, you're fine.

CategoryCCN

Inputs (2)

NameTypeDefaultDescription
core_curveCURVENative ComfyUI curve, e.g. from the core CurveEditor node.
debugoptBOOLEANfalsePrint conversion details to console.

Outputs (1)

NameTypeDescription
curveCCN_CURVE