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:
Will Miao
2025-06-12 09:25:00 +08:00
parent 26d105c439
commit 78cac2edc2
4 changed files with 11 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ from ..services.websocket_manager import ws_manager
from ..services.settings_manager import settings
import asyncio
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 ..services.service_registry import ServiceRegistry
@@ -401,8 +401,8 @@ class ApiRoutes:
versions = response.get('modelVersions', [])
model_type = response.get('type', '')
# Check model type - should be LORA or LoCon
if model_type.lower() not in ['lora', 'locon']:
# Check model type - should be LORA, LoCon, or DORA
if model_type.lower() not in VALID_LORA_TYPES:
return web.json_response({
'error': f"Model type mismatch. Expected LORA or LoCon, got {model_type}"
}, status=400)