Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
Show the local render's LoRA refusals in the Video Gen preview
Claude830893d43708
diff --git a/server/routes/videoGen.test.js b/server/routes/videoGen.test.jsindex db11e7b5e9..72e1ab9d54 100644--- a/server/routes/videoGen.test.js+++ b/server/routes/videoGen.test.js@@ -267,10 +267,13 @@ vi.mock('../lib/fileUtils.js', () => ({videos: '/mock/videos',uploads: '/mock/uploads',music: '/mock/music',+ loras: '/mock/loras',},// Route awaits ensureDir before staging the upload; no-op for tests since// we mock copyFile too.ensureDir: vi.fn(async () => {}),+ // The LoRA filename guard (services/loras.js) the preview's LoRA check runs.+ assertSafeFilename: vi.fn(),copyFileGuarded: fsMock.copyFile,unlinkGuarded: fsMock.unlink,// The route resolves user-supplied basenames through this helper before@@ -1163,6 +1166,14 @@ describe('videoGen routes', () => {expect(r.body.error).toMatch(/2,001 characters/);});+ it('refuses a LoRA the local render would refuse', async () => {+ const { existsSync } = await import('fs');+ vi.mocked(existsSync).mockReturnValueOnce(false);+ const r = await request(app).post('/api/video-gen/prompt-preview').send({ prompt: 'a fox', loraFilenames: ['missing-example.safetensors'] });+ expect(r.status).toBe(400);+ expect(r.body.code).toBe('LORA_NOT_FOUND');+ });+it('refuses a backend that is switched off, as Generate does', async () => {const { getSettings } = await import('../services/settings.js');getSettings.mockResolvedValueOnce({ imageGen: { grok: { enabled: false } } });diff --git a/server/services/videoGen/promptPreview.js b/server/services/videoGen/promptPreview.jsindex 6f76e987c0..3a12cdae69 100644--- a/server/services/videoGen/promptPreview.js+++ b/server/services/videoGen/promptPreview.js@@ -18,6 +18,9 @@ import { VIDEO_GEN_LOCAL_ONLY_FIELD_NAMES } from './requestFields.js';import { grokVideoSentPrompt } from './grok.js';import { falVideoSentPrompt } from './fal.js';import { localVideoSentPrompt } from './generateVideo.js';+import { defaultVideoModelId, listVideoModels } from './local.js';+import { resolveVideoLoras } from './renderArgs.js';+import { captureSystemCapabilities } from '../../lib/systemCapabilities.js';export const PREVIEW_UPLOAD_FIELDS = ['sourceImage', 'lastImage', 'audioFile', 'icReference'];const UPLOADED_SOURCE_IMAGE = '(uploaded image)';@@ -68,8 +71,16 @@ export async function previewVideoPrompt({ previewUploads = [], ...body }) {}).record };}if (backend === VIDEO_GEN_MODE.LOCAL) {+ const loraFilenames = body.loraFilenames || [];+ // The render's own LoRA refusals (missing file, not a video LoRA), minus+ // its one-time effect probe, which spawns Python and is cached for the render.+ if (loraFilenames.length) {+ const modelId = body.modelId || defaultVideoModelId(captureSystemCapabilities(), settings?.videoGen?.defaultModelId);+ const runtime = listVideoModels().find((model) => model.id === modelId)?.runtime ?? null;+ await resolveVideoLoras(loraFilenames.map((filename) => ({ filename })), { runtime });+ }return { backend, ...(await localVideoSentPrompt({- prompt: body.prompt, negativePrompt: body.negativePrompt, loraFilenames: body.loraFilenames || [], promptAdditions,+ prompt: body.prompt, negativePrompt: body.negativePrompt, loraFilenames, promptAdditions,})).record };}// reactor.inc receives the trimmed prompt with nothing added.