GU Seed List
Keep a running list of every seed you've tried — and file it away
- seed
- prev_seeds
GU Seed List is a seed with a memory. It takes a seed, and every time the seed is different from the previous one, it appends it to a running list - the history of every seed you've tried. Optionally it writes that list to a text file, and on later runs it can reload the list from that file and keep building on it. When you find a keeper seed, you've got a persistent record of how you got there.
The KB's plumbing essay has the whole story on the underlying ComfyUI seed mechanics - including the control_after_generate trap where the number shown is the next seed, not the one you just used. This node is the antidote: instead of trusting what a widget displays, it records every seed that actually flowed through, which is the version that corresponds to the images in front of you.
What it does
- seed - the seed value, typically wired from a KSampler or a seed generator with
randomize/incrementactive. A seed equal to the last recorded one isn't stored again (that's the "not in fixed mode" logic). - reset_list - on, clears the accumulated list on the next run so accumulation starts over. Ignored when
init_from_fileis on. - init_from_file - on (default), loads the seed list from the file on the first run, then continues. If the file is missing or the name is empty, it starts from scratch.
- store_to_file - on (default), writes the list to the file after every run. The file is overwritten each time, so it always holds the current list.
- filename - the file name only; no path or extension. The node sanitizes a bad name and defaults to
seedfile.txt. - project - optional; connect
GU Project Namehere. When set, the seed file lands in(work)/<project>/seedfile.txt- the same path family as your images. If you type a string manually it must be a path to a file, because the node expects a final-file path.
Outputs: seed (the seed, passed through) and prev_seeds - the full list of previously used seeds as a string list, for wiring into a note node or an info file.
Why the file matters
Two practical reasons. First, persistence across sessions: with init_from_file on, yesterday's seed history is there when you come back today, so you can resume a search instead of losing the trail when ComfyUI restarts. Second, auditability: GU Image Label can caption which seed each image used, and this node records the sequence - together they tell you exactly what you sampled and in what order. The README recommends changing filename per task, because every instance of this node class otherwise overwrites the same default seedfile.txt - if you have several workflows, give each its own file.
The node always executes when the Queue runs (IS_CHANGED NaN), which is required for a list-recorder to be trustworthy.
The storage rules
The same path-confinement security as the rest of the pack applies: both filename and project may address subfolders inside ComfyUI's output folder, but never outside it. A .. path, absolute path, or drive prefix is rejected with a console warning, and neither reading nor writing happens. The "file overwritten every run" behavior is deliberate - the file mirrors the in-memory list, it doesn't append a history log. If you want append-only logging, that's not this node.
Install
ComfyUI Manager → search "GU Nodepack" → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/alexguryev/ComfyUI-GU_Nodepack
cd ComfyUI-GU_Nodepack
pip install -r requirements.txt
Deps: psutil, requests, gu-funclib>=1.9.0. No model downloads. Windows-tested, single-user design.
The gotchas
init_from_file "works only at first run" - and that first-run flag resets when a browser tab connects (the pack's prestartup_script.py hook flips it back), so after a page refresh the list reloads from disk again. If that surprises you, now you know why. And remember the duplicate rule: the same seed twice in a row is not recorded, but re-trying an older seed (after two different ones in between) does get appended. It's a history of transitions, not unique seeds.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| seed | INT | 00–18446744073709550000 | — |
| reset_list | BOOLEAN | false | Force clean previous seeds on next run (ignored if init_from_file) |
| init_from_file | BOOLEAN | true | Load list from a text file (works only at first run!) |
| store_to_file | BOOLEAN | true | Store list to a text file (works at every run! file will be overwritten!) |
| filename | STRING | seedfile | Only name of file (no path or extension! incorrect name will be fixed internally!), will be stored in `tmp` folder |
| projectopt | STRING | recommended to connect to `GU Project Name` node output |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| seed | INT | — |
| prev_seeds | STRING | — |