refactor filename pattern handling

This commit is contained in:
Vladimir Mandic
2023-10-11 11:38:23 -04:00
parent 38154c65a2
commit 20c2d83ad7
9 changed files with 103 additions and 123 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ class Script(scripts.Script):
if len(history) > 1:
grid = images.image_grid(history, rows=1)
if opts.grid_save:
images.save_image(grid, p.outpath_grids, "grid", initial_seed, p.prompt, opts.grid_format, info=info, short_filename=not opts.grid_extended_filename, grid=True, p=p)
images.save_image(grid, p.outpath_grids, "grid", initial_seed, p.prompt, opts.grid_format, info=info, grid=True, p=p)
if opts.return_grid:
grids.append(grid)
+3 -3
View File
@@ -69,7 +69,7 @@ def get_matched_noise(_np_src_image, np_mask_rgb, noise_q=1, color_variation=0.0
height = _np_src_image.shape[1]
num_channels = _np_src_image.shape[2]
_np_src_image[:] * (1. - np_mask_rgb)
_np_src_image[:] * (1. - np_mask_rgb) # pylint: disable=pointless-statement
np_mask_grey = np.sum(np_mask_rgb, axis=2) / 3.
img_mask = np_mask_grey > 1e-6
ref_mask = np_mask_grey < 1e-3
@@ -136,7 +136,7 @@ class Script(scripts.Script):
return [info, pixels, mask_blur, direction, noise_q, color_variation]
def run(self, p, _, pixels, mask_blur, direction, noise_q, color_variation):
def run(self, p, _, pixels, mask_blur, direction, noise_q, color_variation): # pylint: disable=arguments-differ
initial_seed_and_info = [None, None]
process_width = p.width
@@ -274,6 +274,6 @@ class Script(scripts.Script):
images.save_image(img, p.outpath_samples, "", res.seed, p.prompt, opts.samples_format, info=res.info, p=p)
if opts.grid_save and len(all_processed_images) > 1:
images.save_image(combined_grid_image, p.outpath_grids, "grid", res.seed, p.prompt, opts.samples_format, info=res.info, short_filename=not opts.grid_extended_filename, grid=True, p=p)
images.save_image(combined_grid_image, p.outpath_grids, "grid", res.seed, p.prompt, opts.samples_format, info=res.info, grid=True, p=p)
return res