mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-22 05:32:12 -03:00
Fixed an issue caused by inconsistent base model name for Illustrious. It fixes https://github.com/willmiao/ComfyUI-Lora-Manager/issues/37
This commit is contained in:
@@ -4,6 +4,8 @@ import logging
|
||||
from aiohttp import web
|
||||
from typing import Dict, List
|
||||
|
||||
from ..utils.model_utils import determine_base_model
|
||||
|
||||
from ..services.file_monitor import LoraFileMonitor
|
||||
from ..services.download_manager import DownloadManager
|
||||
from ..services.civitai_client import CivitaiClient
|
||||
@@ -351,8 +353,8 @@ class ApiRoutes:
|
||||
|
||||
# Update model name if available
|
||||
if 'model' in civitai_metadata:
|
||||
local_metadata['model_name'] = civitai_metadata['model'].get('name',
|
||||
local_metadata.get('model_name'))
|
||||
if civitai_metadata.get('model', {}).get('name'):
|
||||
local_metadata['model_name'] = determine_base_model(civitai_metadata['model']['name'])
|
||||
|
||||
# Fetch additional model metadata (description and tags) if we have model ID
|
||||
model_id = civitai_metadata['modelId']
|
||||
|
||||
@@ -4,6 +4,8 @@ import hashlib
|
||||
import json
|
||||
from typing import Dict, Optional
|
||||
|
||||
from .model_utils import determine_base_model
|
||||
|
||||
from .lora_metadata import extract_lora_metadata
|
||||
from .models import LoraMetadata
|
||||
|
||||
@@ -105,6 +107,12 @@ async def load_metadata(file_path: str) -> Optional[LoraMetadata]:
|
||||
data = json.load(f)
|
||||
|
||||
needs_update = False
|
||||
|
||||
# Check and normalize base model name
|
||||
normalized_base_model = determine_base_model(data['base_model'])
|
||||
if data['base_model'] != normalized_base_model:
|
||||
data['base_model'] = normalized_base_model
|
||||
needs_update = True
|
||||
|
||||
# Compare paths without extensions
|
||||
stored_path_base = os.path.splitext(data['file_path'])[0]
|
||||
|
||||
@@ -8,7 +8,8 @@ BASE_MODEL_MAPPING = {
|
||||
"sd-v2": "SD 2.0",
|
||||
"flux1": "Flux.1 D",
|
||||
"flux.1 d": "Flux.1 D",
|
||||
"illustrious": "IL",
|
||||
"illustrious": "Illustrious",
|
||||
"il": "Illustrious",
|
||||
"pony": "Pony",
|
||||
"Hunyuan Video": "Hunyuan Video"
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export const BASE_MODELS = {
|
||||
LUMINA: "Lumina",
|
||||
KOLORS: "Kolors",
|
||||
NOOBAI: "NoobAI",
|
||||
IL: "IL",
|
||||
ILLUSTRIOUS: "Illustrious",
|
||||
PONY: "Pony",
|
||||
|
||||
// Video models
|
||||
@@ -82,7 +82,7 @@ export const BASE_MODEL_CLASSES = {
|
||||
[BASE_MODELS.LUMINA]: "lumina",
|
||||
[BASE_MODELS.KOLORS]: "kolors",
|
||||
[BASE_MODELS.NOOBAI]: "noobai",
|
||||
[BASE_MODELS.IL]: "il",
|
||||
[BASE_MODELS.ILLUSTRIOUS]: "il",
|
||||
[BASE_MODELS.PONY]: "pony",
|
||||
|
||||
// Default
|
||||
|
||||
Reference in New Issue
Block a user