Add BaseModelType.Any to be used by CLIPVisionModel.

This commit is contained in:
Ryan Dick 2023-09-14 08:19:55 -04:00
parent c34b359c36
commit 2c1100509f
4 changed files with 14 additions and 2 deletions

View File

@ -420,7 +420,7 @@ class DenoiseLatentsInvocation(BaseInvocation):
# TODO(ryand): Get this model_name from the IPAdapterField.
model_name="ip_adapter_clip_vision",
model_type=ModelType.CLIPVision,
base_model=ip_adapter.ip_adapter_model.base_model,
base_model=BaseModelType.Any,
context=context,
)

View File

@ -534,7 +534,7 @@ class IPAdapterFolderProbe(FolderProbeBase):
class CLIPVisionFolderProbe(FolderProbeBase):
def get_base_type(self) -> BaseModelType:
raise NotImplementedError()
return BaseModelType.Any
############## register probe classes ######

View File

@ -71,6 +71,17 @@ MODEL_CLASSES = {
ModelType.IPAdapter: IPAdapterModel,
ModelType.CLIPVision: CLIPVisionModel,
},
BaseModelType.Any: {
ModelType.CLIPVision: CLIPVisionModel,
# The following model types are not expected to be used with BaseModelType.Any.
ModelType.ONNX: ONNXStableDiffusion2Model,
ModelType.Main: StableDiffusion2Model,
ModelType.Vae: VaeModel,
ModelType.Lora: LoRAModel,
ModelType.ControlNet: ControlNetModel,
ModelType.TextualInversion: TextualInversionModel,
ModelType.IPAdapter: IPAdapterModel,
},
# BaseModelType.Kandinsky2_1: {
# ModelType.Main: Kandinsky2_1Model,
# ModelType.MoVQ: MoVQModel,

View File

@ -47,6 +47,7 @@ class ModelNotFoundException(Exception):
class BaseModelType(str, Enum):
Any = "any" # For models that are not associated with any particular base model.
StableDiffusion1 = "sd-1"
StableDiffusion2 = "sd-2"
StableDiffusionXL = "sdxl"