From d623bd429b04d3c4b72cd93061bdc92fb285212b Mon Sep 17 00:00:00 2001 From: Sergey Borisov Date: Tue, 16 Jul 2024 00:31:56 +0300 Subject: [PATCH] Fix condtionings logic --- .../stable_diffusion/diffusion/conditioning_data.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/invokeai/backend/stable_diffusion/diffusion/conditioning_data.py b/invokeai/backend/stable_diffusion/diffusion/conditioning_data.py index 802aec0109..21fb8d5780 100644 --- a/invokeai/backend/stable_diffusion/diffusion/conditioning_data.py +++ b/invokeai/backend/stable_diffusion/diffusion/conditioning_data.py @@ -131,16 +131,18 @@ class TextConditioningData: # TODO: combine regions with conditionings if conditioning_mode == "both": - conditionings = [self.uncond_text.embeds, self.cond_text.embeds] + conditionings = [self.uncond_text, self.cond_text] c_regions = [self.uncond_regions, self.cond_regions] elif conditioning_mode == "positive": - conditionings = [self.cond_text.embeds] + conditionings = [self.cond_text] c_regions = [self.cond_regions] else: - conditionings = [self.uncond_text.embeds] + conditionings = [self.uncond_text] c_regions = [self.uncond_regions] - encoder_hidden_states, encoder_attention_mask = self._concat_conditionings_for_batch(conditionings) + encoder_hidden_states, encoder_attention_mask = self._concat_conditionings_for_batch( + [c.embeds for c in conditionings] + ) unet_kwargs.encoder_hidden_states = encoder_hidden_states unet_kwargs.encoder_attention_mask = encoder_attention_mask