mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 22:52:12 -03:00
Merge branch 'main' into dev
This commit is contained in:
@@ -26,8 +26,8 @@ class LoraManagerLoader:
|
|||||||
"optional": FlexibleOptionalInputType(any_type),
|
"optional": FlexibleOptionalInputType(any_type),
|
||||||
}
|
}
|
||||||
|
|
||||||
RETURN_TYPES = ("MODEL", "CLIP", IO.STRING)
|
RETURN_TYPES = ("MODEL", "CLIP", IO.STRING, IO.STRING)
|
||||||
RETURN_NAMES = ("MODEL", "CLIP", "trigger_words")
|
RETURN_NAMES = ("MODEL", "CLIP", "trigger_words", "loaded_loras")
|
||||||
FUNCTION = "load_loras"
|
FUNCTION = "load_loras"
|
||||||
|
|
||||||
async def get_lora_info(self, lora_name):
|
async def get_lora_info(self, lora_name):
|
||||||
@@ -95,5 +95,9 @@ class LoraManagerLoader:
|
|||||||
|
|
||||||
# use ',, ' to separate trigger words for group mode
|
# use ',, ' to separate trigger words for group mode
|
||||||
trigger_words_text = ",, ".join(all_trigger_words) if all_trigger_words else ""
|
trigger_words_text = ",, ".join(all_trigger_words) if all_trigger_words else ""
|
||||||
|
|
||||||
|
# Format loaded_loras as <lora:lora_name:strength> separated by spaces
|
||||||
|
formatted_loras = " ".join([f"<lora:{name.split(':')[0].strip()}:{str(strength).strip()}>"
|
||||||
|
for name, strength in [item.split(':') for item in loaded_loras]])
|
||||||
|
|
||||||
return (model, clip, trigger_words_text)
|
return (model, clip, trigger_words_text, formatted_loras)
|
||||||
@@ -80,7 +80,8 @@ class LoraStacker:
|
|||||||
lora_path, trigger_words = asyncio.run(self.get_lora_info(lora_name))
|
lora_path, trigger_words = asyncio.run(self.get_lora_info(lora_name))
|
||||||
|
|
||||||
# Add to stack without loading
|
# 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
|
# Add trigger words to collection
|
||||||
all_trigger_words.extend(trigger_words)
|
all_trigger_words.extend(trigger_words)
|
||||||
|
|||||||
@@ -146,6 +146,9 @@ class DownloadManager:
|
|||||||
# Update the hash index with the new LoRA entry
|
# Update the hash index with the new LoRA entry
|
||||||
self.file_monitor.scanner._hash_index.add_entry(metadata_dict['sha256'], metadata_dict['file_path'])
|
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
|
# Report 100% completion
|
||||||
if progress_callback:
|
if progress_callback:
|
||||||
await progress_callback(100)
|
await progress_callback(100)
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ class LoraScanner:
|
|||||||
|
|
||||||
def get_lora_hash_by_path(self, file_path: str) -> Optional[str]:
|
def get_lora_hash_by_path(self, file_path: str) -> Optional[str]:
|
||||||
"""Get hash for a LoRA by its file path"""
|
"""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]:
|
def get_preview_url_by_hash(self, sha256: str) -> Optional[str]:
|
||||||
"""Get preview static URL for a LoRA by its hash"""
|
"""Get preview static URL for a LoRA by its hash"""
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "comfyui-lora-manager"
|
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."
|
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"}
|
license = {file = "LICENSE"}
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aiohttp",
|
"aiohttp",
|
||||||
|
|||||||
Reference in New Issue
Block a user