mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-02-03 06:47:23 +00:00
Filter ControlNet model based on active SD's version (#32)
This commit is contained in:
@@ -98,12 +98,18 @@ def get_filtered_preprocessor_names(tag):
|
||||
return list(get_filtered_preprocessors(tag).keys())
|
||||
|
||||
|
||||
def get_filtered_controlnet_names(tag):
|
||||
def get_filtered_controlnet_names(tag, filter_version: bool = True):
|
||||
filtered_preprocessors = get_filtered_preprocessors(tag)
|
||||
model_filename_filters = []
|
||||
for p in filtered_preprocessors.values():
|
||||
model_filename_filters += p.model_filename_filters
|
||||
return [x for x in controlnet_names if any(f.lower() in x.lower() for f in model_filename_filters) or x == 'None']
|
||||
return [
|
||||
x for x in controlnet_names
|
||||
if x == 'None' or (
|
||||
any(f.lower() in x.lower() for f in model_filename_filters) and
|
||||
get_sd_version().is_compatible_with(StableDiffusionVersion.detect_from_model_name(x))
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
def update_controlnet_filenames():
|
||||
|
||||
Reference in New Issue
Block a user