A diffusion model starts from a tensor of pure noise and gradually refines it into an image. That starting noise looks random, but it is actually produced by a pseudo-random generator, and that generator is fully determined by a single integer: the seed. Fix the seed, and the entire seemingly-random process reproduces exactly.
This is useful for controlled comparisons. Holding the seed fixed while changing only the prompt or the CFG scale lets you tell whether a difference came from that change or just from different noise. A seed worth keeping can be written down and reloaded later.
Seed reproducibility is not absolute, though. A different sampler, different numerical precision, or even different hardware can produce a slightly different result from the same seed — it is safer to assume reproducibility holds only within the same code and environment.
The demo below uses a deterministic pseudo-random generator (mulberry32) seeded by a number to draw a procedural picture, directly showing "same seed = same picture, different seed = different picture" instead of a real model.
When to use
Lock the seed when you want to isolate the effect of one parameter from everything else. Leave it random when you want to keep exploring a spread of different results.