Improve LoRA cache initialization with async locking and background task

This commit is contained in:
Will Miao
2025-02-02 23:51:36 +08:00
parent 8e8b80ddcf
commit 9aa0dcfb2b
3 changed files with 79 additions and 25 deletions

View File

@@ -12,9 +12,10 @@ class Config:
def _init_lora_paths(self) -> List[str]:
"""Initialize and validate LoRA paths from ComfyUI settings"""
paths = [path.replace(os.sep, "/")
paths = list(set(path.replace(os.sep, "/")
for path in folder_paths.get_folder_paths("loras")
if os.path.exists(path)]
if os.path.exists(path)))
print("Found LoRA roots:", "\n - " + "\n - ".join(paths))
if not paths:
raise ValueError("No valid loras folders found in ComfyUI configuration")