Images
What is a seed in AI image generation?

Key takeaways
A seed is a number that fixes the random noise an image model starts from. Same seed, same prompt, and same settings should give the same picture on the same setup.
The seed controls only the starting point. Change the prompt, model, resolution, or sampler and the same number gives a different image.
Reproducibility has limits. Different GPUs, library versions, and some samplers can change the result, and some hosted models take no seed at all.
Seed hunting means running one prompt across many seeds, keeping the composition you like, and then refining that one seed.
Save the seed with every image you might want back, ideally in the file's metadata.
What is a seed in AI image generation?
A seed is the number that sets the random starting noise for an image. A diffusion model doesn't draw from a blank canvas. It begins with a field of random values and removes noise step by step until a picture appears, and the seed decides which random field it starts with.
That's why the same prompt gives a different image each time you press generate. Hugging Face's Diffusers documentation says "Diffusion is a random process that generates a different output every time." Fix the seed and you fix the randomness, which is how people bring a favorite image back or test one change at a time.
How a seed turns into an image
Most current image models work in a compressed "latent" space instead of on raw pixels, a design laid out in the latent diffusion paper. The Diffusers docs say pipelines "rely on" the torch.randn function to create the initial noisy tensors, and the seed feeds that random number generator. The same generator can also supply the extra noise some samplers add along the way.
So a seed is an input, much like the prompt. It sets neither a style nor a quality level. A seed of 42 does not produce a certain kind of image. It is one particular arrangement of noise, and the model's training decides what that noise turns into.
Seed ranges depend on the software. ComfyUI's KSampler node documents a range of 0 to 18446744073709551615 and says that using the same seed "generates identical images." Black Forest Labs' API schema for FLUX 3 Image Klein takes an integer from 0 to 4294967295 and says it's random when omitted.
When the same seed gives the same image
The easy case is local generation on one machine. Keep the checkpoint, prompt, negative prompt, image size, step count, guidance scale, sampler, and seed identical, and you should get the same picture back. Changing any one of them can break the match.
Size trips people up most. A1111's feature wiki notes that "when you change resolution, the image changes entirely, even if you keep all other parameters including seed." That's because the noise field has a different shape at a different size, so there's no way to carry it over unchanged. A1111 offers a "seed resize" option to get a similar composition at a new size, though the same page says ancestral samplers are "a little worse at this than the rest."
In ComfyUI, the sampler also has a setting that changes the seed after every run. The docs describe it as the ability to change the seed after each prompt, with Random, Inc, Dec, and Keep as the options. If an image refuses to reproduce, check that setting first, since a seed set to change after every run is no longer the seed you saved.
Where the same seed stops working
Reproducibility usually holds, but it isn't guaranteed. The Diffusers reproducibility guide says so in its closing lines, noting that you can try to limit randomness but it is "not guaranteed even with an identical seed."
What changes | What can happen | What helps |
|---|---|---|
GPU instead of CPU for the noise | Same seed, different noise. Diffusers says a GPU generator "can diverge from CPU results." | Use a CPU generator, which the guide says is "more stable across machines" |
Different hardware or library version | Results can drift, and the guide points to PyTorch's reproducibility notes | Keep the same GPU, drivers, and library versions |
Non-deterministic GPU operations | Two runs on one machine can differ slightly | Turn on deterministic algorithms, which "may be slower" |
Different sampler or scheduler | A different path from noise to image | Record the sampler with the seed |
Different model version | The noise means something else to new weights | Treat a seed as tied to one checkpoint |
One more gotcha is how code handles the seed. Diffusers explains that a generator object "keeps a random state that is consumed and updated when you use it," so reusing the same object for a second image doesn't repeat the first. You have to reseed or build a new generator before each call.
When a hosted model ignores the seed
Whether you get a seed depends on how the model is exposed, and plenty of hosted tools don't give you one.
OpenAI's image generation guide lists parameters such as prompt, size, quality, and output format, and doesn't mention a seed. Black Forest Labs' API schema lists a seed field for FLUX 3 Image Klein, but the request fields for FLUX 3 Image show none. If you need repeatable output from a hosted model, check its API reference before you plan a workflow around it. Our FLUX 3 Klein vs. FLUX 3 Image comparison covers how the two differ in other ways.
Even where a seed exists, it can come with conditions. Google's Vertex AI documentation for Imagen says a seed number makes "non-deterministic generated images deterministic," but that you can use the seed field for deterministic output only when digital watermarking is turned off with the addWatermark parameter set to false. The same page says there's no guarantee the images come back in the same order each time.
Seed hunting
Seed hunting means replaying the same lottery with different tickets. You write one prompt, generate a batch with different seeds, and look for the composition, pose, or lighting you like. Then you keep that seed and refine everything else around it.
Because the seed shapes the broad layout, a good one holds a composition steady while you change smaller things. Swap the jacket color or adjust a word in the lighting and the picture often stays recognizably the same scene. That's useful, though it is not a guarantee, since a prompt edit can pull the image somewhere new.
A few habits keep a hunt efficient.
Hunt at a low step count first, then rerun the winner at full quality, keeping the image size fixed.
Write down the seed, sampler, step count, guidance scale, and model alongside it.
Change one setting at a time so you know what moved the result.
Variations and locked prompts
A seed gives you a controlled way to ask for "similar, but not identical." A1111's wiki describes a variation seed and a variation strength slider. In its words, "At maximum strength, you will get pictures with the Variation seed, at minimum - pictures with the original Seed." Values in between sit somewhere between the two. The wiki adds an exception for ancestral samplers, so check which sampler you're on.
A locked prompt is the other half. Keep the wording fixed and let the seed be the only thing that moves, and you get a clean set of alternatives to choose from. Reverse it by holding the seed and editing the prompt, and you can see what each phrase does. Our piece on whether negative prompts still matter covers one place where that kind of testing pays off.
Seeds do not hold a character's face across scenes, though. A new prompt describing a new pose and setting sends the model down a different path even with the number unchanged, which is the pattern behind identity drift. Reference images and trained adapters do that job better, as our character bible guide explains.
How to keep a seed you like
Most local tools can recover a seed after the fact. ComfyUI's workflow metadata docs say that when it saves an output file, it "can store the workflow that produced the file inside the file itself," and that you recover it by dragging the file onto the canvas. Since the seed is a setting on the sampler node, it comes back with the workflow. The docs also describe a disable-metadata command-line flag and a Desktop setting that turn embedding off, and files made with embedding off can't be used to recover a workflow.
If a site or app strips metadata, or you convert images to another format, write the seed in the file name or a notes document at the time.
AI image seed FAQ
Is a seed the same as a prompt?
No. The prompt describes what you want, and the seed picks the random noise the model starts from. The same prompt with a different seed gives a different picture of the same idea.
Does a higher seed number mean a better image?
No. The number carries no quality ranking. It labels one arrangement of noise, and 7 is as likely to give a good picture as 7,000,000.
Why doesn't my seed give the same image on another computer?
Different GPUs, drivers, or library versions can change the math enough to alter the result. Diffusers says results aren't guaranteed even with an identical seed, and that using a CPU generator is "more stable across machines."
Why does changing the image size change everything?
The starting noise is generated at the size you ask for. A different resolution makes a different noise field, so the same seed no longer maps to the same picture.
Do all AI image generators let you set a seed?
No. Local tools such as ComfyUI expose it, and some APIs do, but others don't list a seed field at all. Check the model's API reference or settings before relying on one.
