Nodes/Remembering utils/Show Last Seed
ComfyUI Node

Show Last Seed

See the seed that actually ran, written on the node

By bombless·Created 2 years ago·Updated 2 years ago· 0
Show Last Seed
    • STRING
    seed

    Show Last Seed is the visible half of the "Remembering utils" pack. Wire a KSampler's seed into it, run your generation, and the number that actually produced your image appears right on the node body. You stop having to open the PNG metadata every time you want to know what you're looking at.

    What it's actually for

    ComfyUI embeds the seed in every output image's metadata, which is great for record-keeping and annoying for quick checks. If you're queuing a batch of seeds and want to know which number made the keeper without alt-tabbing to an image viewer, this puts the answer on the canvas. The name is slightly off, though: it doesn't show the seed you just typed - it shows the seed of the last completed run. More on that below.

    There's also a second, sneakier use: the node returns the seed as a STRING, not just a number. That means you can wire it into a text node, a filename builder, or anything that consumes text - which comes in handy when you want the seed to travel as part of a label or a log instead of a plain integer.

    How it works

    The backend does two things every time it runs: it returns str(seed) as its output, and it pushes the seed to the browser over ComfyUI's WebSocket (PromptServer.instance.send_sync). A tiny frontend extension in the pack catches that message and stashes the value as next. Then - and this is the "remembering" part - it only writes that value to the screen when ComfyUI's progress event reports the run is finished. So the number painted on the node is always the value from the run that just completed, not the one in flight. During a generation it keeps showing the previous seed.

    Inputs and outputs

    • seed (INT) - the only input you set. Usually a KSampler's seed output, or a seed primitive.
    • Output STRING - the seed as text, passed through unchanged.

    The node also reports its own internal id to the frontend so the extension knows which canvas node to paint - that's handled entirely behind the scenes and you never see or touch it.

    One thing to know before you build anything on it: Show Last Seed is an output node (OUTPUT_NODE = True), so it's a terminal - put it at the end of the branch you care about and ComfyUI will always execute it.

    Installing it

    Same as every node in this pack, and it's about as painless as custom nodes get. In ComfyUI Manager, search for "Remembering utils" (registry-published v1.0.2), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bombless/comfyUI-RememberingUtils
    

    Restart ComfyUI after installing. There are zero Python dependencies and zero model downloads - the pack is a couple of short Python files plus one JavaScript file. Nothing heavy lurking.

    Where people get burned

    • It's blank until you run something. The first next only gets committed when a run finishes, so a freshly placed node shows nothing. That's expected, not a bug.
    • It shows the last completed run, not the latest value. Change the seed, hit queue, and the node still displays the old number until the new generation actually lands. If your queue is cancelled or fails mid-run, it stays stuck on the previous value.
    • It has to execute to be useful. If the node is bypassed or pruned from the graph, no event fires and nothing draws. Leave it wired in as a proper leaf.
    • The pack has no documentation at all. The GitHub repo ships with an empty README and there's an open issue literally titled "Some info maybe?" asking the author for a hint. So the source code is your manual - fortunately, at this size, reading it takes about two minutes, and that's also your best security check for a custom node.

    If you just want the seed on screen after every run, this is the node to reach for. It won't randomize, it won't remember history, and it doesn't auto-paste into anything - it's a readout with a text passthrough, and it does that one job cleanly.

    Categoryutils

    Inputs (1)

    NameTypeDefaultDescription
    seedINT

    Outputs (1)

    NameTypeDescription
    STRINGSTRING