DP Get Seed From Image
Pull the seed back out of a generated image
- image
- seed
- seed_string
You made something great last week, saved the PNG, and now you want to iterate on it - but you never wrote down the seed. This node fishes it back out. It reads the seed that got baked into the image's metadata when ComfyUI saved it, and hands it to you as both a number and a string, ready to feed into a KSampler so you can pick up exactly where you left off.
That's the whole job, and it's more useful than it sounds. ComfyUI embeds generation data into output PNGs by default - the workflow and its parameters ride along inside the file. This node targets the seed specifically, which is the one value you need to reproduce or branch from a result. Recover the seed, reload the same prompt and settings, and you're back in the same neighborhood of latent space.
The inputs and outputs
image(IMAGE) - the image you're reading from, wired in from a loader.filename(STRING) - the file to read the seed out of. This matters more than it looks: a raw IMAGE tensor flowing through the graph has been decoded to pixels and no longer carries the PNG's embedded text metadata. Pointing the node at the actual filename is how it gets back to the saved file to read what was stored in it.
Outputs are seed (INT) - plug straight into a sampler's seed field - and seed_string (STRING), the same value as text for logging, display, or building a filename.
When you'd reach for it
Reproducibility and debugging, mostly. You're doing a series and want every image to branch from one known seed. Or you're troubleshooting - "why does this one look different" - and need to confirm what seed actually produced a given output. Or you're building a gallery and want the seed printed alongside each result. Anywhere the seed is the thing you forgot to save, this recovers it.
How to install it
ComfyUI Manager: search ComfyUI-Desert-Pixel-Nodes, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes
then restart. No models or heavy dependencies. Under the "DP" analyze category.
Common issues & troubleshooting
It returns nothing / a zero seed. The image has no seed metadata to read. This happens when the PNG was stripped of its metadata - re-saved through an editor, exported by another tool, screenshotted, or run through something that discarded the text chunks. Only files that still carry ComfyUI's original embedded data will give up a seed. Reposting platforms and image editors are the usual culprits that wipe it.
I gave it an IMAGE but no filename and got nothing. Expected - the decoded tensor doesn't carry the metadata; the node needs the filename to reach the file on disk where the seed is actually stored. Make sure the filename points at the original, un-re-saved PNG.
The seed's right but my regeneration looks different anyway. The seed alone isn't enough - the model, prompt, sampler, scheduler, steps, and CFG all have to match too. The seed reproduces the noise; everything else has to be identical to reproduce the image. If any of those drifted, so will the result.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| filename | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| seed | INT | — |
| seed_string | STRING | — |