diff --git a/invokeai/app/invocations/latent.py b/invokeai/app/invocations/latent.py index 97d3c705d4..9e9cb2d1c7 100644 --- a/invokeai/app/invocations/latent.py +++ b/invokeai/app/invocations/latent.py @@ -360,7 +360,6 @@ class DenoiseLatentsInvocation(BaseInvocation): ) -> ConditioningData: positive_cond_data = context.conditioning.load(self.positive_conditioning.conditioning_name) c = positive_cond_data.conditionings[0].to(device=unet.device, dtype=unet.dtype) - extra_conditioning_info = c.extra_conditioning negative_cond_data = context.conditioning.load(self.negative_conditioning.conditioning_name) uc = negative_cond_data.conditionings[0].to(device=unet.device, dtype=unet.dtype) @@ -370,7 +369,6 @@ class DenoiseLatentsInvocation(BaseInvocation): text_embeddings=c, guidance_scale=self.cfg_scale, guidance_rescale_multiplier=self.cfg_rescale_multiplier, - extra=extra_conditioning_info, postprocessing_settings=PostprocessingSettings( threshold=0.0, # threshold, warmup=0.2, # warmup, diff --git a/invokeai/backend/stable_diffusion/diffusers_pipeline.py b/invokeai/backend/stable_diffusion/diffusers_pipeline.py index fd3ecde47b..918ca538a3 100644 --- a/invokeai/backend/stable_diffusion/diffusers_pipeline.py +++ b/invokeai/backend/stable_diffusion/diffusers_pipeline.py @@ -427,10 +427,11 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline): return latents, attention_map_saver ip_adapter_unet_patcher = None - if conditioning_data.extra is not None and conditioning_data.extra.wants_cross_attention_control: + extra_conditioning_info = conditioning_data.text_embeddings.extra_conditioning + if extra_conditioning_info is not None and extra_conditioning_info.wants_cross_attention_control: attn_ctx = self.invokeai_diffuser.custom_attention_context( self.invokeai_diffuser.model, - extra_conditioning_info=conditioning_data.extra, + extra_conditioning_info=extra_conditioning_info, step_count=len(self.scheduler.timesteps), ) self.use_ip_adapter = False diff --git a/invokeai/backend/stable_diffusion/diffusion/conditioning_data.py b/invokeai/backend/stable_diffusion/diffusion/conditioning_data.py index 0676555f7a..b67669cefa 100644 --- a/invokeai/backend/stable_diffusion/diffusion/conditioning_data.py +++ b/invokeai/backend/stable_diffusion/diffusion/conditioning_data.py @@ -21,11 +21,7 @@ class ExtraConditioningInfo: @dataclass class BasicConditioningInfo: embeds: torch.Tensor - # TODO(ryand): Right now we awkwardly copy the extra conditioning info from here up to `ConditioningData`. This - # should only be stored in one place. extra_conditioning: Optional[ExtraConditioningInfo] - # weight: float - # mode: ConditioningAlgo def to(self, device, dtype=None): self.embeds = self.embeds.to(device=device, dtype=dtype) @@ -83,7 +79,6 @@ class ConditioningData: ref [Common Diffusion Noise Schedules and Sample Steps are Flawed](https://arxiv.org/pdf/2305.08891.pdf) """ guidance_rescale_multiplier: float = 0 - extra: Optional[ExtraConditioningInfo] = None scheduler_args: dict[str, Any] = field(default_factory=dict) """ Additional arguments to pass to invokeai_diffuser.do_latent_postprocessing().