Nodes/RES4LYF/Sigmas GilbreathSequence
ComfyUI Node Runs on cloud

Sigmas GilbreathSequence

Generate a noise schedule from a number-theory conjecture about primes

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
Sigmas GilbreathSequence
    • SIGMAS
    steps30
    levels3
    normalize_rangetrue
    min_value0.01
    max_value10.0

    Gilbreath's conjecture is a genuinely obscure corner of number theory: take the sequence of prime numbers (2, 3, 5, 7, 11...), compute the sequence of absolute differences between consecutive terms, then repeat that differencing process on the result, over and over. The conjecture - still unproven, though checked to enormous ranges - is that the very first number of every one of those difference rows is always 1. Sigmas GilbreathSequence builds a noise schedule from exactly this triangle of repeated differences. It doesn't take an input schedule at all; it generates one from scratch out of prime-number math.

    How it works

    The node walks primes, builds levels rows of the Gilbreath difference triangle, and reads off steps values from it, then rescales the result into the [min_value, max_value] range if normalize_range is on. More levels means more rounds of differencing feeding into the values you get back, which changes the texture of the resulting curve - the whole point of the Gilbreath triangle is that repeated differencing produces a specific, structured-but-irregular pattern, not randomness.

    The inputs and outputs that matter

    • steps (default 30, range 10–100) - how many schedule steps to generate.
    • levels (default 3, range 1–10) - how many rounds of the difference triangle to compute before reading off values.
    • normalize_range (default true) - rescale output into [min_value, max_value].
    • min_value (default 0.01, range 0–10) and max_value (default 10, range 0–50) - the target range after normalization.

    No sigmas input exists on this node - it's a generator, not a transform. Output is a single SIGMAS list.

    Should you use this?

    This is squarely in RES4LYF's novelty-math wing, alongside the strange-attractor and Collatz-conjecture sigma generators. I checked for any community usage or discussion of it and found nothing - not a workflow share, not a forum mention. That's not a knock on the node's correctness, just an honest account of where the evidence stands: nobody has reported using a Gilbreath-sequence schedule to get a better image, and there's no theoretical reason tied to diffusion sampling that a prime-difference pattern should outperform a tuned scheduler like beta57. If you're curious about unusual, deterministic-but-irregular schedule shapes, this is a genuinely interesting one to try. If you want reliable quality, it isn't where the pack's proven gains live.

    How to install it

    • ComfyUI Manager - search "RES4LYF", install, restart.
    • Manual - activate your venv, cd ComfyUI/custom_nodes && git clone https://github.com/ClownsharkBatwing/RES4LYF, cd RES4LYF, pip install -r requirements.txt (portable builds: use the embedded pip.exe). Restart.

    Common issues & troubleshooting

    Output isn't guaranteed monotonically decreasing. The Gilbreath differences don't trend in any particular direction by design - run the result through Sigmas Abs and Sigmas Cleanup before wiring it into a real sampler, and preview it first.

    Higher levels deepens the differencing and can make the curve choppier, not smoother - this isn't a "more levels = more refined" knob in the way step count usually works elsewhere. Change it one value at a time and actually look at what comes out.

    Turning off normalize_range leaves you with the raw triangle values, which are small integers from prime-gap math - nowhere near the magnitude a sampler expects a sigma to be. Leave it on unless you're deliberately post-processing the raw output yourself.

    CategoryRES4LYF/sigmas

    Inputs (5)

    NameTypeDefaultDescription
    stepsINT3010–100
    levelsINT31–10
    normalize_rangeBOOLEANtrue
    min_valueFLOAT0.010–10
    max_valueFLOAT10.00–50

    Outputs (1)

    NameTypeDescription
    SIGMASSIGMAS