A Stable Diffusion seed is the number that creates the random starting noise for an image: the same seed with the same prompt, model, size, sampler, steps, and CFG recreates the same image in the same app, while a new seed gives a new composition. To vary an image, keep its seed and change one setting, or blend in a second seed with AUTOMATIC1111's Variation strength.
What is a seed in Stable Diffusion? The short answer
A seed is the number that starts the random noise Stable Diffusion turns into a picture. Diffusers explains that its pipelines create the initial noisy tensor with a random function, and that passing a seeded generator controls those random values. Same seed, same starting noise; different seed, different starting noise.
That is why one seed can bring an image back and another gives a new one. With the same model, prompt, negative prompt, size, sampler, steps, and CFG in the same app, a fixed seed repeats the result. Change the seed and keep everything else, and you get a new composition of the same prompt.
Seed numbers are labels, not a scale. Neighboring numbers do not make similar images: AUTOMATIC1111 gives the images in one batch the seeds 1234, 1235, 1236, and so on, and each is a separate picture.
How to recreate an image from its seed
First find the seed. AUTOMATIC1111 shows it in the generation info under each image and, its Features wiki says, writes the generation parameters into the PNG as a text chunk; the ‘Reuse seed from last generation’ button next to the Seed field copies it back. ComfyUI writes prompt and workflow fields into PNG outputs, and dragging such a file onto the canvas, or opening it with File → Open, restores the graph with its seed.
Then match everything, not just the number: the same checkpoint or model file, prompt, negative prompt, width and height, sampler and schedule, step count, CFG, and any LoRAs at the same weights. Images saved with stripped metadata, or with ComfyUI's --disable-metadata option, cannot be recovered this way, so keep the original file.
Finally, stop the seed from changing. In AUTOMATIC1111 a seed of -1 (the default) means a new random number on every run, so type the number in. In ComfyUI, set the KSampler's control after generate to fixed; increment and decrement step the seed by one after each run, and randomize picks a new one.
Why the same seed can give a different image
Size is the most common reason. The AUTOMATIC1111 wiki states that changing the resolution normally changes the image entirely, even when every other parameter, including the seed, stays the same. Samplers matter too: ancestral (‘a’) and SDE samplers add new noise at every step, so with them a different step count can change the result; see samplers and schedulers.
The random number generator itself also differs between tools. AUTOMATIC1111 has an RNG source setting (GPU, CPU, or NV) and notes that it changes seeds drastically. Diffusers recommends a CPU generator for reproducibility because a GPU generator can diverge from CPU results. Apple's Core ML port of Stable Diffusion follows NumPy's generator by default and needs a torch or cuda mode to approximate PyTorch output.
Even with all of that matched, the Diffusers maintainers say reproducibility is not guaranteed with an identical seed: library versions, hardware, and numerical precision can shift pixels. Treat a seed as part of a recipe that works inside one setup, and save the image itself alongside it.
PhoneDiffusion generates on-device on iPhone or iPad, with optional cloud models. Download on the App Store →
How to vary an image with seeds
To change one detail while keeping the composition, keep the seed and change one thing: a word in the prompt, the CFG, or the step count. Because the starting noise stays the same, the layout usually holds while the edit shows. Change several things at once and you will not know which one caused the difference.
For small random changes, AUTOMATIC1111 has a second seed. Tick Extra next to the Seed field to show Variation seed and Variation strength. The wiki explains that strength sets how much the picture is altered: at the minimum you keep the original seed's image, except with ancestral samplers, and at the maximum you get the variation seed's image.
The same Extra panel has Resize seed from width and height. Enter the size of the original image, and AUTOMATIC1111 tries to keep that seed's composition at a new resolution; the wiki notes ancestral samplers handle this a little worse. To explore broadly instead, let the seed randomize or step it with ComfyUI's increment mode and keep the best result.
A seed-hunting workflow that works in any app
Fix the prompt, model, size, sampler, steps, and CFG. Generate a small batch with different seeds and pick the composition you like. Write down its seed, or keep the file with metadata.
Lock that seed and refine one setting at a time until the image is right. If you want something close but slightly different, use a low variation strength or try a few new seeds with the improved prompt. Finish with upscaling or inpainting on the image you are keeping, not on every candidate.
PhoneDiffusion availability and article scope
PhoneDiffusion runs curated Core ML model packs on supported iPhone and iPad devices with iOS 17 or later. In the current release there is no seed field: each Generate run picks a new random seed for every image, including each image in a batch, so the way to hunt for a composition is to generate several variations and keep the best one. Optional cloud models (paid monthly or yearly plans) generate online from the text prompt alone and have no seed control either.
To come back to a result, open a saved image and tap Recreate. It restores the model, prompt, negative prompt, style preset, size, steps, CFG, and image-to-image strength (Transformation, or Replacement strength for inpainting), but not the seed, so the next run is a new variation with the same recipe rather than a pixel-for-pixel copy. Live mode keeps one composition while you edit the prompt, and New composition starts from fresh noise. When you save an image to Photos or share it, the app attaches Content Credentials that record the model, workflow, and seed.
The Variation seed, Resize seed, RNG source, and control-after-generate options above describe AUTOMATIC1111 and ComfyUI, not features inside PhoneDiffusion. The app has no general importer for arbitrary checkpoints or LoRAs, and a desktop seed is not promised to reproduce the same image on iPhone.
Field notes
- A seed sets the random starting noise; the same seed and the same settings in the same app repeat the image.
- Neighboring seed numbers are unrelated images, and -1 in AUTOMATIC1111 means a new random seed every run.
- Size, ancestral samplers, the random number generator, and software versions can all change the result of the same seed.
- To vary an image, keep the seed and change one setting, or use Variation seed at a low Variation strength.
Try it on your phone
- Generate a batch with random seeds and pick the composition you like.
- Copy its seed from the generation info or the image metadata and turn off randomizing.
- Keep the model, prompt, size, sampler, steps, and CFG fixed, and change one setting at a time.
- For small changes, add a variation seed at low strength; for a new size, use Resize seed from.
- Save the final image with its full settings, not just the seed number.
Sources and verification
Primary and maintainer documentation checked for this guide. Product-specific details were reviewed against the current PhoneDiffusion scope.
- Hugging Face Diffusers: ReproducibilityMaintainer guide to seeding a Generator for the initial noise, why a CPU Generator is more stable across machines, why a reused Generator gives different results, and why identical seeds are not a guarantee.
- AUTOMATIC1111 Stable Diffusion web UI: Features wiki: Variations, Seed resize, PNG infoProject wiki explaining Variation seed and Variation strength, Seed resize for keeping a composition at a new resolution (weaker with ancestral samplers), that changing resolution normally changes the image entirely, and that generation parameters are saved in the PNG.
- AUTOMATIC1111 web UI: seed controls (modules/processing_scripts/seed.py)Source for the Seed field (default -1), the random and ‘Reuse seed from last generation’ buttons, and the Extra options: Variation seed, Variation strength (0 to 1), and Resize seed from width/height.
- AUTOMATIC1111 web UI: seed handling (modules/processing.py)Source showing that seed -1 or an empty seed is replaced by a new random number, and that images in a batch get seed, seed + 1, seed + 2, and so on when variation strength is 0.
- AUTOMATIC1111 web UI: RNG source setting (modules/shared_options.py)Setting for the random number generator source (GPU, CPU, or NV), documented as changing seeds drastically, with CPU suggested for the same picture across graphics card vendors.
- ComfyUI: KSampler nodeOfficial node reference: seed, steps (default 20), cfg, sampler_name (the sampling algorithm), scheduler (how noise is gradually removed), and denoise.
- ComfyUI frontend: seed control after generate (valueControl.ts)Frontend code for the control_after_generate modes: fixed keeps the value, increment and decrement step it, and randomize picks a new one.
- ComfyUI: Workflow metadata in output filesOfficial reference for the workflow and prompt fields ComfyUI embeds in PNG, WebP, MP4, and WebM outputs, loading them by drag and drop or File → Open, --disable-metadata, and what a workflow does not include.
- Apple: Core ML Stable Diffusion (ml-stable-diffusion)Apple's Core ML port, documenting the --seed option and that its default random number generator follows NumPy, while matching PyTorch output needs the torch or cuda RNG mode and is only approximate.