add get_model_type_simple

This commit is contained in:
sn0w12
2024-06-25 03:04:09 +02:00
parent 259788d5ef
commit 1a552c4c8c
2 changed files with 15 additions and 2 deletions
+13
View File
@@ -175,6 +175,19 @@ class Utility:
def get_model_type(model_patcher):
return model_patcher.model.__class__.__name__
@staticmethod
def get_model_type_simple(model_patcher):
model_type = Utility.get_model_type(model_patcher)
if model_type == "BaseModel":
return "SD15"
elif model_type == "SDXL":
return "SDXL"
elif model_type == "SD3":
return "SD3"
return None
@classmethod
def put_favourite_on_top(cls, setting, arr):
# Convert to a list if its a dictionary
+2 -2
View File
@@ -64,13 +64,13 @@ class LoadLoraFolderNode:
# Clean and split the prompt into parts
prompt_parts = [self.clean_string(part) for part in prompt.split(separator)]
model_type = Utility.get_model_type(model)
model_type = Utility.get_model_type_simple(model)
# Retrieve and filter Lora file paths
full_lora_paths = folder_paths.get_filename_list("loras")
try:
if model_type == "BaseModel":
if model_type == "SD15":
filtered_lora_paths = folder_paths.get_filename_list("loras_15")
elif model_type == "SDXL":
filtered_lora_paths = folder_paths.get_filename_list("loras_xl")