From 71690715db6ca22b796692743151559aa63fd63f Mon Sep 17 00:00:00 2001 From: skunkworxdark Date: Tue, 21 Jan 2025 10:02:24 +0000 Subject: [PATCH] fix typegen fix typegen --- invokeai/app/invocations/flux_lora_loader.py | 4 +++- invokeai/app/invocations/model.py | 8 ++++++-- invokeai/frontend/web/src/services/api/schema.ts | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/invokeai/app/invocations/flux_lora_loader.py b/invokeai/app/invocations/flux_lora_loader.py index 349d001135..2460a8b7bb 100644 --- a/invokeai/app/invocations/flux_lora_loader.py +++ b/invokeai/app/invocations/flux_lora_loader.py @@ -117,7 +117,7 @@ class FLUXLoRACollectionLoader(BaseInvocation): """Applies a collection of LoRAs to a FLUX transformer.""" loras: Optional[LoRAField | list[LoRAField]] = InputField( - default=[], description="LoRA models and weights. May be a single LoRA or collection.", title="LoRAs" + default=None, description="LoRA models and weights. May be a single LoRA or collection.", title="LoRAs" ) transformer: Optional[TransformerField] = InputField( @@ -151,6 +151,8 @@ class FLUXLoRACollectionLoader(BaseInvocation): output.clip = self.clip.model_copy(deep=True) for lora in loras: + if lora is None: + continue assert type(lora) is LoRAField if lora.lora.key in added_loras: continue diff --git a/invokeai/app/invocations/model.py b/invokeai/app/invocations/model.py index 576334f684..babd77ed24 100644 --- a/invokeai/app/invocations/model.py +++ b/invokeai/app/invocations/model.py @@ -262,7 +262,7 @@ class LoRACollectionLoader(BaseInvocation): """Applies a collection of LoRAs to the provided UNet and CLIP models.""" loras: Optional[LoRAField | list[LoRAField]] = InputField( - default=[], description="LoRA models and weights. May be a single LoRA or collection.", title="LoRAs" + default=None, description="LoRA models and weights. May be a single LoRA or collection.", title="LoRAs" ) unet: Optional[UNetField] = InputField( default=None, @@ -288,6 +288,8 @@ class LoRACollectionLoader(BaseInvocation): output.clip = self.clip.model_copy(deep=True) for lora in loras: + if lora is None: + continue assert type(lora) is LoRAField if lora.lora.key in added_loras: continue @@ -408,7 +410,7 @@ class SDXLLoRACollectionLoader(BaseInvocation): """Applies a collection of SDXL LoRAs to the provided UNet and CLIP models.""" loras: Optional[LoRAField | list[LoRAField]] = InputField( - default=[], description="LoRA models and weights. May be a single LoRA or collection.", title="LoRAs" + default=None, description="LoRA models and weights. May be a single LoRA or collection.", title="LoRAs" ) unet: Optional[UNetField] = InputField( default=None, @@ -444,6 +446,8 @@ class SDXLLoRACollectionLoader(BaseInvocation): output.clip2 = self.clip2.model_copy(deep=True) for lora in loras: + if lora is None: + continue assert type(lora) is LoRAField if lora.lora.key in added_loras: continue diff --git a/invokeai/frontend/web/src/services/api/schema.ts b/invokeai/frontend/web/src/services/api/schema.ts index a5ed917b95..f66399ae9f 100644 --- a/invokeai/frontend/web/src/services/api/schema.ts +++ b/invokeai/frontend/web/src/services/api/schema.ts @@ -6418,7 +6418,7 @@ export type components = { /** * LoRAs * @description LoRA models and weights. May be a single LoRA or collection. - * @default [] + * @default null */ loras?: components["schemas"]["LoRAField"] | components["schemas"]["LoRAField"][] | null; /** @@ -12531,7 +12531,7 @@ export type components = { /** * LoRAs * @description LoRA models and weights. May be a single LoRA or collection. - * @default [] + * @default null */ loras?: components["schemas"]["LoRAField"] | components["schemas"]["LoRAField"][] | null; /** @@ -16694,7 +16694,7 @@ export type components = { /** * LoRAs * @description LoRA models and weights. May be a single LoRA or collection. - * @default [] + * @default null */ loras?: components["schemas"]["LoRAField"] | components["schemas"]["LoRAField"][] | null; /**