From e7e45f1b38461de7fe29ffb5b0c85a4b67e56f3e Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Sun, 21 Apr 2024 15:16:14 -0400 Subject: [PATCH] face-hires avoid double save --- CHANGELOG.md | 1 + modules/processing.py | 2 +- scripts/face-details.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b1575a4c..25dc032e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -88,6 +88,7 @@ - Enumerate diffusers model with multiple variants - Diffusers skip non-models on enum - Face-HiRes compatibility with control modules + - Face-HiRes avoid doule save in some scenarios - Loading safetensors embeddings - CSS fixes - Check if attention processor is compatible with model diff --git a/modules/processing.py b/modules/processing.py index f8e6653f2..230e924c4 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -368,7 +368,7 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed: infotexts.append(text) image.info["parameters"] = text output_images.append(image) - if shared.opts.samples_save and not p.do_not_save_samples: + if shared.opts.samples_save and not p.do_not_save_samples and p.outpath_samples is not None: images.save_image(image, p.outpath_samples, "", p.seeds[i], p.prompts[i], shared.opts.samples_format, info=text, p=p) # main save image if hasattr(p, 'mask_for_overlay') and p.mask_for_overlay and any([shared.opts.save_mask, shared.opts.save_mask_composite, shared.opts.return_mask, shared.opts.return_mask_composite]): image_mask = p.mask_for_overlay.convert('RGB') diff --git a/scripts/face-details.py b/scripts/face-details.py index 3d2e41e52..1db98012e 100644 --- a/scripts/face-details.py +++ b/scripts/face-details.py @@ -125,7 +125,7 @@ class FaceRestorerYolo(FaceRestoration): 'denoising_strength': shared.opts.facehires_strength if shared.opts.facehires_strength > 0 else orig_p.get('denoising_strength', 0.3), 'styles': [], 'prompt': orig_p.get('refiner_prompt', ''), - # TODO facehires expose as tunable + # TODO facehires expose additional params as tunable 'mask_blur': 10, 'inpaint_full_res_padding': 15, 'restore_faces': True,