Skip to content

Filter Video Gen model dropdown to ltx2 runtime in a2v mode + auto-select largest model that fits#525

Merged
atomantic merged 2 commits into
mainfrom
a2v-dropdown-filter-by-mode
May 29, 2026
Merged

Filter Video Gen model dropdown to ltx2 runtime in a2v mode + auto-select largest model that fits#525
atomantic merged 2 commits into
mainfrom
a2v-dropdown-filter-by-mode

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • The Audio→Video mode previously showed every video model in the dropdown and rendered a warning telling the user to "switch the Model dropdown to one of the dgrauet entries" — which on installs where the dgrauet entries had been pruned from data/media-models.json referred to options that weren't in the list. The server enforces A2V_REQUIRES_LTX2 and would 400 on submit, so filtering client-side keeps the dropdown honest.
  • <ModelSelect> for a2v now receives only runtime === 'ltx2' models (via a visibleModels memo). The model-validation useEffect now 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 inside handleModeChange was removed — one source of truth.
  • For a2v, auto-select picks the highest-memory compatible model that fits within systemMemoryGb - 16 GB headroom (OS + text encoder + working set). On a 128 GB box this lands on ltx23_dgrauet_q8 (~25 GB); on a 32 GB box it lands on ltx23_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.
  • Server /api/video-gen/status now returns systemMemoryGb (rounded os.totalmem()) so the client can make the runnable-size decision. Additive, optional field — older clients ignore it; the new client gracefully falls back to POSITIVE_INFINITY budget when the field is absent.
  • The inline warning under the audio uploader now only fires when visibleModels.length === 0 — i.e. no ltx2 models are installed at all — and the copy explains how to add a dgrauet entry to data/media-models.json and provision the runtime with INSTALL_LTX2=1 bash scripts/setup-image-video.sh.

Test plan

  • Switch Video Gen mode to Audio. The Model dropdown only lists dgrauet (runtime: 'ltx2') entries.
  • Switch back to Text / Image / FFLF / Extend. Full model list reappears.
  • On a machine with both ltx23_dgrauet_q4 and ltx23_dgrauet_q8 installed and ≥ 48 GB RAM, switching into a2v auto-selects Q8 (highest that fits).
  • On a machine with both installed but < ~41 GB RAM (16 GB reserve + 25 GB model), auto-select lands on Q4.
  • When data/media-models.json contains no runtime: 'ltx2' entries, switching to a2v shows the new "no a2v-compatible models installed" warning and the dropdown is empty.
  • Connect a new client to an older server that doesn't return systemMemoryGb — auto-select still picks the largest dgrauet model (infinite budget fallback).
  • GET /api/video-gen/status includes systemMemoryGb: <integer> matching os.totalmem() rounded to GB.

atomantic added 2 commits May 28, 2026 22:48
…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.
@atomantic atomantic merged commit d282c21 into main May 29, 2026
2 checks passed
@atomantic atomantic deleted the a2v-dropdown-filter-by-mode branch May 29, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant