ComfyUI Node

AM Seed

The seed node that actually survives a render farm

By am-pipeline-prod·Created 4 months ago·Updated 3 months ago· 3
AM Seed
    • seed
    moderandomize
    value0
    step1
    min0
    max2147483647

    Every ComfyUI user learns the seed lesson the hard way: you generate something perfect, re-queue it a week later, and get something completely different because the seed that ran wasn't the seed the workflow said it had. That's comfyanonymous/ComfyUI#11905, and AM Seed is a deliberate fix for it - a seed node designed for render farms, where the same workflow gets executed days later on a different host and has to reproduce exactly.

    It's part of comfyui-am-vfx-tools ("AM VFX Tools" category), Adrian Meyer's 13-node VFX toolkit - the public, generic subset of an internal studio pipeline. This is one of those nodes that exists because a studio actually hit the problem.

    Why it's farm-safe

    Stock seed handling in ComfyUI has a nasty edge: whether a "random" seed gets captured at queue time or re-rolled at execution can vary, and when two output nodes aren't wired together, execution order decides what value lands in your file metadata. That's how you end up with a PNG that says seed 12345 while the console log shows 67890.

    AM Seed sidesteps the whole class of bug. Its mode logic runs server-side, so a headless farm behaves identically to your desktop. And its resolved seed is published to the pack's process-global registry at IS_CHANGED time - before any node executes - so AM Write Image / AM Write Video can look it up and write it into file metadata with a guaranteed-consistent value. You don't have to wire the seed to the write node at all; if the writer's seed widget is -1, it finds the AM Seed in the prompt and uses that.

    The inputs

    Four widgets, but you'll live in two:

    • mode - randomize (fresh draw each prompt, the default), fixed (emit value), increment / decrement (step by step per execution).
    • value - the base for fixed/increment/decrement modes. Ignored in randomize.
    • step - how much increment/decrement advances per execution.
    • min / max - the randomize bounds and the clamp for everything else. max defaults to 2,147,483,647 (int32 max) because some API nodes reject bigger seeds.

    One output: seed (INT), which you wire into any sampler that takes a seed input.

    One deliberate naming quirk: the widget is called value, not seed. ComfyUI auto-appends a control_after_generate widget to any INT named seed or noise_seed, and that frontend widget would fight the server-side mode logic. Renaming it is the fix, and now you know why.

    Installing it

    Same as every node in the pack - install once, get all 13:

    cd ComfyUI/custom_nodes
    git clone https://github.com/am-pipeline-prod/comfyui-am-vfx-tools.git
    cd comfyui-am-vfx-tools
    pip install -r requirements.txt
    

    Restart ComfyUI. Or search comfyui-am-vfx-tools in ComfyUI Manager.

    Where people get burned

    If you've got an existing workflow, AM Seed isn't a drop-in for the KSampler's built-in seed field - you wire its output into the sampler's seed input and set the sampler to use the wired value. And one honest caveat: the registry lookup keys on the AM Seed being present in the prompt. If you bypass the pack's write nodes or delete the AM Seed, the metadata hookup stops being automatic. For anything else - reproducibility across requeues, batch stepping, farm renders - this is the node that does what you always assumed the stock seed did.

    CategoryAM VFX Tools/Util

    Inputs (5)

    NameTypeDefaultDescription
    modeCOMBOrandomizeSeed selection mode. randomize = fresh draw from [min,max] each prompt (default). fixed = emit `value` clamped to [min,max]. increment / decrement = `value ± step·n` per execution, clamped at the bounds. Mode logic runs server-side so it behaves identically on headless render farms.
    valueINT00–2147483647fixed: emitted directly (clamped to [min,max]). increment / decrement: starting base; advances by `step` per execution. randomize: ignored — a fresh value is drawn from [min,max].
    stepINT11–1000000increment / decrement step. Ignored in fixed / randomize modes.
    minINT00–2147483647Lower bound used by randomize and as a clamp for the others.
    maxINT21474836470–2147483647Upper bound used by randomize and as a clamp for the others. Default 2,147,483,647 (int32 max) for compatibility with API nodes that reject larger seeds.

    Outputs (1)

    NameTypeDescription
    seedINTResolved seed value. Wire into samplers / API nodes that take a seed input. AM Image Write / AM Video Write also pick up this seed automatically via the process-global registry (their `seed` widget at -1 = look up).