Skip to content

Commit 5d0cfc9

Browse files
authored
store on the image the actual random seed, for reproducibility (LostRuins#1549)
1 parent 7dc3e3e commit 5d0cfc9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

koboldcpp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,6 +1565,8 @@ def sd_generate(genparams):
15651565
width = tryparseint(genparams.get("width", 512),512)
15661566
height = tryparseint(genparams.get("height", 512),512)
15671567
seed = tryparseint(genparams.get("seed", -1),-1)
1568+
if seed < 0:
1569+
seed = random.randint(0, 2**32-1)
15681570
sample_method = genparams.get("sampler_name", "k_euler_a")
15691571
clip_skip = tryparseint(genparams.get("clip_skip", -1),-1)
15701572

0 commit comments

Comments
 (0)