Nodes/Advanced Sequence Seed Generator/Advanced Sequence Seed Generator
ComfyUI Node

Advanced Sequence Seed Generator

Your next seed is a Fibonacci number (or a prime, Pell, or Catalan one)

By florestefano1975·Created 2 years ago·Updated about a year ago· 2
Advanced Sequence Seed Generator
    • INT
    sequence_type
    max_sequence_length20
    seed_range_start0
    seed_range_end19
    force_recalculationtrue
    current_seed0
    noise_factor0.00

    The Advanced Sequence Seed Generator (AdvancedSequenceSeedNode, from the tiny ComfyUI-Advanced-Sequence-Seed pack by AI Wiz Art) does one thing: instead of rolling a plain random integer for your KSampler seed, it picks one from a real number sequence - Fibonacci, primes, Padovan, triangular, Catalan, Pell, or Lucas. One INT out, straight into whatever seed input is driving your generation.

    Let me be honest about the math before you fall for the packaging: the sampler doesn't know or care whether your seed is 89 (a Fibonacci number) or 87654321. A seed is just an int that seeds the noise. The sequences are flavor - but flavor with a function. Because they're deterministic, they give you a reproducible ladder of seeds you can climb one at a time and actually retrace, which is more than the built-in "randomize" button ever gives you. If you do the classic seed-farming loop from the community playbook - lock the seed, change one variable, compare - this node is a pleasant way to farm: every run hands you a different seed and then shows it to you.

    How it actually works

    The code is ~120 lines, pure Python stdlib, no hidden deps. Each execution it:

    1. Generates max_sequence_length terms of the chosen sequence.
    2. Slices out sequence[seed_range_start : seed_range_end + 1].
    3. Picks a random element from that slice and returns it as the INT.
    4. Sends the result to the frontend, and a bundled JS extension writes it back into the current_seed widget so you can read and copy it.

    The clever bit is IS_CHANGED: when force_recalculation is on (or current_seed is 0), it returns NaN, which tells ComfyUI "always rerun me." So a fresh seed lands every time you hit Queue - not just when you poke the graph.

    The inputs that matter

    • sequence_type - the seven sequences. Fibonacci, primes, and triangular stay small and friendly; Pell, Catalan, and Lucas grow fast.
    • max_sequence_length (default 20, up to 1000) - how many terms to generate. More terms, bigger numbers, wider pick.
    • seed_range_start / seed_range_end (default 0–19) - which slice of the sequence the random pick happens in. Default covers the first 20 terms.
    • force_recalculation (default on) - on means fresh seed every run; off holds whatever current_seed says.
    • current_seed - the readout you copy when you finally land a good one.
    • noise_factor (optional, 0–1) - wobbles the seed by ±n% (int(seed + uniform(-n, n) * seed)). 1.0 swings a seed by 100%, so keep it around 0.05–0.2.

    Wiring it in

    Plug the INT output into the seed input of your KSampler, Empty Latent Image, or any node with a seed pin. It's flagged as an output node, so ComfyUI treats it as an endpoint and always executes it - fine sitting mid-graph. Set force_recalculation on for a new roll each generation; when one lands, copy current_seed into a plain seed node (or flick recalculation off) to lock it in.

    Install

    Via ComfyUI Manager, search "Advanced Sequence Seed Generator" and hit install. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/florestefano1975/ComfyUI-Advanced-Sequence-Seed
    

    Restart ComfyUI, and you'll find it in the AI Wiz Art category. No model downloads, no requirements.txt, no torch tricks - it only imports Python's random/math and ComfyUI's own PromptServer. It's registered in the Comfy Registry (the repo has a publish action), so Manager finds it easily. This is donation-ware: the author asks for a ko-fi (stefanoflore75) and sells workflows on stefanoflore.it.

    Gotchas

    • "Invalid range specified for the sequence" - a real ValueError, thrown when your slice comes out empty, usually because seed_range_start ≥ sequence length. Just raise max_sequence_length.
    • Don't crank the length to 1000 on the fast sequences. Python happily returns a Pell number with hundreds of digits, but that's not a seed a sampler can use, and the current_seed widget caps at 10 digits - the number you see stops being the number that ran. At the default 20, even Catalan stays at 10 digits. Stay modest.
    • Expecting a re-roll and getting the same image? force_recalculation got switched off. Turn it back on.
    • Zero community footprint. As of mid-2026 nothing about this pack or author shows up in reddit's comfyui/StableDiffusion threads - no write-ups, no complaints. That means no one's solved your problems for you; the good news is the source is short enough to read top to bottom in two minutes.

    It's a niche little widget, but if the built-in seed button feels too boring and you like your randomness math-flavored, this is a charming, dependency-free way to never see the same seed twice.

    CategoryAI WizArt

    Inputs (7)

    NameTypeDefaultDescription
    sequence_typeCOMBO7 options: Fibonacci, Prime, Padovan, Triangular, Catalan, Pell, +1
    max_sequence_lengthINT202–1000
    seed_range_startINT00–999
    seed_range_endINT191–1000
    force_recalculationBOOLEANtrue
    current_seedINT00–9999999999
    noise_factoroptFLOAT0.000–1

    Outputs (1)

    NameTypeDescription
    INTINT