Skip to content

Commit

Permalink
Prompts from file not working AUTOMATIC1111#379
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Sep 13, 2022
1 parent 9ea44c7 commit afbb350
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/prompts_from_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@ def run(self, p, data: bytes):
lines = [x for x in lines if len(x) > 0]

batch_count = math.ceil(len(lines) / p.batch_size)
print(f"Will process {len(lines)} images in {batch_count} batches.")
print(f"Will process {len(lines) * p.n_iter} images in {batch_count * p.n_iter} batches.")

p.batch_count = 1
p.do_not_save_grid = True

state.job_count = batch_count

images = []
for batch_no in range(batch_count):
state.job = f"{batch_no} out of {batch_count}"
p.prompt = lines[batch_no*p.batch_size:(batch_no+1)*p.batch_size]
state.job = f"{batch_no} out of {batch_count * p.n_iter}"
p.prompt = lines[batch_no*p.batch_size:(batch_no+1)*p.batch_size] * p.n_iter
proc = process_images(p)
images += proc.images

Expand Down

0 comments on commit afbb350

Please sign in to comment.