mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fix sd1/2 models conditionings
This commit is contained in:
parent
c9c2229917
commit
fe78a08e37
@ -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(
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user