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: honor FastH3 V2 trained ladder and guide video previews
[._.]/ Adam Eivy91a7ede2556d
diff --git a/client/src/components/videoGen/ModelWorkflowHelp.jsx b/client/src/components/videoGen/ModelWorkflowHelp.jsxnew file mode 100644index 0000000000..978cacc99c--- /dev/null+++ b/client/src/components/videoGen/ModelWorkflowHelp.jsx@@ -0,0 +1,49 @@+// Advice uses runtime capabilities and declared Finish edges, never a guessed+// cross-model seed relationship. Changing size does not start a generation.+export default function ModelWorkflowHelp({ model, models = [], onResolutionChange }) {+ if (!model) return null;+ const fastH3 = model.runtime === 'fastvideo' && model.fastvideoFamily === 'fasth3';+ const fastMetal = model.runtime === 'fastvideo' && !fastH3;+ const finish = models.find((entry) => entry.id === model.finishModelId);++ return (+ <details className="mt-2 rounded-lg border border-port-border px-3 py-2 text-xs text-gray-400">+ <summary className="cursor-pointer text-gray-300">Choosing a model: preview → final</summary>+ <div className="mt-2 space-y-2 leading-relaxed">+ <p>+ Start with a small resolution and the shortest available duration to check composition and motion.+ Smaller renders reduce generation work, but model loading and first-use conversion still take time.+ Keep a distilled model’s trained step count; fewer steps can spoil the result.+ </p>+ {fastH3 ? (+ <>+ <p>+ {model.fastvideoVsa+ ? 'FastH3 V2 is an eight-step quality option with video and audio, not a real-time preview model.'+ : 'FastH3 Preview uses four steps for video and audio; it still loads a large model.'}+ {' '}Use the 832×480 preset and shortest duration for an initial quality check.+ For a cheaper wiring test, try 512×288; this smaller canvas is experimental and may reduce quality.+ INT6 uses smaller transformer weights than INT8; it is not a guaranteed speed increase.+ </p>+ <button type="button" onClick={() => onResolutionChange(512, 288)} className="text-port-accent underline">+ Use 512×288 test size+ </button>+ </>+ ) : fastMetal ? (+ <p>FastMetal is a draft option: 1.3B is the smallest model, while 5B offers a larger three-step model. Try a small preview resolution before a larger render.</p>+ ) : (+ <p>Where offered, use the Fast speed profile or a Lightning model for drafts. Choose Quality for the final render. Original MiniMax H3 is a slow quality reference; smaller quantization mainly reduces weight size.</p>+ )}+ {finish && (+ <p>This model has a declared delivery pair: <strong className="text-gray-300">{finish.name}</strong>. Eligible text-to-video gallery clips offer Finish to re-render with that model.</p>+ )}+ <p>+ To enlarge a clip you like, use its gallery Upscale action: resize preserves the content;+ the LTX-2.5 generative option can add detail and change it, and requires its model pack.+ Switching from FastMetal or FastH3 Preview to FastH3 V2 generates a new shot — the same prompt+ and seed do not preserve the original composition across models. Use Finish only where offered.+ </p>+ </div>+ </details>+ );+}diff --git a/client/src/lib/videoGenResolutions.js b/client/src/lib/videoGenResolutions.jsindex 0288f5897b..9d20f9c3ec 100644--- a/client/src/lib/videoGenResolutions.js+++ b/client/src/lib/videoGenResolutions.js@@ -16,6 +16,9 @@ export const VIDEO_RESOLUTIONS = [{ label: '512×768 (portrait)', w: 512, h: 768 },{ label: '512×512 (1:1)', w: 512, h: 512 },{ label: '768×768 (1:1)', w: 768, h: 768 },+ // Append so aspect-based I2V defaults keep their existing quality canvas.+ { label: '384×256 (small preview)', w: 384, h: 256 },+ { label: '256×384 (small portrait preview)', w: 256, h: 384 },];export const DEFAULT_VIDEO_RESOLUTION = { w: 768, h: 512 };diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsxindex c27497b497..fbd2e41ef5 100644--- a/client/src/pages/VideoGen.jsx+++ b/client/src/pages/VideoGen.jsx@@ -51,6 +51,7 @@ import IcLoraPanel from '../components/videoGen/IcLoraPanel';import AdvancedParamsPanel from '../components/videoGen/AdvancedParamsPanel';import RuntimeFingerprint from '../components/videoGen/RuntimeFingerprint';import ModelDisclosure from '../components/videoGen/ModelDisclosure';+import ModelWorkflowHelp from '../components/videoGen/ModelWorkflowHelp';import ModelRepairBanner from '../components/videoGen/ModelRepairBanner';import RenderStatusCard from '../components/videoGen/RenderStatusCard';import VideoGenGallery from '../components/videoGen/VideoGenGallery';@@ -1648,6 +1649,7 @@ export default function VideoGen() {onChange={(e) => handleModelChange(e.target.value)}loading={modelsLoading}/>+ <ModelWorkflowHelp model={currentModel} models={visibleModels} onResolutionChange={handleResolutionChange} />{remixModelFallback && (<p className="mt-1 text-[11px] text-port-accent leading-snug" role="status">{remixModelFallback.sourceName} {remixModelFallback.samplerLocked && remixModelFallback.negativePromptUnsupported@@ -1771,7 +1773,7 @@ export default function VideoGen() {snapOnBlurnote={isMiniMaxH3Runtime(currentModel?.runtime)? 'H3 quality presets follow its trained 768px short-edge, area-capped canvas. Smaller custom sizes are off-distribution but useful for faster wiring tests; each edge snaps to 32px.'- : 'Each edge 64–2048px; the server rounds each down to the nearest multiple of 64.'}+ : `Each edge 64–2048px; the server rounds each down to the nearest multiple of ${localResolutionBounds.step}px.`}/></div>diff --git a/client/src/pages/VideoGen.modelWorkflow.test.jsx b/client/src/pages/VideoGen.modelWorkflow.test.jsxnew file mode 100644index 0000000000..b0633d8f36--- /dev/null+++ b/client/src/pages/VideoGen.modelWorkflow.test.jsx@@ -0,0 +1,34 @@+import { beforeEach, expect, it, vi } from 'vitest';+import { fireEvent, screen, waitFor } from '@testing-library/react';+import {+ loadVideoGenPage, renderVideoGenPage, resetVideoGenMockState, state,+ videoGenModel, videoGenModelContext, videoGenStatus,+} from '../test/videoGenPageMocks.jsx';++vi.doMock('../components/media/ResolutionField', async () => vi.importActual('../components/media/ResolutionField'));++await loadVideoGenPage();++beforeEach(() => {+ localStorage.clear();+ resetVideoGenMockState();+});++it('applies the FastH3 test canvas to the render form without starting a job', async () => {+ const model = videoGenModel('fasth3_v2_int6', {+ runtime: 'fastvideo', fastvideoFamily: 'fasth3', fastvideoVsa: true,+ steps: 8, samplerLocked: true, resolutionStep: 32,+ defaultWidth: 832, defaultHeight: 480,+ resolutionOptions: [{ label: '832×480', w: 832, h: 480 }],+ });+ state.getVideoGenModelContext.mockResolvedValue(videoGenModelContext([model]));+ state.getVideoGenStatus.mockResolvedValue(videoGenStatus([model]));+ await renderVideoGenPage();+ fireEvent.click(await screen.findByText('Choosing a model: preview → final'));+ fireEvent.click(await screen.findByRole('button', { name: 'Use 512×288 test size' }));+ await waitFor(() => expect(screen.getByLabelText('Width')).toHaveValue(512));+ expect(screen.getByLabelText('Height')).toHaveValue(288);+ expect(screen.getByText(/nearest multiple of 32/)).toBeInTheDocument();+ expect(screen.getByText(/same prompt/, { exact: false })).toBeInTheDocument();+ expect(state.generateVideo).not.toHaveBeenCalled();+});diff --git a/docs/features/apple-video-options.md b/docs/features/apple-video-options.mdindex 0a4dd75a6b..804111ff62 100644--- a/docs/features/apple-video-options.md+++ b/docs/features/apple-video-options.md@@ -26,7 +26,10 @@ checkpoint before inference, including V2’s video shift of 10; the denoisingladder and converted AdaLN cache use the same shifts and eight-step schedule.The adapter corrects the upstream converter’s four-step cache default beforeit strips the original projections. Conversion caches include the schedule-version, step count and scheduler-config digest.+version, step count, scheduler configs and inference-sidecar digest.+The adapter reads the exact trained DMD rungs from `fastvideo_inference.json`+for both conversion and inference rather than using MLX’s uniform ladder.+Missing, mismatched or unsupported contracts fail before rendering.SIMD attention remains opt-in upstream; these choices use the reference path.The Preview INT4 community repack is a preconverted package from MrMofer;@@ -55,3 +58,17 @@ not run an Unreal renderer or perform literal tracing of source footage.Upstream timings vary with resolution, frame count, decoder and hardware.PortOS does not treat a published benchmark as a local ETA or promise real-timegeneration.++## Preview to final in the UI++The model picker’s **Choosing a model: preview → final** help distinguishes+small draft renders, a new generation on a quality model, declared **Finish**+pairs, and the gallery’s **Upscale** action. Cross-model seeds do not promise+the same composition. LTX-2.5 generative upscaling can change details and needs+its model pack; resizing preserves content without generating detail.++General presets include 384×256 and 256×384 small previews. FastH3 retains its+832×480 quality-check preset and offers a 512×288 test-size button in the help.+The latter is experimental, not a validated quality preset. Use the shortest+available duration and keep the trained four/eight-step schedule. Smaller+canvases reduce denoising work, not download, conversion, or model-load costs.diff --git a/scripts/fastvideo_h3_entry.py b/scripts/fastvideo_h3_entry.pyindex bb0e6b4d2b..c113133858 100644--- a/scripts/fastvideo_h3_entry.py+++ b/scripts/fastvideo_h3_entry.py@@ -34,6 +34,15 @@ def main():or not math.isfinite(shift) or shift <= 0):raise ValueError(f'Unsupported FastH3 {name} configuration')shifts.append(shift)+ contract = json.loads((Path(args.scheduler_root) / 'fastvideo_inference.json').read_text())+ rungs = contract.get('dmd_denoising_steps')+ if (contract.get('schema_version') != 'fasth3-inference-contract-v1'+ or not isinstance(rungs, list) or len(rungs) != args.schedule_steps+ or any(type(rung) is not int or not 0 < rung <= 1000 for rung in rungs)+ or any(left <= right for left, right in zip(rungs, rungs[1:]))+ or contract.get('video_scheduler_shift') != shifts[0]+ or contract.get('audio_scheduler_shift') != shifts[1]):+ raise ValueError('Unsupported FastH3 checkpoint inference contract')from fastvideo.mlx_runtime import minimax_h3_pipeline as pipeline# Both modules expose the scheduler shifts, and the converter imports the# values from ``minimax_h3`` while the inference pipeline reads its own@@ -41,10 +50,18 @@ def main():# conversion and inference using different schedules, which produces a# VSA checkpoint that fails during the first render. Keep the two module# views synchronized before either entry point is loaded.- h3 = (importlib.import_module('fastvideo.mlx_runtime.minimax_h3')- if importlib.util.find_spec('fastvideo.mlx_runtime.minimax_h3') else None)- if h3 is not None:- h3.MINIMAX_H3_VIDEO_SHIFT, h3.MINIMAX_H3_AUDIO_SHIFT = shifts+ h3 = importlib.import_module('fastvideo.mlx_runtime.minimax_h3')+ h3.MINIMAX_H3_VIDEO_SHIFT, h3.MINIMAX_H3_AUDIO_SHIFT = shifts+ # The upstream MLX scheduler uses a uniform linspace. V2's trained ladder+ # differs (999, 874, ...), so patch the function used by SchedulerState+ # before loading either entry point. Shift the shared noise clock once.+ def checkpoint_sigmas(shift, num_denoise_steps):+ if num_denoise_steps != len(rungs):+ raise ValueError('FastH3 step count differs from its trained ladder')+ base = [rung / 1000.0 for rung in rungs] + [0.0]+ return h3.np.asarray([shift * value / (1.0 + (shift - 1.0) * value)+ for value in base], dtype=h3.np.float32)+ h3.minimax_h3_sigmas = checkpoint_sigmaspipeline.MINIMAX_H3_VIDEO_SHIFT, pipeline.MINIMAX_H3_AUDIO_SHIFT = shiftssys.argv = [args.entry_script, *remaining]if args.convert:diff --git a/scripts/generate_fastvideo.py b/scripts/generate_fastvideo.pyindex bf09909f5b..6d93926e12 100755--- a/scripts/generate_fastvideo.py+++ b/scripts/generate_fastvideo.py@@ -259,8 +259,9 @@ def ensure_mlx_checkpoint(repo_dir: Path, model_root: Path, fmt: str, env: dict,if vsa:schedule = b"".join((model_root / name / "scheduler_config.json").read_bytes()for name in ("scheduler", "audio_scheduler"))+ schedule += (model_root / "fastvideo_inference.json").read_bytes()schedule_key = hashlib.sha256(schedule).hexdigest()[:12]- out_base = out_base / f"vsa-schedule-v1-{steps}-{schedule_key}"+ out_base = out_base / f"vsa-schedule-v2-{steps}-{schedule_key}"out_dir = out_base / fmtif is_converted(out_dir):return out_dirdiff --git a/scripts/generate_fastvideo.test.js b/scripts/generate_fastvideo.test.jsindex 2ad265093d..e55f5bfb20 100644--- a/scripts/generate_fastvideo.test.js+++ b/scripts/generate_fastvideo.test.js@@ -147,7 +147,9 @@ with tempfile.TemporaryDirectory() as tmp:root = Path(tmp)package = root / 'fastvideo' / 'mlx_runtime'package.mkdir(parents=True)- (package / 'minimax_h3_pipeline.py').write_text('MINIMAX_H3_VIDEO_SHIFT=12\nMINIMAX_H3_AUDIO_SHIFT=3\ndef _adaln_schedule_union(steps):\n return [MINIMAX_H3_VIDEO_SHIFT, MINIMAX_H3_AUDIO_SHIFT, steps]\n')+ (package / 'minimax_h3.py').write_text('from types import SimpleNamespace\nnp=SimpleNamespace(asarray=lambda values, dtype: values, float32=float)\n')+ (package / 'minimax_h3_pipeline.py').write_text('from . import minimax_h3 as h3\nMINIMAX_H3_VIDEO_SHIFT=12\nMINIMAX_H3_AUDIO_SHIFT=3\ndef _adaln_schedule_union(steps):\n return [h3.minimax_h3_sigmas(shift, steps) for shift in (MINIMAX_H3_VIDEO_SHIFT, MINIMAX_H3_AUDIO_SHIFT)]\n')+ (root / 'fastvideo_inference.json').write_text(json.dumps({'schema_version': 'fasth3-inference-contract-v1', 'dmd_denoising_steps': [999,874,749,624,500,375,250,125], 'video_scheduler_shift': 10, 'audio_scheduler_shift': 3}))for name, shift in [('scheduler', 10), ('audio_scheduler', 3)]:folder = root / namefolder.mkdir()@@ -161,10 +163,22 @@ with tempfile.TemporaryDirectory() as tmp:base = [sys.executable, str(wrapper), '--scheduler-root', str(root), '--schedule-steps', '8']for target, tail in [(converter, ['--convert']), (entry, ['--steps', '8'])]:print(subprocess.check_output(base + ['--entry-script', str(target)] + tail, env=env, text=True).strip())+ contract = root / 'fastvideo_inference.json'+ value = json.loads(contract.read_text())+ value['dmd_denoising_steps'][1] = 999+ contract.write_text(json.dumps(value))+ invalid_contract = subprocess.run(base + ['--entry-script', str(entry), '--steps', '8'], env=env, text=True, capture_output=True)+ print(invalid_contract.returncode != 0 and not invalid_contract.stdout and 'inference contract' in invalid_contract.stderr)(root / 'scheduler' / 'scheduler_config.json').write_text('{"_class_name":"MiniMaxH3Scheduler","shift":true}')invalid = subprocess.run(base + ['--entry-script', str(entry), '--steps', '8'], env=env, text=True, capture_output=True)print(invalid.returncode != 0 and not invalid.stdout and 'Unsupported FastH3 scheduler' in invalid.stderr)`}`);- expect(lines(output)).toEqual(['[10, 3, 8]', '[10, 3, 8]', 'True']);+ const [conversion, inference, invalidContract, invalid] = lines(output);+ const expected = [10, 3].map((shift) => [999, 874, 749, 624, 500, 375, 250, 125, 0]+ .map((rung) => shift * (rung / 1000) / (1 + (shift - 1) * (rung / 1000))));+ expect(JSON.parse(conversion)).toEqual(expected);+ expect(JSON.parse(inference)).toEqual(expected);+ expect(invalidContract).toBe('True');+ expect(invalid).toBe('True');});});diff --git a/scripts/generate_fastvideo_test.py b/scripts/generate_fastvideo_test.pyindex 955f7e9d16..03ea91a9e9 100644--- a/scripts/generate_fastvideo_test.py+++ b/scripts/generate_fastvideo_test.py@@ -268,6 +268,7 @@ class MlxCheckpointTest(unittest.TestCase):for name, shift in (("scheduler", 10), ("audio_scheduler", 3)):(root / name).mkdir()(root / name / "scheduler_config.json").write_text(json.dumps({"shift": shift}))+ (root / "fastvideo_inference.json").write_text("{}")base = Path(tmp) / "cache"dense = self.helper.mlx_checkpoint_root(root, base) / "int6"dense.mkdir(parents=True)