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
fix: carry FastH3 V2 image conditioning (#7829)
[._.]/ Adam Eivy3f78b2a79b35
diff --git a/data.reference/media-models.json b/data.reference/media-models.jsonindex fd5a43351f..9f5a7364f2 100644--- a/data.reference/media-models.json+++ b/data.reference/media-models.json@@ -1253,7 +1253,8 @@"fastvideoFamily": "fasth3","fastvideoMlxFormat": "int8","supportedModes": [- "text"+ "text",+ "image"],"defaultWidth": 832,"defaultHeight": 480,@@ -1335,7 +1336,8 @@"fastvideoFamily": "fasth3","fastvideoMlxFormat": "int6","supportedModes": [- "text"+ "text",+ "image"],"defaultWidth": 832,"defaultHeight": 480,diff --git a/scripts/generate_fastvideo.py b/scripts/generate_fastvideo.pyindex 6d93926e12..67804869c6 100755--- a/scripts/generate_fastvideo.py+++ b/scripts/generate_fastvideo.py@@ -398,13 +398,14 @@ def build_command(args, entry_script: Path, model_root: Path, mlx_checkpoint: Pacmd.extend(["--image-path", str(args.image)])return cmd- # FastH3: text-to-video-with-audio only. The entry script has no --fps,- # --guidance, --negative-prompt or --image-path, so anything the caller- # passed for those is surfaced as a STATUS line instead of being dropped- # into a flag the child would reject.+ # FastH3: the preview entry is text-to-video-with-audio only. V2's VSA+ # entry additionally accepts a first-frame image, so keep that supported+ # conditioning explicit rather than silently dropping it.+ if args.image and not getattr(args, "vsa", False):+ raise ValueError("FastH3 Preview does not support first-frame conditioning")for label, unsupported in (("negative prompt", args.negative_prompt),- ("conditioning image", args.image),+ ("conditioning image", args.image and not getattr(args, "vsa", False)),("prompt enhancer", args.enhance_prompt),("refinement pass", args.refine),):@@ -421,6 +422,8 @@ def build_command(args, entry_script: Path, model_root: Path, mlx_checkpoint: Pa"--entry-script", str(entry_script), "--scheduler-root", str(model_root),"--schedule-steps", str(args.steps)] + cmd[2:]cmd.extend(["--vsa", "--vsa-sparsity", "0.8", "--vsa-tile-size", "64", "--vsa-impl", "reference"])+ if args.image:+ cmd.extend(["--image-path", str(args.image)])if args.fast:cmd.append("--fast")return cmddiff --git a/scripts/generate_fastvideo_test.py b/scripts/generate_fastvideo_test.pyindex 03ea91a9e9..8d0e362d3f 100644--- a/scripts/generate_fastvideo_test.py+++ b/scripts/generate_fastvideo_test.py@@ -133,12 +133,16 @@ class BuildCommandTest(unittest.TestCase):def test_fasth3_reports_rather_than_silently_dropping_unsupported_requests(self):cmd, stderr = self.build(family="fasth3", negative_prompt="blurry",- image="/fixture/first.png", enhance_prompt=True, refine=True)+ enhance_prompt=True, refine=True)self.assertNotIn("--negative-prompt", cmd)self.assertNotIn("--image-path", cmd)- for label in ("negative prompt", "conditioning image", "prompt enhancer", "refinement pass"):+ for label in ("negative prompt", "prompt enhancer", "refinement pass"):self.assertIn(label, stderr)+ def test_fasth3_preview_rejects_first_frame_conditioning(self):+ with self.assertRaisesRegex(ValueError, "does not support first-frame conditioning"):+ self.build(family="fasth3", image="/fixture/first.png")+def test_fasth3_reports_a_non_native_fps_and_stays_quiet_at_24(self):_, noisy = self.build(family="fasth3", fps=30)self.assertIn("30 fps", noisy)diff --git a/server/lib/mediaModels.js b/server/lib/mediaModels.jsindex 4933f98f4c..8baeae25a9 100644--- a/server/lib/mediaModels.js+++ b/server/lib/mediaModels.js@@ -826,6 +826,7 @@ const DEFAULT_REGISTRY = {repo: 'FastVideo/FastVideo-FastH3-8-Step-V2',revision: '3da2ddfe1954d9cda4c05b643dc0f26007a655c5',fastvideoVsa: true,+ supportedModes: ['text', 'image'],steps: 8,samplerNote: 'Quality option: 8 steps with 80% sparse attention, reference implementation. Requires an updated FastVideo runtime with VSA support. INT6 and INT8 share one ~147.9 GB source download; first use converts the DiT locally with routing weights retained. Not a real-time model.',})),diff --git a/server/services/videoGen/modeContract.js b/server/services/videoGen/modeContract.jsindex ed5c40d52b..80d6f02b12 100644--- a/server/services/videoGen/modeContract.js+++ b/server/services/videoGen/modeContract.js@@ -236,6 +236,14 @@ export const videoModeContractError = ({if (requestedMode === 'image' && !hasFirstImage) {return fail('imageRequiresFirst', `${codePrefix}_I2V_REQUIRES_IMAGE`);}+ if (model?.runtime === 'fastvideo' && model?.fastvideoFamily === 'fasth3') {+ if (requestedMode === 'image' && hasLastImage) {+ return fail('imageLastConflict', `${codePrefix}_I2V_LAST_IMAGE_CONFLICT`);+ }+ if (requestedMode === 'image' && model.fastvideoVsa !== true) {+ return fail('modeUnsupported', `${codePrefix}_MODE_UNSUPPORTED`);+ }+ }if (requestedMode === 'a2v' && a2vRequiresFirst && !hasFirstImage) {return fail('a2vRequiresFirst', `${codePrefix}_A2V_REQUIRES_IMAGE`);}diff --git a/server/services/videoGen/renderArgs.js b/server/services/videoGen/renderArgs.jsindex fb4f7ccb23..b7453f29ab 100644--- a/server/services/videoGen/renderArgs.js+++ b/server/services/videoGen/renderArgs.js@@ -600,10 +600,10 @@ export const fastvideoMlxFormat = (model) =>// Build args for the FastVideo MLX helper on Apple Silicon.export const buildFastVideoArgs = ({model, fastvideoModelPath, prompt, negativePrompt, width, height,- numFrames, fps, steps, guidance, seed, sourceImagePath, mode, outputPath,+ numFrames, fps, steps, guidance, seed, sourceImagePath, lastImagePath, mode, outputPath,}) => {assertByovRuntimeInstalled('fastvideo');- assertRenderModeContract({ model, mode, sourceImagePath });+ assertRenderModeContract({ model, mode, sourceImagePath, lastImagePath });const family = fastvideoFamily(model);const modelRoot = fastvideoModelPath || model.repo;const args = [@@ -1188,7 +1188,7 @@ export const buildArgs = ({ upscale, pythonPath, modelId, model, wanModelPath, f: videoLoraUnsupportedError(model, modelId);}if (model.runtime === 'fastvideo') {- return buildFastVideoArgs({ model, fastvideoModelPath, prompt, negativePrompt, width, height, numFrames, fps, steps, guidance, seed, sourceImagePath, mode, outputPath });+ return buildFastVideoArgs({ model, fastvideoModelPath, prompt, negativePrompt, width, height, numFrames, fps, steps, guidance, seed, sourceImagePath, lastImagePath, mode, outputPath });}if (model.runtime === 'wan22') {return buildWan22Args({ model, wanModelPath, wanRequiredWeights, prompt, negativePrompt, width, height, numFrames, fps, steps, guidance, seed, sourceImagePath, mode, outputPath });diff --git a/server/services/videoGen/renderArgsFastVideo.test.js b/server/services/videoGen/renderArgsFastVideo.test.jsindex a745a68fc8..2f8874b860 100644--- a/server/services/videoGen/renderArgsFastVideo.test.js+++ b/server/services/videoGen/renderArgsFastVideo.test.js@@ -30,6 +30,7 @@ const fasth3 = {repo: 'example-org/example-fasth3',supportedModes: ['text'],};+const fasth3V2 = { ...fasth3, id: 'fasth3_v2_int8', fastvideoVsa: true, supportedModes: ['text', 'image'] };// The upstream FastVideo snapshot: same family, but its DiT is bf16 under// transformer/, so the row names the MLX format the helper must convert to.@@ -130,6 +131,15 @@ describe('buildFastVideoArgs', () => {...base, model: fasth3, mode: 'image', sourceImagePath: '/fixture/first.png',})).toThrowError(/mode/i);});++ it('passes first-frame conditioning to the V2 VSA entry point', () => {+ const { args } = buildFastVideoArgs({+ ...base, model: fasth3V2, mode: 'image', sourceImagePath: '/fixture/first.png',+ });++ expect(args).toContain('--vsa');+ expect(flagValue(args, '--image')).toBe('/fixture/first.png');+ });});describe('fastvideoMlxFormat', () => {