diff --git a/modules/options.py b/modules/options.py index dfaf73f2..8fb8c86e 100644 --- a/modules/options.py +++ b/modules/options.py @@ -332,7 +332,7 @@ class OptionsCategories: # Use a dictionary to hold the categories temporarily temp_mapping = self.mapping.copy() - + # Insert the new category at the specified position if position is not None and position == 0: temp_mapping = {category_id: OptionsCategory(category_id, label), **temp_mapping} diff --git a/modules/scripts.py b/modules/scripts.py index 2b7eb4dc..982d78df 100644 --- a/modules/scripts.py +++ b/modules/scripts.py @@ -489,7 +489,7 @@ def custom_sort_key(filename): base = match.group(1) if match else filename suffix = match.group(2) if match else '' extension = match.group(3) if match else '' - + # 1. Base name # 2. Suffix (optional) return (base, suffix, extension) @@ -501,7 +501,7 @@ def list_files_with_prefix(prefix, file_extension): for dirpath in dirs: if not os.path.isdir(dirpath): continue - + for filename in os.listdir(dirpath): if filename.startswith(prefix) and filename.endswith(file_extension): res.append(os.path.join(dirpath, filename))