Remember Studio 2 LoRA stacks for each engine

This commit is contained in:
Towsty
2026-09-12 20:17:58 -05:00
parent 6a6931f04e
commit 401e6c26a2
8 changed files with 145 additions and 22 deletions
+2
View File
@@ -1,3 +1,4 @@
import {filterLoraStackForUse} from '~/utils/loras';
import { validateRequest } from '~/shared/studio2/contracts.mjs';
import { resolveRequestSize } from '../../utils/studio2/size';
import { parsePostedLoraStack, assertImageV2LoraStack } from '../../utils/loras';
@@ -16,6 +17,7 @@ export default defineEventHandler(async (event) => {
if (video && request.engine !== 'minimax')
throw createError({ statusCode: 400, statusMessage: 'Use the existing xAIGen studio for LTX. Studio 2 video currently supports MiniMax.' });
request.settings.loraStack = parsePostedLoraStack(request.settings.loraStack, video ? 'video' : 'image');
request.settings.loraStack = filterLoraStackForUse(request.settings.loraStack, request.engine, useRuntimeConfig().public.studio === 'xaigen');
if (!video)
assertImageV2LoraStack(request.settings.loraStack, request.engine);
assertFolderAccess(event, request.folderId);