mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
update flux_model_loader node to take a T5 encoder from node field instead of hardcoded list, assume all models have been downloaded
This commit is contained in:
parent
cfac7c8189
commit
5fed573a29
@ -49,6 +49,7 @@ class UIType(str, Enum, metaclass=MetaEnum):
|
||||
ControlNetModel = "ControlNetModelField"
|
||||
IPAdapterModel = "IPAdapterModelField"
|
||||
T2IAdapterModel = "T2IAdapterModelField"
|
||||
T5EncoderModel = "T5EncoderModelField"
|
||||
SpandrelImageToImageModel = "SpandrelImageToImageModelField"
|
||||
# endregion
|
||||
|
||||
|
@ -177,7 +177,11 @@ class FluxModelLoaderInvocation(BaseInvocation):
|
||||
input=Input.Direct,
|
||||
)
|
||||
|
||||
t5_encoder: T5_ENCODER_OPTIONS = InputField(description="The T5 Encoder model to use.")
|
||||
t5_encoder: ModelIdentifierField = InputField(
|
||||
description=FieldDescriptions.t5Encoder,
|
||||
ui_type=UIType.T5EncoderModel,
|
||||
input=Input.Direct,
|
||||
)
|
||||
|
||||
def invoke(self, context: InvocationContext) -> FluxModelLoaderOutput:
|
||||
model_key = self.model.key
|
||||
@ -231,9 +235,9 @@ class FluxModelLoaderInvocation(BaseInvocation):
|
||||
return self._install_model(
|
||||
context,
|
||||
submodel,
|
||||
T5_ENCODER_MAP[self.t5_encoder]["name"],
|
||||
T5_ENCODER_MAP[self.t5_encoder]["repo"],
|
||||
ModelFormat(T5_ENCODER_MAP[self.t5_encoder]["format"]),
|
||||
self.t5_encoder.name,
|
||||
"",
|
||||
ModelFormat.T5Encoder,
|
||||
ModelType.T5Encoder,
|
||||
BaseModelType.Any,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user