fix(ui): fix node ui type hints

This commit is contained in:
psychedelicious 2023-05-19 16:10:16 +10:00 committed by Kent Keirsey
parent e19ef7ed2f
commit 7467fa5e57
2 changed files with 4 additions and 13 deletions

View File

@ -96,6 +96,7 @@ class UIConfig(TypedDict, total=False):
"image", "image",
"latents", "latents",
"model", "model",
"control",
], ],
] ]
tags: List[str] tags: List[str]

View File

@ -186,9 +186,10 @@ class TextToLatentsInvocation(BaseInvocation):
class Config(InvocationConfig): class Config(InvocationConfig):
schema_extra = { schema_extra = {
"ui": { "ui": {
"tags": ["latents", "image"], "tags": ["latents"],
"type_hints": { "type_hints": {
"model": "model" "model": "model",
"control": "control",
} }
}, },
} }
@ -355,17 +356,6 @@ class LatentsToLatentsInvocation(TextToLatentsInvocation):
latents: Optional[LatentsField] = Field(description="The latents to use as a base image") latents: Optional[LatentsField] = Field(description="The latents to use as a base image")
strength: float = Field(default=0.5, description="The strength of the latents to use") strength: float = Field(default=0.5, description="The strength of the latents to use")
# Schema customisation
class Config(InvocationConfig):
schema_extra = {
"ui": {
"tags": ["latents"],
"type_hints": {
"model": "model"
}
},
}
def invoke(self, context: InvocationContext) -> LatentsOutput: def invoke(self, context: InvocationContext) -> LatentsOutput:
noise = context.services.latents.get(self.noise.latents_name) noise = context.services.latents.get(self.noise.latents_name)
latent = context.services.latents.get(self.latents.latents_name) latent = context.services.latents.get(self.latents.latents_name)