Curve Sample (CCN)
Turn any drawn curve into a number you can wire anywhere
- curve
- FLOAT
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 incomingtis divided by this before sampling, mapping a0..x_scalerange onto the curve's 0–1 domain. Want to sample by frame number across a 30-frame batch? Setx_scaleto 30 and drivetwith 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? Sety_scaleto 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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| t | FLOAT | 0.000 | — |
| x_scale | FLOAT | 1.000 | — |
| y_scale | FLOAT | 1.000 | — |
| curve_data | STRING | [{"x":0,"y":0,"in":0,"out":1,"mirrored":true},{"x":1,"y":1,"in":1,"out":0,"mirrored":true}] | — |
| curveopt | CCN_CURVE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |