Curve Formula Builder
Can't write math? Pick a shape, get a formula
- formula
- preview_graph
- description
The Advanced Curved ControlNet Scheduler has a custom_formula field that accepts raw math - sin(t*3.14), 1-exp(-5*t), that sort of thing. Powerful, sure, and a total wall for anyone who hasn't touched a function since school. This node is the ramp over that wall: pick a shape from a dropdown, tweak two sliders, and it hands you a ready-to-paste formula string plus a preview graph so you can see what you're getting before it ever touches a keyframe.
How it works
You choose a pattern - Straight Line, Ease In, Ease Out, S-Curve, Wave, Peak, Valley, Exponential Growth, or Exponential Decay - and the node generates the matching mathematical expression using t from 0 to 1. strength (0–100) controls how dramatic the effect is, speed (10–100) how fast the change happens, and num_points sets the resolution of the preview. Optional flip_vertical / flip_horizontal mirror the shape, and repeat_times stacks the pattern 1–10 times for multi-segment curves.
The output formula is the STRING you drop into the Advanced scheduler's custom_formula input. preview_graph is the IMAGE you preview to check the shape, and description is a plain-text summary. show_formula toggles whether the generated math is displayed alongside the graph - turn it on if you want to learn what these formulas actually look like, since it'll happily teach you t**2 while you're at it.
Why you'd bother
Two reasons. First, the hand-written formula route punishes typos - one unbalanced paren and the scheduler's safe evaluator refuses to run, and debugging a blank keyframe group is miserable. This node generates syntactically valid output, which removes an entire class of failure. Second, repeat_times and the flip toggles let you build the kind of repeating pulse patterns that are genuinely fiddly to hand-write, with visual feedback the whole way.
Installing it
Part of the same pack:
cd ComfyUI/custom_nodes
git clone https://github.com/diffussy69/comfyui-curved_weight_schedule
pip install matplotlib pillow numpy torch scipy
No models, no special dependencies beyond matplotlib for the graph. Restart and hard-refresh.
Where people get burned
The formula this node outputs is only useful if you actually connect it to something that consumes formulas - the Advanced Curved ControlNet Scheduler's custom_formula field is the target. Newcomers sometimes wire the formula string into random text slots and wonder why nothing changes. And remember the receiving field expects t as the variable; the node uses t internally, so pasted output is compatible by construction - one of the nice things about it. Also worth knowing: num_points is purely preview resolution, it doesn't change the shape.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| pattern | COMBO | S-Curve (Smooth) | Choose the basic shape of your curve |
| strength | FLOAT | 500–100 | How dramatic the effect (0=gentle, 100=extreme) |
| speed | FLOAT | 5010–100 | How fast the change happens |
| num_points | INT | 10010–500 | Resolution of the curve preview |
| flip_verticalopt | BOOLEAN | false | Flip the curve upside down |
| flip_horizontalopt | BOOLEAN | false | Reverse the curve direction |
| repeat_timesopt | INT | 11–10 | Repeat the pattern multiple times |
| show_formulaopt | BOOLEAN | false | Show the generated math formula |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| formula | STRING | — |
| preview_graph | IMAGE | — |
| description | STRING | — |