diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index 3b816ea..5f09eba 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -970,6 +970,9 @@ class Script(scripts.Script): p.n_iter = 1 p.batch_size = 1 + initialseed = p.seed + if p.seed == -1: + p.seed = int(random.randrange(4294967294)) if(silentmode and workprompt != ""): print("Workflow mode turned on, not generating a prompt. Using workflow prompt.") @@ -987,8 +990,8 @@ class Script(scripts.Script): # prefixprompt = "" - - + state.job_count = batches + for i in range(batches): if(silentmode == False): @@ -1059,14 +1062,21 @@ class Script(scripts.Script): processed = process_images(p) images += processed.images infotexts += processed.infotexts + + # prompt and seed info for batch grid all_seeds.append(processed.seed) all_prompts.append(processed.prompt) - - # Only move up a seed, when there are multiple batchsizes, and we had the first one done. - if(initialbatchsize != 1): - p.seed += 1 - p.seed +=1 + # prompt and seed info for individual images + all_seeds += processed.all_seeds + all_prompts += processed.all_prompts + + state.job = f"{state.job_no} out of {state.job_count}" + + # Increase seed by batchsize for unique seeds for every picture if -1 was chosen + if initialseed == -1: + p.seed += batchsize + # just return all the things p.n_iter = 0 p.batch_size = 0