Fix duplicates

This was another regression caused by
82770bacae.

Fixes #147. Fixes #148.
This commit is contained in:
Torbjörn Lönnemark 2022-08-27 22:43:15 +02:00 committed by hlky
parent a3456f9992
commit ceecb1a33d

View File

@ -1069,17 +1069,17 @@ skip_grid, sort_samples, sampler_name, ddim_eta, n_iter, batch_size, i, denoisin
else: else:
grid = image_grid(output_images, batch_size) grid = image_grid(output_images, batch_size)
if prompt_matrix and not prompt.startswith("@"): if prompt_matrix:
try: if not prompt.startswith("@"):
grid = draw_prompt_matrix(grid, width, height, prompt_matrix_parts) try:
except: grid = draw_prompt_matrix(grid, width, height, prompt_matrix_parts)
import traceback except:
print("Error creating prompt_matrix text:", file=sys.stderr) import traceback
print(traceback.format_exc(), file=sys.stderr) print("Error creating prompt_matrix text:", file=sys.stderr)
print(traceback.format_exc(), file=sys.stderr)
output_images.insert(0, grid) output_images.insert(0, grid)
#else: else:
# grid = image_grid(output_images, batch_size) grid = image_grid(output_images, batch_size)
grid_count = get_next_sequence_number(outpath, 'grid-') grid_count = get_next_sequence_number(outpath, 'grid-')
grid_file = f"grid-{grid_count:05}-{seed}_{prompts[i].replace(' ', '_').translate({ord(x): '' for x in invalid_filename_chars})[:128]}.{grid_ext}" grid_file = f"grid-{grid_count:05}-{seed}_{prompts[i].replace(' ', '_').translate({ord(x): '' for x in invalid_filename_chars})[:128]}.{grid_ext}"