Repository navigation
feat(images): image creation settings in the Agent UI and the TUI - #6494
Conversation
55e3d79 to
3b13321
Compare
Adds image_model, image_size and image_steps to the shared config, the choices read off Lemonade's catalog, GET/PUT /api/images/settings, and the SD mixin following them when a request names no model.
GAIA always created images with SDXL-Turbo at its defaults. Settings › Image creation and /image now pick the model, size and steps, shared in ~/.gaia/config.json, and the flagship uses them when a request names no model. - Choices come from Lemonade's catalog: downloaded image models plus the legacy SD models that download on first use, each offering only sizes under its soft_pixel_cap. - Agent UI: settings pane, a notice when the chat model is too small to be offered image creation, and "Created an image" in the activity list. - TUI: /image, /image model|size|steps, a link to each created image and /image open. - An rtl rule now fails an <option> that carries the English hint.
Main's new Settings layout brought its own .settings-notice in a column, and this branch's rule for the same class gave the text a 16rem flex basis, so the notice stretched into a tall empty box. The pane now uses main's style alone. - The image-settings layout test asserts the notice stays under 160px; it fails on the old CSS. - settings-general screenshots updated for the Image creation entry.
Merging amd#6194 over the latest main undid two of main's changes to the image tools. A saved image's name stripped the model to "repomodelname" instead of "repo_model_name", and the path check stopped being swappable in tests, so main's variation-refusal test saw a real request. Model names in saved filenames use main's rule again, and runs of dots are replaced too, as amd#6194 asks. The path checks are called through their module.
5626e8f to
2894110
Compare
Three problems found driving both apps against a stand-in Lemonade: - With Lemonade down, Settings › Image creation printed a raw Python connection traceback. It now says Lemonade isn't answering, keeps the server's text as a detail line, and offers Try again. - The "too small to be offered image creation" notice named the chat model by its id (Gemma-4-E4B-it-GGUF) where the rest of the app says Gemma 4 E4B. - The TUI's /image never said that the chat model doesn't create images, so a Gemma user set options that never applied. It now gives the same warning, read from setup's catalog, and points to /models.
|
Verdict: Request changes This adds an image-creation setting (model, size, steps) shared by the Agent UI and the TUI, with choices read from Lemonade's catalog and checked before saving. The settings flow, the 422/503 handling and the tests are solid. Two things undo the feature in normal use and should be fixed before merge:
The image-gen skill also still tells the agent that SDXL-Turbo is the default and to tune for it. That's no longer true once a user picks another model. Real-world evidenceN/A: no evidence bundle was produced for this run. The verdict rests on static review and on the author's own description: a run against real Lemonade 2026.44.1 that saved SDXL-Turbo at 768×768 / 2 steps, refused 1280×720 and created a 768×768 PNG, plus end-to-end checks of both apps against a stand-in Lemonade. That description doesn't embed any before/after screenshot of the new Settings › Image creation pane. Please add one, rendered on the PR. 🔍 Technical details🟡 Saved size/steps skipped when the request names the saved model ( Add a test in 🟡 TUI records analysed images as created ( 🟡 Doc drift: image-gen skill still assumes SDXL-Turbo ( 🟢 Changing Strengths
|
…aved model Review fixes: - The image skill has the agent pass list_sd_models' default model by name, and that default is now the user's choice. Naming it counted as "a request that named a model", so the size and steps the user picked were dropped. Naming the saved model now keeps them. - The TUI recorded any tool result with an image_path as a created image, so asking about a photo printed "Created image: <the photo>" and /image open opened it. Only the four tools that create images count. - The image-gen skill still called SDXL-Turbo the default; it now says the default is the user's chosen model and scopes the few-step advice to Turbo models. The CLI reference says to reset image_size when changing image_model by hand. - The RTL audit's option rule exempts every language picker (options tagged with lang), including setup's, which made the Arabic setup screens fail.
test_export_openapi failed in CI because api.schemas.json and api.gen.ts lacked the image settings models.
The RTL audit flags an <option> that carries the bracketed English hint, which an option cannot style and whose brackets scramble right to left. The memory dashboard's category, context and priority pickers, the activity filter, the document target and setup's empty chat-model choice all did ("عنك (About you)"). They use t.bare now, as the rule asks.
# Conflicts: # src/gaia/apps/webui/visual/__screenshots__/settings-general-dark-win32.png # src/gaia/apps/webui/visual/__screenshots__/settings-general-light-win32.png
# Conflicts: # src/gaia/apps/webui/visual/rtl.visual.ts # src/gaia/config.py
# Conflicts: # src/gaia/apps/webui/src/components/AgentActivity.tsx
Read aloud landed on main and added entries in the same places as image creation; both are kept. The image settings calls move to imageApi.ts so api.ts stays under its size check.
Asking GAIA to describe, edit, upscale or vary a picture it had just made was refused: generated media sits in GAIA's own folder, which no approval can open. Those two folders are now readable, never writable, the same way transcripts are.
# Conflicts: # docs/guides/agent-ui.mdx # src/gaia/apps/webui/src/components/__tests__/AgentActivity.toolLabels.test.tsx # src/gaia/apps/webui/src/components/settings/SettingsDialog.tsx # src/gaia/apps/webui/src/i18n/locales/ar.ts # src/gaia/apps/webui/src/i18n/locales/en.ts # src/gaia/vlm/mixin.py # tui/internal/ui/components/helpoverlay.go
Main now labels generate_image "Made image" and maps its icon, so the duplicate label keys and the second ImageIcon import go.
|
Verdict: Approve with suggestions This PR lets users choose the image model, size and steps GAIA creates pictures with. The Agent UI gets a Settings › Image creation section, the TUI gets Fix before merging:
Non-blocking:
Real-world evidenceN/A: no evidence bundle was produced for this run. The verdict rests on reading the code, plus the author's own account of testing against a real Lemonade (2026.44.1): the route listed the models, saved 768x768 at 2 steps, refused 1280x720, and the mixin then created an image. The Agent UI pane and 🔍 Technical details🟡 Duplicate 🟢 Screenshot evidence (PR description) Checked, no finding:
Strengths
|
Main's tighter read rule for generated images (amd#8478) replaces this branch's folder-wide read grant for the image and audio folders; the security doc now describes main's rule.
Getting a document as audio used to take two hand-described steps,
produced only WAV (3 minutes is 9 MB), and showed no player once the
file was saved to a folder of your own. Now one sentence does it in the
Agent UI and the TUI: attach or name a PDF, Word, Excel, text or
Markdown file, say "turn this into audio", and GAIA records it, plays it
in the chat, and saves the audio where you asked. It reads the document
as written, or rewrites tables, charts, footnotes and web addresses into
spoken sentences when it has them, says which it chose, and saves that
listening script beside the audio.
What a reviewer should weigh:
- **One tool does the whole job.** `dictate_document` reads the file
itself, so a long document is never shortened by passing through the
model, and a new `dictation` skill tells the agent to call it without
questions.
- **The player works for any save location, with the media boundary
intact.** The recording always stays in GAIA's audio folder and a copy
goes to the user's path; `text_to_speech` now does the same. The only
change to what the Agent UI serves is `.mp3`.
- **MP3 needs nothing new.** It is Lemonade's own encoding of the Kokoro
voice, joined frame by frame: 3 min 16 s is 3.9 MB against about 9 MB as
WAV. A lower bitrate would need ffmpeg and is left out.
- **Long documents show progress and stop cleanly** in both apps. The
TUI's live line now shows a running tool's own progress, which also
benefits other long tools.
- **A rewrite cannot change a number.** Every figure in a listening
script is checked against the document before recording. Gemma 4 E4B
wrote 13,110 for 13,100 on the test report; that is now asked for once
more and, if still wrong, refused with as-written offered instead.
- **Numbers are respelled for the voice.** Transcribing the voice back
showed it misreads decimals ("3.5" as "three. five"), footnote marks,
and abbreviations; those are fixed before recording.
Limits, stated in the guide: English Kokoro voices only (other Lemonade
speech models are not offered, as GAIA has not proven them); charts are
described from the document's text, not the picture; one dictation
covers about two hours of audio, and a longer document is recorded in
page ranges.
Two notes for the reviewer:
- **No eval was run.** This adds a tool, a skill and a tool bundle,
which is LLM-affecting, but another session's eval was running on this
machine, and evals run one at a time. Categories to watch on the next
RC: `tool_selection`, `gaia_tool_selection`, `web_system` (it holds the
`text_to_speech` scenario) and `rag_quality` (the document tools next to
it). The `dictation` skill is listed as deferred in the skill-scenario
coverage test, because the text lanes cannot judge audio.
- **Not the same as the voice-typing "dictation" in #6789.**
That is speech to text in the composer; this is document to audio. This
PR does not need the generated-media read grant from #6494.
## Screenshots
The audio card after a dictation saved to a folder of the user's, from
the `rtl.visual.ts` scene (English, then Arabic). The path stays left to
right inside the Arabic line.


## Test plan
Run against the real apps from an isolated GAIA home, chat model
DeepSeek through Fireworks, voice `kokoro-v1` on Lemonade.
- [x] Agent UI, typed path and a named folder: listening form chosen for
a 2-page report with a table, chart and footnote; player in the chat
(3:27); MP3 and `.script.md` saved in the folder; the reply named the
form and why
- [x] Agent UI, PDF dropped on the composer, "word for word": as-written
MP3 with a player and no permission prompt
- [x] Agent UI, 36-page PDF (20,000 words): refused as too long with a
page range, then recorded in parts; the first part ran 10 minutes as one
tool call and produced 34 min 28 s of audio with progress shown
throughout; Stop during the next part ended the turn and left no partial
file
- [x] TUI: one sentence produced the MP3 and script in the named folder,
progress on the live line, and the audio card with its open and reveal
keys
- [x] Listen-back with Whisper Large v3 Turbo: listening form 95.6% word
match (1 of 62 numbers heard differently, and correct when that sentence
was recorded alone); as-written 90.1% with every number heard; the last
two minutes of the 34-minute file 95.5% against the script's end
- [x] `python -m pytest tests/unit/test_dictation.py
tests/unit/test_lemonade_speech.py
tests/unit/chat/ui/test_generated_media.py
tests/unit/test_chat_tool_requests.py`
- [x] Routing: "Read notes.pdf aloud and save it as report.mp3",
"Narrate chapter1.txt and save as chapter1.wav" and six more variants
offer `dictate_document` first; "Transcribe meeting.mp3", "what does
interview.mp3 say?" and six more that read an existing audio file still
offer `transcribe_media` (`tests/unit/test_chat_tool_requests.py`)
- [x] `python -m pytest tests/unit/test_flagship_tool_labels.py`
(activity label in English and Arabic, live-progress phrase)
- [x] `python -m pytest
hub/agents/gaia/python/tests/test_chat_dictation_tool.py
hub/agents/gaia/python/tests/test_chat_tts_tool.py`
- [x] `cd src/gaia/apps/webui && npm test && npm run test:rtl` (3,449
unit and 456 visual tests pass; a new visual test renders the audio card
with its "Saved to" and "Script saved to" lines in English and Arabic,
and both were read on screen)
- [x] `cd tui && go test ./internal/ui/...`
- [x] `python util/lint.py --tool-descriptions`, black, isort, and
`python util/check_doc_links.py --internal-only`
- [x] Listening rewrite on Gemma 4 E4B (local, GPU): 6 of 7 runs passed
the figure check (one after its retry), 1 was refused for a wrong
figure; a full dictation gave 3 min 33 s of audio in 90 s with 95.1%
listen-back match
- [ ] Not tested: the listening rewrite on Qwen3.6; Linux and macOS; the
packaged desktop app
---------
Co-authored-by: Kalin Ovtcharov <[email protected]>
main already carries an earlier copy of this change (merged in with amd#6494), so the merge keeps main's follow_user_settings and keeps this branch's opt-in default, the not-downloaded model check, and the index-first output names.
GAIA always created images with SDXL-Turbo at its defaults, whatever image models you had downloaded, and neither app had a setting for it. Now Settings › Image creation in the Agent UI and
/imagein the TUI pick the model, size and steps, shared through~/.gaia/config.json, and the agent uses them whenever a request names no model.soft_pixel_cap, so a saved setting is one the model can run. Automatic keeps the model's own size or steps./imageshows and sets the same settings (and gives the same too-small-chat-model warning), a created image prints as a link, and/image openopens it in the PC's viewer.GET/PUT /api/images/settings; 422 names a model this Lemonade doesn't have or a size it doesn't take, and nothing is saved.Stacked on #6194 (image editing and upscaling) and merges it in, since both change the SD mixin. Merge #6194 first; its edit and upscale tools stay off by default, as that PR intends.
The
generate_imagedocstring now says an omitted model means "the user's chosen image model". Eval category to watch at the next RC:vision(sd_graceful_degradation).Test plan
pytest tests/unit/chat/ui/test_image_settings.py(choices from a catalog slice, pixel caps, config coercion, routes incl. 422/503, the mixin using saved settings, a removed saved model) plus the SD, image-edit and local-only suites from main and feat(images): add Lemonade image editing and upscaling #6194 (281 pass)npm test(2,457) andnpm run test:rtl, with image settings in Arabic light/dark and English; a new rule fails when an<option>carries the bracketed English hint, which this pane did before the fixgo build ./...,go vet ./...,go test ./...intui/, and the drift test pinning the TUI's size list togaia.sd.settings/image; switching to a model that can't make the saved size reset it to Automatic; a removed saved model and a Lemonade that stops answering each get a plain message (Try again recovers)/imagein the TUI