Nodes/ComfyCollectorNodes/Curve Sample (CCN)
ComfyUI Node

Curve Sample (CCN)

Turn any drawn curve into a number you can wire anywhere

By valkymaera·Created 4 months ago·Updated 10 days ago· 1
Curve Sample (CCN)
  • curve
  • FLOAT
t0.000
x_scale1.000
y_scale1.000
curve_data[{"x":0,"y":0,"in":0,"out":1,"mirrored":true},{"x":1,"y":1,"in":1,"out":0,"mirrored":true}]

Curve Sample (CCN) is the workhorse of the pack's curve family: it evaluates a curve at one position and returns a float. Draw the shape in the built-in editor, feed it a t between 0 and 1, and out comes the value on the curve at that point. It's the bridge between "a curve is a pretty shape" and "this number is now my noise strength" - and once you see that, you realize half the settings in a workflow could be driven off a drawn curve instead of a fixed number.

How it works

The curve is evaluated with cubic Hermite interpolation (the same basis as the pack's other curve nodes, and Unity's AnimationCurves). The two scaling inputs are where the flexibility lives:

  • x_scale - your incoming t is divided by this before sampling, mapping a 0..x_scale range onto the curve's 0–1 domain. Want to sample by frame number across a 30-frame batch? Set x_scale to 30 and drive t with the frame index.
  • y_scale - the sampled value is multiplied by this on output. Drawing a 0–1 curve but need a 0–100 strength? Set y_scale to 100.

So t is the position, x_scale stretches the input domain, y_scale scales the output. You can use the built-in curve_data editor, or wire an external curve (from Curve Definition) and it overrides the editor - and when wired, the editor becomes a read-only live view of the connected curve.

Inputs and outputs

t (default 0, step 0.001), x_scale, y_scale, curve_data, and the optional curve. Output is a single FLOAT - the sampled value times y_scale. Wire it into any float input you've converted to a socket: a strength, a blend, a scale, a weight.

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.

Where it shines

The classic trick is animating or ramping any numeric parameter without scripting. Pair Curve Definition + Curve Sample with a counter (the pack's Better Int is a natural fit) and you can sweep a parameter across a batch following the shape you drew - spike early, fade late, whatever. The trap to avoid is forgetting x_scale and y_scale are defaults of 1: feed t = 30 into an unscaled curve and it clamps to the endpoint, which looks like the curve is broken when it's really just full-scale. Know your domain, and this little node quietly unlocks a lot of control.

CategoryCCN

Inputs (5)

NameTypeDefaultDescription
tFLOAT0.000
x_scaleFLOAT1.000
y_scaleFLOAT1.000
curve_dataSTRING[{"x":0,"y":0,"in":0,"out":1,"mirrored":true},{"x":1,"y":1,"in":1,"out":0,"mirrored":true}]
curveoptCCN_CURVE

Outputs (1)

NameTypeDescription
FLOATFLOAT