mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
reduce circular imports and improve lora tags
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
- cleanup dead rife code, thanks @Anai-Guo
|
||||
- lumina-dimoo attention-kwargs, thanks @Anai-Guo
|
||||
- improve network type/version lookup
|
||||
- cleanup lora tags
|
||||
|
||||
## Update for 2026-08-26
|
||||
|
||||
|
||||
@@ -46,6 +46,10 @@ def list_samplers():
|
||||
return all_samplers
|
||||
|
||||
|
||||
def get_samplers():
|
||||
return all_samplers
|
||||
|
||||
|
||||
def find_sampler_config(name):
|
||||
if name is not None and name != 'None':
|
||||
config = all_samplers_map.get(name, None)
|
||||
|
||||
+11
-11
@@ -108,8 +108,8 @@ if not files_cache.do_cache_folders:
|
||||
|
||||
|
||||
def list_checkpoint_titles():
|
||||
import modules.sd_models # pylint: disable=W0621
|
||||
return modules.sd_models.checkpoint_titles()
|
||||
from modules.sd_models import checkpoint_titles # pylint: disable=W0621
|
||||
return checkpoint_titles()
|
||||
|
||||
|
||||
list_checkpoint_tiles = list_checkpoint_titles # alias for legacy typo
|
||||
@@ -124,24 +124,24 @@ def is_url(string):
|
||||
|
||||
|
||||
def refresh_checkpoints():
|
||||
import modules.sd_models # pylint: disable=W0621
|
||||
return modules.sd_models.list_models()
|
||||
from modules.sd_models import list_models # pylint: disable=W0621
|
||||
return list_models()
|
||||
|
||||
|
||||
def refresh_vaes():
|
||||
import modules.sd_vae # pylint: disable=W0621
|
||||
modules.sd_vae.refresh_vae_list()
|
||||
from modules.sd_vae import refresh_vae_list # pylint: disable=W0621
|
||||
refresh_vae_list()
|
||||
|
||||
|
||||
def refresh_upscalers():
|
||||
import modules.modelloader # pylint: disable=W0621
|
||||
modules.modelloader.load_upscalers()
|
||||
from modules.modelloader import load_upscalers # pylint: disable=W0621
|
||||
load_upscalers()
|
||||
|
||||
|
||||
def list_samplers():
|
||||
import modules.sd_samplers # pylint: disable=W0621
|
||||
modules.sd_samplers.set_samplers()
|
||||
return modules.sd_samplers.all_samplers
|
||||
from modules.sd_samplers import set_samplers, get_samplers # pylint: disable=W0621
|
||||
set_samplers()
|
||||
return get_samplers()
|
||||
|
||||
|
||||
log.debug('Initializing: settings')
|
||||
|
||||
@@ -26,23 +26,23 @@ def list_onnx_providers():
|
||||
|
||||
|
||||
def list_checkpoint_titles():
|
||||
import modules.sd_models # pylint: disable=redefined-outer-name
|
||||
return modules.sd_models.checkpoint_titles()
|
||||
from modules.sd_models import checkpoint_titles # pylint: disable=redefined-outer-name
|
||||
return checkpoint_titles()
|
||||
|
||||
|
||||
def refresh_checkpoints():
|
||||
import modules.sd_models # pylint: disable=redefined-outer-name
|
||||
return modules.sd_models.list_models()
|
||||
from modules.sd_models import list_models # pylint: disable=redefined-outer-name
|
||||
return list_models()
|
||||
|
||||
|
||||
def refresh_vaes():
|
||||
import modules.sd_vae # pylint: disable=redefined-outer-name
|
||||
modules.sd_vae.refresh_vae_list()
|
||||
from modules.sd_vae import refresh_vae_list # pylint: disable=redefined-outer-name
|
||||
refresh_vae_list()
|
||||
|
||||
|
||||
def refresh_upscalers():
|
||||
import modules.modelloader # pylint: disable=redefined-outer-name
|
||||
modules.modelloader.load_upscalers()
|
||||
from modules.modelloader import load_upscalers # pylint: disable=redefined-outer-name
|
||||
load_upscalers()
|
||||
|
||||
|
||||
def list_samplers():
|
||||
|
||||
@@ -55,9 +55,20 @@ class ExtraNetworksPageLora(ui_extra_networks.ExtraNetworksPage):
|
||||
tags[tag] = 0
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# cleanup tags: remove model names, bad words, and special characters
|
||||
model_words = ['ltx', 'minimax', 'h3', 'sdxl', 'klein', 'wan', 'flux', 'qwen', 'vace', 'lcm', 'slider']
|
||||
bad_words = ['concept', 'style', 'styles', 'base model', 'video', 'audio', 'turbo', 'distill', 'assets', 'action', 'enhancer', 'detail', 'tool', 'dir', 'all']
|
||||
bad_parts = ['lora', 'comfyui', 't2i', 'i2i', 't2v', 'i2v', 'steps']
|
||||
bad_chars = [';', ':', '<', ">", "*", '?', '\'', '\"', '(', ')', '[', ']', '{', '}', '\\', '/']
|
||||
clean_tags = {}
|
||||
for k, v in tags.items():
|
||||
if k in bad_words:
|
||||
continue
|
||||
if any(k.startswith(s) for s in model_words):
|
||||
continue
|
||||
if any(s in k for s in bad_parts):
|
||||
continue
|
||||
tag = ''.join(i for i in k if i not in bad_chars).strip()
|
||||
clean_tags[tag] = v
|
||||
|
||||
|
||||
Reference in New Issue
Block a user