ComfyUI Node Runs on cloud

Number Sequence

Give a LoRA a strength that changes across the render

By WASasquatch·Created 4 years ago·Updated about 9 hours ago· 1,884
Number Sequence
  • start
  • end
  • values
  • values
  • NUMBER
  • floats
  • ints
  • count
◄mode▾►
◄count20►
◄curve▾►
◄curve_on▾►
◄repeat1►
◄loop▾►
◄reversefalse►
◄decimals6►

What it's for

A LoRA strength is a single number in most graphs, which is fine for "more of this style" and wrong for the thing a lot of people actually want: a LoRA at full strength while the layout is being decided that fades out as detail comes in, or one that only kicks in for the last third of the steps, or two LoRAs handing over partway through.

ComfyUI doesn't do that from a widget. Number Sequence builds a list of numbers - shaped by a curve, repeated, looped, reversed - and hands it over so it can be applied per sampling step. The pack's Power LoRA Loader takes a list on its strength (or on one row's weight) and applies it step by step; Number Sequence is where that list usually comes from. The same list also drives a whole batch of renders if you wire a different output, which is the part people miss.

How it works

Two modes decide where the numbers come from.

range walks from start to end. 1 to 0 over 20 entries is a fade-out; an end above start fades in instead.

values walks through the numbers you type in the box, evenly spaced: 1, 1, 0.5, 0 holds at full, then eases to nothing. Commas, spaces or one per line all parse. You can wire a LIST in instead of typing.

Then the shaping happens. curve picks the easing - linear is a straight line, ease_in_* starts slow, ease_out_* finishes slow, the *_back and *_elastic variants overshoot, *_bounce settles in hops, and hold keeps each value until the next one. curve_on decides what the curve bends: transitions eases each move between neighbouring values, while values reshapes the values themselves between the lowest and highest - which is how a list you typed one-entry-per-step still gets a shape.

repeat plays the shape N times across the list (20 entries over 4 repeats is 5 per pulse), and loop decides how each repetition follows the last: restart is a sawtooth, ping_pong runs backwards every other cycle, continue climbs on from where the previous one landed, a staircase. reverse flips the finished list, so a fade-in becomes a fade-out. decimals rounds every entry, which is mostly there so 0.30000000000000004 doesn't end up in a filename.

The node draws its list on itself and the points are draggable - dragging writes back into start/end in range mode, or into the matching entry of the values box. Widgets the current mode doesn't read are folded away, so you're not staring at a control panel for a machine you aren't using.

Inputs and outputs

Set these and you're done: mode, start and end (range) or values (values mode), and count. For a per-step LoRA schedule, count should equal your sampler's steps - 20 entries for a 20-step run, one strength per step. Power LoRA Loader does stretch a list to fit the step count, so a mismatch won't break the shape; it just stops being one entry per step, and there's a detail about which value the text encoder sees (the first one) that makes the mapping matter more than it looks.

Outputs, and this is where the wiring choice lives:

  • values - the whole list on one wire. This is the one Power LoRA Loader wants, and the one you feed Number List Plot.
  • NUMBER, floats, ints - the same entries as per-run lists. Wire one of these and the graph executes once for each number instead. That's deliberate: it's how you sweep a value across 20 renders without setting up anything else. Note ints truncates rather than rounds, so 7.6 arrives as 7.
  • count - how many entries the list holds, which is also how many runs the per-run outputs drive.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git

Or ComfyUI Manager, search WAS Node Suite v3, restart. ComfyUI 0.14.0+ on Python 3.10, nothing pip-installed - the repo's requirements.txt is a one-line comment saying there are no default requirements. First start writes the config and support folders under ComfyUI/user/was-node-suite/ and compiles the pack; after that it's quiet.

Where people get burned

count and your step count disagree. The list gets stretched across the run, so a 20-entry schedule on a 30-step sampler still reaches zero at the end - it just isn't one strength per step, and the text encoder only ever gets the first value. Set count to the steps when you want to reason about the schedule step by step.

Wiring a per-run output when you wanted a schedule. floats into a strength input gives you N separate renders, not one render with varying strength. The whole-list output is values, and it's the first one in the row for a reason.

curve doing nothing. If your list is two values and curve_on is transitions, you're bending a single move - easy to read as "the curve is broken". Switch to values to bend the entries themselves, or type more keyframes.

Fractions in filenames. Leave decimals at 6 and the string form of a value can be ugly when it lands in a save prefix. Drop it to 2 or 3 for anything human-facing.

CategoryWAS Suite/Number/Operations

Inputs (11)

NameTypeDefaultDescription
modeCOMBO`range` = from start to end; `values` = through the numbers typed in values, evenly spaced, as `1, 1, 0` for a strength that holds and then fades.
startFLOAT,NUMBER,INT1-1000000000–1000000000The first value in `range` mode, as `1.0` for a strength that starts full.
endFLOAT,NUMBER,INT0-1000000000–1000000000The last value in `range` mode. Below start counts down, as `0.0` for a fade-out.
valuesSTRING,ARRAY,NUMBER,FLOAT,INT1, 1, 0The values `values` mode passes through, separated by commas, spaces or lines, as `1, 1, 0.5, 0`. A LIST can be wired in instead.
countINT200–10000Entries in the list; set it to the sampler's steps for a per-step strength. 0 = one entry per value: start and end, or each typed value.
curveCOMBO`linear` = straight; `ease_in_*` = starts slow; `ease_out_*` = finishes slow; `ease_in_out_*` = both; `*_back`, `*_elastic` = overshoot; `*_bounce` = settles in hops; `hold` = each value kept until the next.
curve_onCOMBO`transitions` = each move from one value to the next follows the curve; `values` = the values themselves are bent between the lowest and highest, which also shapes a list typed one entry per step.
repeatINT11–1000How many times the shape plays across the list, as `4` for four pulses. The entries are shared out, so 20 over 4 repeats is 5 each.
loopCOMBOHow each repeat follows the last. `restart` = from the first value again, a sawtooth; `ping_pong` = backwards every other time, a wave; `continue` = on from where the last ended, a staircase.
reverseBOOLEANfalse`true` = the finished list runs back to front, so a fade-in becomes a fade-out.
decimalsINT60–12Decimal places each value is rounded to, which keeps 0.30000000000000004 out of a filename. 0 = whole numbers.

Outputs (5)

NameTypeDescription
valuesARRAYThe whole list on one wire: a per-step strength for Power LoRA Loader, or a list for Number List Plot and the other list nodes.
NUMBERNUMBEROne NUMBER per entry. A node reading it runs once for each, for a series of renders.
floatsFLOATThe same entries as decimals, one per run.
intsINTThe same entries as whole numbers, one per run, cut off rather than rounded, so 7.6 arrives as 7.
countINTHow many entries the list holds, which is how many runs the per-run outputs drive.