diff --git a/py/nodes/lora_loader.py b/py/nodes/lora_loader.py index ec287721..aae8d882 100644 --- a/py/nodes/lora_loader.py +++ b/py/nodes/lora_loader.py @@ -26,8 +26,8 @@ class LoraManagerLoader: "optional": FlexibleOptionalInputType(any_type), } - RETURN_TYPES = ("MODEL", "CLIP", IO.STRING) - RETURN_NAMES = ("MODEL", "CLIP", "trigger_words") + RETURN_TYPES = ("MODEL", "CLIP", IO.STRING, IO.STRING) + RETURN_NAMES = ("MODEL", "CLIP", "trigger_words", "loaded_loras") FUNCTION = "load_loras" async def get_lora_info(self, lora_name): @@ -95,5 +95,9 @@ class LoraManagerLoader: # use ',, ' to separate trigger words for group mode trigger_words_text = ",, ".join(all_trigger_words) if all_trigger_words else "" + + # Format loaded_loras as separated by spaces + formatted_loras = " ".join([f"" + for name, strength in [item.split(':') for item in loaded_loras]]) - return (model, clip, trigger_words_text) \ No newline at end of file + return (model, clip, trigger_words_text, formatted_loras) \ No newline at end of file diff --git a/py/nodes/lora_stacker.py b/py/nodes/lora_stacker.py index 8535ce17..7909cfbf 100644 --- a/py/nodes/lora_stacker.py +++ b/py/nodes/lora_stacker.py @@ -80,7 +80,8 @@ class LoraStacker: lora_path, trigger_words = asyncio.run(self.get_lora_info(lora_name)) # Add to stack without loading - stack.append((lora_path, model_strength, clip_strength)) + # replace '/' with os.sep to avoid different OS path format + stack.append((lora_path.replace('/', os.sep), model_strength, clip_strength)) # Add trigger words to collection all_trigger_words.extend(trigger_words) diff --git a/py/services/download_manager.py b/py/services/download_manager.py index b5d48d6d..66330a68 100644 --- a/py/services/download_manager.py +++ b/py/services/download_manager.py @@ -146,6 +146,9 @@ class DownloadManager: # Update the hash index with the new LoRA entry self.file_monitor.scanner._hash_index.add_entry(metadata_dict['sha256'], metadata_dict['file_path']) + # Update the hash index with the new LoRA entry + self.file_monitor.scanner._hash_index.add_entry(metadata_dict['sha256'], metadata_dict['file_path']) + # Report 100% completion if progress_callback: await progress_callback(100) diff --git a/py/services/lora_scanner.py b/py/services/lora_scanner.py index 0fa98485..cb3cfabb 100644 --- a/py/services/lora_scanner.py +++ b/py/services/lora_scanner.py @@ -658,7 +658,7 @@ class LoraScanner: def get_lora_hash_by_path(self, file_path: str) -> Optional[str]: """Get hash for a LoRA by its file path""" - return self._hash_index.get_hash(file_path) + return self._hash_index.get_hash(file_path) def get_preview_url_by_hash(self, sha256: str) -> Optional[str]: """Get preview static URL for a LoRA by its hash""" diff --git a/pyproject.toml b/pyproject.toml index 743dfd97..b93969ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-lora-manager" description = "LoRA Manager for ComfyUI - Access it at http://localhost:8188/loras for managing LoRA models with previews and metadata integration." -version = "0.7.38" +version = "0.7.39" license = {file = "LICENSE"} dependencies = [ "aiohttp",