mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 06:32:12 -03:00
Add DoRA type support. move VALID_LORA_TYPES to utils.constants and update imports in recipe parsers and API routes.
This commit is contained in:
@@ -7,7 +7,7 @@ import re
|
|||||||
from typing import Dict, List, Any, Optional, Tuple
|
from typing import Dict, List, Any, Optional, Tuple
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from ..config import config
|
from ..config import config
|
||||||
from .constants import VALID_LORA_TYPES
|
from ..utils.constants import VALID_LORA_TYPES
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
"""Constants used across recipe parsers."""
|
"""Constants used across recipe parsers."""
|
||||||
|
|
||||||
|
# Import VALID_LORA_TYPES from utils.constants
|
||||||
|
from ..utils.constants import VALID_LORA_TYPES
|
||||||
|
|
||||||
# Constants for generation parameters
|
# Constants for generation parameters
|
||||||
GEN_PARAM_KEYS = [
|
GEN_PARAM_KEYS = [
|
||||||
'prompt',
|
'prompt',
|
||||||
@@ -11,6 +14,3 @@ GEN_PARAM_KEYS = [
|
|||||||
'size',
|
'size',
|
||||||
'clip_skip',
|
'clip_skip',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Valid Lora types
|
|
||||||
VALID_LORA_TYPES = ['lora', 'locon']
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from ..services.websocket_manager import ws_manager
|
|||||||
from ..services.settings_manager import settings
|
from ..services.settings_manager import settings
|
||||||
import asyncio
|
import asyncio
|
||||||
from .update_routes import UpdateRoutes
|
from .update_routes import UpdateRoutes
|
||||||
from ..utils.constants import PREVIEW_EXTENSIONS, CARD_PREVIEW_WIDTH
|
from ..utils.constants import PREVIEW_EXTENSIONS, CARD_PREVIEW_WIDTH, VALID_LORA_TYPES
|
||||||
from ..utils.exif_utils import ExifUtils
|
from ..utils.exif_utils import ExifUtils
|
||||||
from ..services.service_registry import ServiceRegistry
|
from ..services.service_registry import ServiceRegistry
|
||||||
|
|
||||||
@@ -401,8 +401,8 @@ class ApiRoutes:
|
|||||||
versions = response.get('modelVersions', [])
|
versions = response.get('modelVersions', [])
|
||||||
model_type = response.get('type', '')
|
model_type = response.get('type', '')
|
||||||
|
|
||||||
# Check model type - should be LORA or LoCon
|
# Check model type - should be LORA, LoCon, or DORA
|
||||||
if model_type.lower() not in ['lora', 'locon']:
|
if model_type.lower() not in VALID_LORA_TYPES:
|
||||||
return web.json_response({
|
return web.json_response({
|
||||||
'error': f"Model type mismatch. Expected LORA or LoCon, got {model_type}"
|
'error': f"Model type mismatch. Expected LORA or LoCon, got {model_type}"
|
||||||
}, status=400)
|
}, status=400)
|
||||||
|
|||||||
@@ -31,4 +31,7 @@ EXAMPLE_IMAGE_WIDTH = 832
|
|||||||
SUPPORTED_MEDIA_EXTENSIONS = {
|
SUPPORTED_MEDIA_EXTENSIONS = {
|
||||||
'images': ['.jpg', '.jpeg', '.png', '.webp', '.gif'],
|
'images': ['.jpg', '.jpeg', '.png', '.webp', '.gif'],
|
||||||
'videos': ['.mp4', '.webm']
|
'videos': ['.mp4', '.webm']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Valid Lora types
|
||||||
|
VALID_LORA_TYPES = ['lora', 'locon', 'dora']
|
||||||
Reference in New Issue
Block a user