From 08f7487590d2b48ae53098a4247f4d067549b0c9 Mon Sep 17 00:00:00 2001 From: layerdiffusion <19834515+lllyasviel@users.noreply.github.com> Date: Thu, 22 Aug 2024 06:35:13 -0700 Subject: [PATCH] revise "send distilled_cfg_scale when generating hires conds" --- modules/processing.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/processing.py b/modules/processing.py index d45c6d09..4fbca99c 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -1500,7 +1500,12 @@ class StableDiffusionProcessingTxt2Img(StableDiffusionProcessing): steps = self.hr_second_pass_steps or self.steps total_steps = sampler_config.total_steps(steps) if sampler_config else steps - self.hr_uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, hr_negative_prompts, self.firstpass_steps, [self.cached_hr_uc, self.cached_uc], self.hr_extra_network_data, total_steps) + if self.cfg_scale == 1: + self.hr_uc = None + print('Skipping unconditional conditioning (HR pass) when CFG = 1. Negative Prompts are ignored.') + else: + self.hr_uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, hr_negative_prompts, self.firstpass_steps, [self.cached_hr_uc, self.cached_uc], self.hr_extra_network_data, total_steps) + self.hr_c = self.get_conds_with_caching(prompt_parser.get_multicond_learned_conditioning, hr_prompts, self.firstpass_steps, [self.cached_hr_c, self.cached_c], self.hr_extra_network_data, total_steps) def setup_conds(self):