Does an image's position and the batch size change which image I get for a given seed (ComfyUI and diffusers), and how do I regenerate one image from a batch on its own?
Corrected 2026-10-23 - see C3-B681-09; the original statements below are kept for history and are superseded where the correction says so. In ComfyUI the default KSampler path (a latent with no batch_index) draws noise for the whole batch in one call, while a latent that carries batch_index gets noise per index, so a picked-out image can be regenerated from its index; LatentBatchSeedBehavior 'fixed' (the node default) gives every batch item the same index and so the same starting noise. Diffusers does the same split with a single generator (one draw for the batch) versus a list of generators (one draw per image). Separately from RNG, a 2023 diffusers thread reports that batch size changed the image on three GPUs even with equal seeds, and a maintainer attributed this to different CUDA kernels per batch size (a claim); the reporter's workaround was to regenerate the wanted image at batch size 1 with deterministic flags.
Structured fields
{
"citations": [
{
"url": "https://github.com/Comfy-Org/ComfyUI",
"note": "see C3R-0118 (sample.py, nodes_latent.py, nodes.py at 1a82e6d0); gh api -X GET repos/huggingface/diffusers/issues/2659 and /comments (2026-10-22; live JSON, not hashed); gh api -X GET repos/huggingface/diffusers/issues/6222/comments (2026-10-22; live JSON)"
},
{
"url": "https://github.com/Comfy-Org/docs/blob/506a4a94db30524adb8706667aec050d71dbdf60/built-in-nodes/LatentBatchSeedBehavior.mdx",
"note": "see C3R-0118 (sample.py, nodes_latent.py, nodes.py at 1a82e6d0); gh api -X GET repos/huggingface/diffusers/issues/2659 and /comments (2026-10-22; live JSON, not hashed); gh api -X GET repos/huggingface/diffusers/issues/6222/comments (2026-10-22; live JSON)"
},
{
"url": "https://github.com/huggingface/diffusers/blob/7e4383c0a2aeb384f3d3e0003b013a40c9b1e843/docs/source/en/using-diffusers/reusing_seeds.md",
"note": "see C3R-0118 (sample.py, nodes_latent.py, nodes.py at 1a82e6d0); gh api -X GET repos/huggingface/diffusers/issues/2659 and /comments (2026-10-22; live JSON, not hashed); gh api -X GET repos/huggingface/diffusers/issues/6222/comments (2026-10-22; live JSON)"
},
{
"url": "https://github.com/huggingface/diffusers/issues/2659",
"note": "see C3R-0118 (sample.py, nodes_latent.py, nodes.py at 1a82e6d0); gh api -X GET repos/huggingface/diffusers/issues/2659 and /comments (2026-10-22; live JSON, not hashed); gh api -X GET repos/huggingface/diffusers/issues/6222/comments (2026-10-22; live JSON)"
},
{
"url": "https://github.com/huggingface/diffusers/issues/6222",
"note": "see C3R-0118 (sample.py, nodes_latent.py, nodes.py at 1a82e6d0); gh api -X GET repos/huggingface/diffusers/issues/2659 and /comments (2026-10-22; live JSON, not hashed); gh api -X GET repos/huggingface/diffusers/issues/6222/comments (2026-10-22; live JSON)"
},
{
"url": "https://api.github.com/repos/huggingface/diffusers/issues/2659/comments",
"note": "correction source (record C3-B681-09): comment by patrickvonplaten, 2023-03-15; comment by kig, 2023-03-14; comment by vvsotnikov, 2023-05-22"
}
]
}Evidence claims
- [sourced_fact] In ComfyUI the default KSampler path (a latent with no batch_index) draws noise for the whole batch in one call, while a latent that carries batch_index gets noise per index, so a picked-out image can be regenerated from its index; LatentBatchSeedBehavior 'fixed' (the node default) gives every batch item the same index and so the same starting noise. Diffusers does the same split with a single generator (one draw for the batch) versus a list of generators (one draw per image). Separately from RNG, a 2023 diffusers thread reports that batch size changed the image on three GPUs even with equal seeds, and a maintainer attributed this to different CUDA kernels per batch size (a claim); the reporter's workaround was to regenerate the wanted image at batch size 1 with deterministic flags. · locator: see C3R-0118 (sample.py, nodes_latent.py, nodes.py at 1a82e6d0); gh api -X GET repos/huggingface/diffusers/issues/2659 and /comments (2026-10-22; live JSON, not hashed); gh api -X GET repos/huggingface/diffusers/issues/6222/comments (2026-10-22; live JSON) source
Rights
| component | license | hosting | redistribution | modification | training | Evidence and notes |
|---|---|---|---|---|---|---|
| documentation | unknown | permitted | permitted | unknown | unknown | Applies to this original summary only, not to the cited sources. |
Linked records
- cites → https://github.com/Comfy-Org/docs/blob/506a4a94db30524adb8706667aec050d71dbdf60/built-in-nodes/LatentBatchSeedBehavior.mdx
- cites → https://github.com/comfy-org/comfyui
- cites → https://github.com/huggingface/diffusers/blob/7e4383c0a2aeb384f3d3e0003b013a40c9b1e843/docs/source/en/using-diffusers/reusing_seeds.md
- cites → https://github.com/huggingface/diffusers/issues/2659
- cites → https://github.com/huggingface/diffusers/issues/6222
- cites → https://api.github.com/repos/huggingface/diffusers/issues/2659/comments