store on the image the actual random seed, for reproducibility (#1549)

This commit is contained in:
Wagner Bruna 2025-05-21 12:40:47 -03:00 committed by GitHub
parent 7dc3e3e64b
commit 5d0cfc9db3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1565,6 +1565,8 @@ def sd_generate(genparams):
width = tryparseint(genparams.get("width", 512),512)
height = tryparseint(genparams.get("height", 512),512)
seed = tryparseint(genparams.get("seed", -1),-1)
if seed < 0:
seed = random.randint(0, 2**32-1)
sample_method = genparams.get("sampler_name", "k_euler_a")
clip_skip = tryparseint(genparams.get("clip_skip", -1),-1)