Filter Video Gen model dropdown to ltx2 runtime in a2v mode + auto-select largest model that fits#525
Merged
Merged
Conversation
…ck the largest model that fits The model dropdown previously offered every video model in every mode, leaving the user staring at a warning telling them to switch to a model that wasn't even in the list. a2v requires the ltx2 runtime (server enforces A2V_REQUIRES_LTX2), so filter the options to compatible models when mode is a2v. Auto-select picks the highest-memory ltx2 model that fits within systemMemoryGb - 16 GB headroom (OS + text encoder + working set). Falls back to the smallest if nothing fits so the user can still try. Server /status now returns systemMemoryGb via os.totalmem() to drive the choice client-side. When no ltx2 models are installed at all, the inline warning explains how to add a dgrauet entry + provision the runtime, replacing the old copy that pointed at entries that may not exist.
… name the swapped model in toast + cover new status field - typeof status?.systemMemoryGb === 'number' so 0 GB (sub-GB box) flows through the fits check and picks the smallest model instead of being treated as 'absent, assume unlimited' and picking the largest. - Toast on stale-id swap now names the destination model. In a2v mode the fallback is the largest-fits model, not status.defaultModel, so 'using default' was misleading. - Pin systemMemoryGb (type + > 0) in the /status route test so a future accidental removal of the field is caught.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
data/media-models.jsonreferred to options that weren't in the list. The server enforcesA2V_REQUIRES_LTX2and would 400 on submit, so filtering client-side keeps the dropdown honest.<ModelSelect>for a2v now receives onlyruntime === 'ltx2'models (via avisibleModelsmemo). The model-validationuseEffectnow also checks mode-compatibility, so switching to a2v while an mlx_video model was selected auto-swaps to a compatible model on the next render. The previous bespoke auto-select insidehandleModeChangewas removed — one source of truth.systemMemoryGb - 16 GBheadroom (OS + text encoder + working set). On a 128 GB box this lands onltx23_dgrauet_q8(~25 GB); on a 32 GB box it lands onltx23_dgrauet_q4(~16 GB) — Q8 wouldn't fit the budget. If nothing fits, falls back to the smallest model so the user can still try and let the install banner / OOM surface the constraint./api/video-gen/statusnow returnssystemMemoryGb(roundedos.totalmem()) so the client can make the runnable-size decision. Additive, optional field — older clients ignore it; the new client gracefully falls back toPOSITIVE_INFINITYbudget when the field is absent.visibleModels.length === 0— i.e. no ltx2 models are installed at all — and the copy explains how to add a dgrauet entry todata/media-models.jsonand provision the runtime withINSTALL_LTX2=1 bash scripts/setup-image-video.sh.Test plan
runtime: 'ltx2') entries.ltx23_dgrauet_q4andltx23_dgrauet_q8installed and ≥ 48 GB RAM, switching into a2v auto-selects Q8 (highest that fits).data/media-models.jsoncontains noruntime: 'ltx2'entries, switching to a2v shows the new "no a2v-compatible models installed" warning and the dropdown is empty.systemMemoryGb— auto-select still picks the largest dgrauet model (infinite budget fallback).GET /api/video-gen/statusincludessystemMemoryGb: <integer>matchingos.totalmem()rounded to GB.