From b3a988bc0b91a64b253e49779ba25976cb0ccd28 Mon Sep 17 00:00:00 2001 From: Olivia Godone-Maresca Date: Mon, 6 Feb 2023 23:07:23 -0500 Subject: [PATCH 1/2] Restore VAE model in metadata files and remove prompt strength in txt2img generations --- ui/easydiffusion/utils/save_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/easydiffusion/utils/save_utils.py b/ui/easydiffusion/utils/save_utils.py index 0b9e3bce..e7eff825 100644 --- a/ui/easydiffusion/utils/save_utils.py +++ b/ui/easydiffusion/utils/save_utils.py @@ -24,6 +24,7 @@ TASK_TEXT_MAPPING = { 'sampler_name': 'Sampler', 'negative_prompt': 'Negative Prompt', 'use_stable_diffusion_model': 'Stable Diffusion model', + 'use_vae_model': 'VAE model', 'use_hypernetwork_model': 'Hypernetwork model', 'hypernetwork_strength': 'Hypernetwork Strength' } @@ -71,6 +72,8 @@ def get_printable_request(req: GenerateImageRequest): metadata = req.dict() del metadata['init_image'] del metadata['init_image_mask'] + if (req.init_image is None): + del metadata['prompt_strength'] return metadata def make_filename_callback(req: GenerateImageRequest, suffix=None, now=None): From f07d05a490c789ed6c0f11764a33221778360b93 Mon Sep 17 00:00:00 2001 From: Olivia Godone-Maresca Date: Mon, 6 Feb 2023 23:35:23 -0500 Subject: [PATCH 2/2] Also remove Hypernetwork Strength if not using a hypernetwork --- ui/easydiffusion/utils/save_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/easydiffusion/utils/save_utils.py b/ui/easydiffusion/utils/save_utils.py index e7eff825..debd4beb 100644 --- a/ui/easydiffusion/utils/save_utils.py +++ b/ui/easydiffusion/utils/save_utils.py @@ -56,6 +56,8 @@ def get_metadata_entries_for_request(req: GenerateImageRequest, task_data: TaskD }) if metadata['use_upscale'] is not None: metadata['upscale_amount'] = task_data.upscale_amount + if (task_data.use_hypernetwork_model is None): + del metadata['hypernetwork_strength'] # if text, format it in the text format expected by the UI is_txt_format = (task_data.metadata_output_format.lower() == 'txt')