Skip to content

Studio: download a local model from Studio - #1161

Draft
sosidudku1 wants to merge 9 commits into
rel/xp-buildfrom
feat/ato-1395-studio-download
Draft

sosidudku1 wants to merge 9 commits into
rel/xp-buildfrom
feat/ato-1395-studio-download

Conversation

@sosidudku1

@sosidudku1 sosidudku1 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

What

A local image or video model that was not on disk could not be fetched from Studio: the footer said "not downloaded yet", Generate stayed on and answered MODEL_NOT_DOWNLOADED with only a Close button, although the bridge has localDownload and studio/CONTRACT.md asks for Download there. With the chat local and no image model on the computer, the page was a dead end.

  • A local model that is not downloaded shows Download with the size still to fetch, then a progress bar with Stop (a stopped download resumes next time), or why it failed (disk space, Hugging Face token for gated models). Generate waits until it is on disk.
  • The MODEL_NOT_DOWNLOADED error card gets a Download button. On Images it passes the current mode as workflow, so the extra file an edit or reference mode needs is fetched too.
  • Chat local and no model here: "No image (video) model on this computer yet" with Download for a model that fits this machine, smallest first, no gated one unless nothing else. On a computer that cannot run local models (engine.state: 'unsupported'), a line to switch the chat to the cloud instead. A cloud chat with no OpenRouter key keeps its "Add a key" line; nothing falls back to a local model.
  • The catalog asks for the image engine when nothing has asked yet, so engine.state: 'unsupported' is there on the first read, and localDownload refuses with ENGINE_UNSUPPORTED on such a computer before any byte moves. An engine event repaints Images.
  • Download from the footer and the empty field also passes the mode as workflow.
  • When a download lands, or is stopped (part files change the size left), the catalog is read again; on landing the model is chosen. Downloads still running after a window reload come back from localState().

The Download button is the proposal in ATO-1308 and still needs the owner's ok.

Why

Linear ATO-1395 and ATO-1308.

Stack

Stacks on #1114 and #1157, #1158, #1159 and #1160 (same files). This PR's own change is the top two commits (the second answers review).

How it was verified

  • Unit tests added: studio-images.test.mjs (which quant, the offer, progress words, footer and empty-field HTML, Generate off) and studio-video.test.mjs (download from the page, progress, Generate unblocked after the download, a cancel and an engine change read the catalog again) and studio-local.test.mjs (a download refused on an unsupported computer, the catalog section asking for the engine). Not run yet.
  • To check in the app, on a clean state folder: chat Local with no image model: Images shows the line and Download; the download runs with a bar; afterwards the model is selected and Generate works.

Not yet checked on the second Mac.

…oaded

Generate loads a downloaded local model by itself, so telling the user to
load it first was wrong. Images and Video now say the model loads when
Generate is pressed, or that it is not downloaded yet.
Studio named the machine "this Mac" everywhere: the local model group in
the Images and Video pickers, the model row, the footer, the progress card,
the mode hints and the first-frame notice. A Windows user saw "On this Mac
· free, private" (ATO-1400).

The words now follow the platform the bridge reports, the same rule as
renderer.js THIS_MACHINE: "this Mac" on macOS and in the demo, "this
computer" on Windows and Linux. "Show in Finder" follows the chat's
fileManagerName() (Explorer / Folder). The mode-hint rule no longer matches
on the hint's own words.
The Images and Video pages read the model catalog once per window. After
the first local generation (which loads the model by itself) the footer
still said "loads when you press Generate" and the picker "Not loaded"
until the window was reloaded (ATO-1394).

The shell now hands every non-core BR.studio.onLocal event to the pages'
optional onLocal. A page reads the catalog again, quietly and once per
burst, when a model finished loading (or failed to), a download finished,
a model was removed, or one of its local jobs ended. Only the models' facts
change: the chosen model, the form and the prompt stay.
The Images and Video pages kept their own model choice, so with the chat
on OpenRouter Studio still opened on a local FLUX it had been set to once
(ATO-902). Owner decision 25.10: Studio always works where the chat does.

- STUDIO.chatPlace() answers 'local', 'cloud' or null (settings not read
  yet) from selBackend() and rmNow(); a custom server counts as local,
  Fusion follows its orchestrator, as Improve prompt does (ATO-1304).
- Images and Video open on a model of that place: the one last chosen
  there, else in the cloud the default, locally a loaded model, else a
  downloaded one; with nothing there, no model rather than the other
  place. Each place remembers its own choice (ATO-1305, ATO-1306).
- When the chat has moved since the page was last shown, the page reads
  the catalog again and switches model, keeping the prompt. Never while
  a job is being made; it catches up when the job ends.
- The Video first-frame hint asks to switch the chat to the cloud
  instead of picking a cloud model.
With Studio following the chat (previous change), a picker that still
listed both groups invited a choice Studio would undo on the next switch
(ATO-1307).

- The Images and Video pickers show only the current place's group, with
  "Studio follows your chat" and how to reach the other place. Before the
  settings are read, both groups as before. The pick verb still takes any
  model, so the live drive can choose one by id.
- "Restore these settings" on a picture or clip made in the other place
  brings back its prompt and settings and keeps the current model, saying
  why.
- The greyed-mode hints for a cloud model now say to switch the chat to
  local instead of naming a model the picker no longer offers, and the
  "Pick one" link counts only the models the picker shows.
A local image or video model that was not on disk had no way to get it:
the footer said "not downloaded yet", Generate stayed on and answered
MODEL_NOT_DOWNLOADED with only Close, although the bridge has
localDownload and CONTRACT.md asks for Download there (ATO-1395). With
the chat local and no image model on the computer, the page was a dead
end (ATO-1308).

- A not-downloaded local model shows Download with the size still to
  fetch, then a bar with Stop (a stopped download resumes), or why it
  failed (disk space, Hugging Face token). Generate waits for it.
- The MODEL_NOT_DOWNLOADED error card gets a Download button; on Images
  it passes the mode, so an edit or reference mode's extra file is
  fetched too.
- Chat local, no model here: "No image (video) model on this computer
  yet" with Download for a model that fits, smallest first. On a
  computer that cannot run local models, a line to switch the chat to
  the cloud instead.
- When the download lands the catalog is read again and the model is
  chosen; downloads still running after a window reload are picked up
  from localState().
…re offering Download

The catalog asks for the image engine when nothing has yet, so the page sees
'unsupported' on its first read. A download is refused with ENGINE_UNSUPPORTED
on such a computer, an engine event repaints Images, a cancelled download reads
the catalog again, and Download from the footer or the empty field sends the
mode in use.
@sosidudku1
sosidudku1 force-pushed the feat/ato-1395-studio-download branch from 465979a to a14612e Compare November 10, 2026 23:54

This branch has not been deployed

No deployments
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