ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

The way random seed works

Open Lumos99x opened this issue 2 years ago • 1 comments

Randomize the seed after generating img feels abit weird to use and become annoying when i try to get the seed of the last image. Could you guys add an option to change it to random it at the start of generation process?

Lumos99x avatar Mar 21 '23 13:03 Lumos99x

#93 aims to fix this

PladsElsker avatar Mar 22 '23 09:03 PladsElsker

Does not seem it is progressing anymore? I find it exceptionally weird why it was done "after gen" in first place. But another thing - how does it work with batches?! Like wth? I have fixed seed, bach size 4. I like image 3, and want to work/tweak it, so reduce batch to 1, and ... good luck to me? incrementing seed 2 times or whatever, I can't get images apart from first. Actually not even first, jesus... @comfyanonymous what's up with batches? image The image differs, nothing was changed, but batch size! image

morphles avatar Apr 28 '23 18:04 morphles

If you want to pick an image from a batch use LatentFromBatch. You can use it before or after the sampler. Using it before will make it generate only the image at that batch index.

The difference is because you are using SDE which isn't a deterministic sampler right now. I'll probably fix it eventually.

comfyanonymous avatar Apr 28 '23 18:04 comfyanonymous

But doesn't this mean that first batch will be generated and only then I can continue? i.e. if I edit promp to tweaks something just a bit, it will first need to regen batch, in full - means I can't speed stuff up by just working on one sized batch. Also just tested with euler, and there are differences too (same as in screenshots, just changed sampler to euler). Though differences are way less drastic.

morphles avatar Apr 28 '23 18:04 morphles

If you use LatentFromBatch BEFORE the sampler it will only generate one image.

If you are using xformers, update to 0.0.19 and it should be deterministic.

comfyanonymous avatar Apr 28 '23 18:04 comfyanonymous

Hm, so managed to update xformers, and using euler, still there are some differences, with latent from batch.

morphles avatar Apr 28 '23 19:04 morphles

Does this behaviour also happen with the default workflow?

comfyanonymous avatar Apr 28 '23 19:04 comfyanonymous

image So just tried, but had to tweak a bit. 512 is too small to notice anything at least for me. Then I incremented to 1024, was able to see some small difference. Then somehow though with less steps it would be more pronounced, but I was wrong and could not see anything @10, so then I tried 1024@30 and I can see differences, not sure if more than @20.

morphles avatar May 01 '23 17:05 morphles