Fix sd1/2 models conditionings

This commit is contained in:
Sergey Borisov 2023-07-16 06:24:24 +03:00
parent c9c2229917
commit fe78a08e37
2 changed files with 15 additions and 9 deletions

View File

@ -147,11 +147,17 @@ class CompelInvocation(BaseInvocation):
cross_attention_control_args=options.get( cross_attention_control_args=options.get(
"cross_attention_control", None),) "cross_attention_control", None),)
raise NotImplementedError("TODO: redo to new conditionings") conditioning_data = ConditioningFieldData(
conditionings=[
BasicConditioningInfo(
embeds=c,
extra_conditioning=ec,
)
]
)
conditioning_name = f"{context.graph_execution_state_id}_{self.id}_conditioning" conditioning_name = f"{context.graph_execution_state_id}_{self.id}_conditioning"
# TODO: hacky but works ;D maybe rename latents somehow? context.services.latents.save(conditioning_name, conditioning_data)
context.services.latents.save(conditioning_name, (c, ec))
return CompelOutput( return CompelOutput(
conditioning=ConditioningField( conditioning=ConditioningField(

View File

@ -168,12 +168,12 @@ class TextToLatentsInvocation(BaseInvocation):
context: InvocationContext, context: InvocationContext,
scheduler, scheduler,
) -> ConditioningData: ) -> ConditioningData:
c, extra_conditioning_info = context.services.latents.get( positive_cond_data = context.services.latents.get(self.positive_conditioning.conditioning_name)
self.positive_conditioning.conditioning_name c = positive_cond_data.conditionings[0].embeds
) extra_conditioning_info = positive_cond_data.conditionings[0].extra_conditioning
uc, _ = context.services.latents.get(
self.negative_conditioning.conditioning_name negative_cond_data = context.services.latents.get(self.negative_conditioning.conditioning_name)
) uc = negative_cond_data.conditionings[0].embeds
conditioning_data = ConditioningData( conditioning_data = ConditioningData(
unconditioned_embeddings=uc, unconditioned_embeddings=uc,