Seeds, samplers and reproducibility
Where the randomness actually is
Everything in the denoising loop is deterministic arithmetic. Given the same inputs, the network returns the same output every time. The variety in generated images comes from one place: the block of random numbers the loop starts from.
That block is produced by a pseudorandom generator, and a seed is the number that generator starts from. Seed 42 always produces the same static, so seed 42 with the same prompt, model, sampler, steps and guidance always produces the same picture. Change the seed and every number in the starting static changes, which changes the composition entirely — not slightly.
This makes the seed the most useful control in the interface and the one beginners ignore. Fixing the seed converts generation from a slot machine into an experiment: change one thing, see what that thing did. Vary the seed and you are comparing two different pictures, which tells you nothing about the change you made.
Samplers: different routes, same destination
The sampler is the rule for turning the noise prediction into the next latent. They divide into two families, and the division matters more than the names.
Deterministic samplers — Euler, DDIM, DPM++ 2M, and the various "Karras" variants — follow a fixed path from the starting noise. Same seed, same result, every time. Increasing the steps refines the path toward the same picture.
Ancestral and stochastic samplers — anything with an a or SDE in the name, such as Euler a or DPM++ 2M SDE — inject fresh noise at each step. They often produce livelier textures, and they have two consequences people find baffling. The image keeps changing as you add steps rather than converging. And reproducing a result requires the same step count exactly, because the extra noise is drawn per step.
If you are exploring, ancestral samplers are pleasant. If you are working — comparing prompts, testing a fine-tune, building a batch that must match — use a deterministic sampler and you remove a variable you do not need.
What "the same seed" fails to preserve
This trips up everyone who tries to reproduce someone else's result and concludes their software is broken. Seed and prompt are not sufficient. All of the following change the picture:
- The model file, including a different quantisation of the same model.
- Step count, guidance scale, sampler, and the schedule variant.
- Output resolution, including a change of aspect ratio.
- The library version, which occasionally changes rounding.
- The hardware. Different GPUs, and CPU versus GPU, produce slightly different floating-point results that compound over thirty steps into a visibly different image.
The last one surprises people. Bit-identical reproduction across machines is not something these pipelines promise. What is reproducible is the same machine, same versions case, which is what you need for your own work.
Seed discipline, in practice
A workflow that costs nothing and saves hours:
- Explore with random seeds until something is roughly right.
- Note that seed. Every serious tool displays it after generation, and most write it into the PNG.
- Fix it, then change exactly one thing at a time.
- When you have the settings, sweep seeds with everything else locked to get variations of the same idea.
There is a habit worth adopting from research practice. Never judge a prompt change on one seed. A single generation tells you what happened to one sample; four fixed seeds tell you what happened to the prompt. Teams have shipped worse prompts than the ones they had because a lucky seed made the change look like an improvement.
Two final notes. Seed -1 or random means the tool picks one for you and reports it afterwards — it is not a special mode, and the number it picked is recoverable. And seeds are not portable in any meaningful sense: seed 42 on one model has nothing in common with seed 42 on another, because the starting noise is the same numbers but everything that interprets it is different.
One further use of seeds is worth having. Because the starting noise determines composition, a seed you like is effectively a reusable layout. Keep a short list of seeds that gave you good framing for a given aspect ratio, and reuse them when you change the subject: the horizon, the placement of the figure and the balance of the frame carry over surprisingly often within a single model. Illustrators who work in sets — a series of covers, a run of cards — get consistency this way far more cheaply than by describing the composition in words. It stops working the moment you change model or resolution, which is a good reminder of what a seed actually is.
The one thing to keep
The seed fixes the starting noise and the sampler decides the path away from it, so a result is only reproducible when both are recorded along with every other number.
Before you move on
A colleague sends you a prompt, a seed and a screenshot. You run it and get a clearly different image. What is the most likely cause, assuming neither of you made a mistake?
Pick the one you would defend. Nobody sees your answer.