This commit is contained in:
ljleb 2023-07-24 15:43:06 -04:00
parent 6b68b59032
commit 5b06607476
1 changed files with 5 additions and 3 deletions

View File

@ -718,24 +718,26 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
def infotext(iteration=0, position_in_batch=0, use_main_prompt=False): def infotext(iteration=0, position_in_batch=0, use_main_prompt=False):
all_prompts = p.all_prompts[:] all_prompts = p.all_prompts[:]
all_negative_prompts = p.all_negative_prompts[:]
all_seeds = p.all_seeds[:] all_seeds = p.all_seeds[:]
all_subseeds = p.all_subseeds[:] all_subseeds = p.all_subseeds[:]
# apply changes to generation data # apply changes to generation data
all_prompts[iteration * p.batch_size:(iteration + 1) * p.batch_size] = p.prompts all_prompts[iteration * p.batch_size:(iteration + 1) * p.batch_size] = p.prompts
all_negative_prompts[iteration * p.batch_size:(iteration + 1) * p.batch_size] = p.negative_prompts
all_seeds[iteration * p.batch_size:(iteration + 1) * p.batch_size] = p.seeds all_seeds[iteration * p.batch_size:(iteration + 1) * p.batch_size] = p.seeds
all_subseeds[iteration * p.batch_size:(iteration + 1) * p.batch_size] = p.subseeds all_subseeds[iteration * p.batch_size:(iteration + 1) * p.batch_size] = p.subseeds
# update p.all_negative_prompts in case extensions changed the size of the batch # update p.all_negative_prompts in case extensions changed the size of the batch
# create_infotext below uses it # create_infotext below uses it
old_negative_prompts = p.all_negative_prompts[iteration * p.batch_size:(iteration + 1) * p.batch_size] old_negative_prompts = p.all_negative_prompts
p.all_negative_prompts[iteration * p.batch_size:(iteration + 1) * p.batch_size] = p.negative_prompts p.all_negative_prompts = all_negative_prompts
try: try:
return create_infotext(p, all_prompts, all_seeds, all_subseeds, comments, iteration, position_in_batch, use_main_prompt) return create_infotext(p, all_prompts, all_seeds, all_subseeds, comments, iteration, position_in_batch, use_main_prompt)
finally: finally:
# restore p.all_negative_prompts in case extensions changed the size of the batch # restore p.all_negative_prompts in case extensions changed the size of the batch
p.all_negative_prompts[iteration * p.batch_size:iteration * p.batch_size + len(p.negative_prompts)] = old_negative_prompts p.all_negative_prompts = old_negative_prompts
if os.path.exists(cmd_opts.embeddings_dir) and not p.do_not_reload_embeddings: if os.path.exists(cmd_opts.embeddings_dir) and not p.do_not_reload_embeddings:
model_hijack.embedding_db.load_textual_inversion_embeddings() model_hijack.embedding_db.load_textual_inversion_embeddings()