Skip to content

Studio: image and video generation follow each model's defaults and prompting tips, and /v1/videos takes Unsloth Studio controls - #14078

Merged
danielhanchen merged 18 commits into
unslothai:mainfrom
Etherll:studio-g1-model-defaults-prompt-tips
Oct 19, 2026
Merged

danielhanchen merged 18 commits into
unslothai:mainfrom
Etherll:studio-g1-model-defaults-prompt-tips

Conversation

@Etherll

@Etherll Etherll commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

/api/inference/images/generate used fixed defaults of 9 steps and guidance 0 when a caller left them out. Those values only suit turbo models. Omitted steps and guidance now come from the loaded model: the diffusers generation_defaults when the status reports them, else the family table (sd.cpp and MLX). /v1/videos also accepts the Unsloth Studio generation controls that /video/generate already had, and the MCP generate_image and generate_video tools expose the new options.

Changes

Images:

  • The image route reads the defaults again on each retry attempt, so a model replacement between attempts brings its own values, and it pins the load it read them from. /v1/images now uses the same _image_generation_defaults helper.
  • A request that leaves out steps or guidance while another client's image load is still running is pinned to "nothing loaded". The engine then refuses the new model on its first try, and the retry reads that model's defaults instead of running it with 9 steps and guidance 0.
  • MCP generate_image refuses requests the engine cannot run before uploading anything: reference, edit or outpaint without init_image, outpaint without mask_image, and upscale <= 1. It also takes seeds and prompts lists (up to 32) for a batch in one call.
  • studio_status image now reports workflows, generation_defaults, dimension_multiple, max_condition_images and prompt_hint.

Prompt hints:

  • Image and video families have an optional prompt_hint, returned in the status of every engine (diffusers, sd.cpp, MLX, video). FLUX.1 Kontext, Qwen-Image-Edit, Qwen-Image 2.1 and Ideogram 4 have one. No video family sets one yet.
  • The Images and Video pages show the hint as the Prompt field's info hint. It is hidden for external image providers.
  • New bundled image-prompting skill, off by default. It tells the model how to expand a short request into a detailed prompt, and to leave steps and guidance unset so the model's defaults apply.

Videos:

  • /v1/videos accepts seed, negative_prompt, steps, guidance, num_frames, fps, last_frame, reference_images (up to 9) and reference_audios (up to 3, as data URLs, uploads or Unsloth Studio audio ids {"input_id" | "clip_id" | "voice_id"}). These work in both JSON and multipart bodies.
  • The new fields are validated before any model switch, including the family checks, image decoding and audio id resolution. Sending both seconds and num_frames returns 400. So do last_frame with references, input_reference with reference_images, and reference audio with no reference image.
  • MiniMax-H3 always writes its clip at 24 fps, so /v1/videos refuses another fps for it (400, param: fps) rather than computing the frame count and the reported length from a rate the file never plays at. The check runs before a switch, on the resident model, and on the pinned snapshot that auto-switch and managed accounts use.
  • last_frame and each reference_images entry take the same 32 MB image input_reference takes. Before, their base64 cap stopped images at about 24 MB. Each reference audio takes a full 24 MB clip as a data URL. A stored reference audio is sized before it is read. Multipart reference lists keep the order they were sent in, across the reference_images and reference_images[] spellings, and are counted before any file is encoded. Before an automatic switch, each reference audio is decoded the way the engine would, so an unreadable clip is a 400 instead of a failure after the new model loads.
  • One request body carries about 32 MB of inline images and audio in all; the field descriptions say so and point larger or several audio clips at Unsloth Studio audio ids.
  • When no seed is sent, the route draws one before the retry loop, stores it on the job and returns it in the job response. A plain OpenAI-shaped request behaves as before, except that the response now includes seed.
  • MCP generate_video exposes the same controls, accepts seconds as a number or a string, accepts fractional seconds, refuses images over the 32 MB one /v1/videos request carries, audio over 24 MB, and field combinations the route refuses (before it uploads any audio), and returns the seed on the job and from get_job. studio_status video now reports prompt_hint, supports_last_frame, references and size_presets.

studio/MCP.md lists the new tool options.

Testing

New tests: test_image_generate_model_defaults.py, test_openai_videos_controls.py, test_mcp_tools_video_controls.py, test_mcp_status_media_slots.py, test_diffusion_prompt_hint.py and studio/frontend/tests/images-prompt-hint.test.ts. Updated in place: test_mcp_tools_images.py, test_mcp_tools_status.py, test_mcp_tools_video.py, test_skills.py and test_video_families.py.

  • The new and updated backend tests pass. They cover:
    • each MCP refusal, checked before any route call;
    • the image fill on diffusers, sd.cpp and MLX shapes, including the model-replaced retry;
    • a plain OpenAI /v1/videos request, which still sends begin_generate exactly its old arguments plus seed;
    • the seed surviving a restart, with old records loading seed: null;
    • audio ids resolving in the caller's account.
  • Review follow-ups (bef45ec6b9 to b1d07abd7c) each come with tests that fail on the earlier head: the H3 fps refusal (before a switch, resident and pinned), multipart order and count, the audio size checks, the 32 MB image and 24 MB audio caps, the MCP image budget, body cap and pre-upload checks, fractional MCP seconds, the pre-switch audio decode and the in-flight load retry. Affected suites at the final head (image and video routes, /v1/videos, /v1/images, account pinning, MCP tools and server, skills, families, prompt hints): 825 passed, 1 failed. That one, test_video_download_plan_judges_a_quantized_reference_pick_per_partition, fails the same way on main here (no PyAV).
  • Each fix was checked to be load-bearing. With the image fill disabled, 4 route tests fail. With the per-attempt reset removed, the replacement-race test fails. With the video seed record line and None filter removed, 5 tests fail.
  • Affected backend suites (images, video, MCP, account media, skills, sd.cpp, MLX, family freeze): 2,498 passed, 15 failed. 14 of the failures fail the same way on main in this environment (no PyAV, and a huggingface-hub version mismatch). The 15th, test_begin_load_answers_without_waiting_on_the_header_probe, is a timing test that passed 3 of 3 runs on its own.
  • UNSLOTH_FREEZE_UPDATE=1 regeneration of the diffusion family freeze leaves the fixture unchanged. It records accessor outputs, not family rows.
  • Frontend: npm run typecheck, and 230 image and video node tests pass.
  • ruff check (0.16.10) is clean, and the repo formatter (ruff 0.6.9) is a no-op on the changed files.

The UI before/after screenshots and the GPU harness runs (hero portrait plus same-character shots with no HTTP 400s; two same-seed video takes) follow in a comment.

UI before / after

With FLUX.1 Kontext loaded, the Images page Instruction field gains an info icon whose tooltip reads 'Write the change you want as an instruction, such as "make the sky orange", not a description of the whole picture.' Before this PR the field has no icon. BEFORE is the merge base, AFTER is this PR, two separate installs, each loading the same tiny FLUX.1 Kontext pipeline through the real load route.

Instruction field hint before and after

…rompting tips, and /v1/videos takes Unsloth Studio controls

- /api/inference/images/generate resolves omitted steps and guidance from the
  loaded model (diffusers generation_defaults, else the family table for
  sd.cpp and MLX), per retry attempt, and pins the model it read.
  /v1/images shares the same helper.
- MCP generate_image refuses workflows the engine cannot run (reference or
  edit or outpaint without init_image, outpaint without mask_image,
  upscale <= 1) before any upload, takes seeds/prompts batches, and
  studio_status image carries workflows, generation_defaults,
  dimension_multiple, max_condition_images and prompt_hint.
- Image and video families gain an optional prompt_hint, exposed in every
  engine's status, shown as the Prompt field's info hint on the Images and
  Video pages, plus an off-by-default image-prompting bundled skill.
- /v1/videos accepts seed, negative_prompt, steps, guidance, num_frames,
  fps, last_frame, reference_images and reference_audios (data URLs or
  Unsloth Studio audio ids), keeps the family checks before any model
  switch, and draws, stores and echoes a seed when none is sent. Plain
  OpenAI-shaped requests are unchanged apart from the added seed.
- MCP generate_video exposes those controls, takes seconds as a number or
  a string, and echoes the seed on the job and in get_job.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-19T00:35:09.431377Z 7e73f31 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…g a load

- MiniMax-H3 writes at a fixed 24 fps, so /v1/videos refuses another fps instead of misreporting the clip length.
- last_frame and each reference image take the same 32 MB image input_reference takes.
- The MCP generate_video budget matches what one /v1/videos request carries (32 MB of images, body cap checked before the call).
- Stored reference audio is sized before it is read; multipart reference lists keep their wire order.
- /images/generate with omitted steps or guidance during another client's load retries on the new model's defaults.
@Etherll

Etherll commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator Author

UI before/after and GPU runs for this PR. The frontend is unchanged since d0ffef38b7, so the screenshots hold for the current head b1d07abd7c.

Prompt tip on the Images and Video pages

main on the left, this branch on the right. Both sides got the same status fixtures (CPU Unsloth Studio builds, Playwright Chromium, 1440x900, light).

Prompt tip before and after

Scene main this branch
Images, FLUX.1 Kontext (has a tip) no info hint info hint next to Instruction, tooltip shows the Kontext tip
Images, model without a tip no info hint no info hint, layout unchanged
Video, tip injected for the screenshot no info hint info hint next to Prompt
Video, no tip no info hint no info hint, layout unchanged

No video family ships a tip yet, so the Video row only shows the wiring. No console errors in any scene. Per-scene shots and the measured facts are in the evidence folder.

GPU runs through MCP (one B200)

  • Hero portrait plus same-character shots. generate_image with Z-Image-Turbo for the hero, then three workflow="edit" calls on Qwen-Image-Edit-2511 (Q4_K_M) with the hero as init_image. No call sent steps or guidance. 16 MCP calls, 0 errors, 0 HTTP 400s.
  • Same seed, same take. Wan2.2-TI2V-5B (Q4_K_M), 1 s at 1280x704. The first generate_video sent no seed and got seed: 7209342272158499 back on the job and from get_job. A second call with that seed produced a byte-identical MP4 (both md5 d66248f222be7fdf63298448043840ab).

Review follow-ups (bef45ec6b9 to b1d07abd7c)

MiniMax-H3 refuses a custom fps on /v1/videos, including on the pinned path that auto-switch and managed accounts use. last_frame and reference images take the full 32 MB, and reference audio the full 24 MB. Stored reference audio is sized before it is read. Multipart reference lists keep their order and are counted before encoding. Reference audio is decoded before an automatic switch. The MCP generate_video budget matches what one /v1/videos request carries, and the tool refuses oversized audio and invalid field combinations before uploading anything. An image request that leaves out steps or guidance during another client's load gets the new model's defaults. Each has a test that fails on the earlier head.

With auto-switch on or a managed account, the route reads generation_snapshot(), which carries no family key, so the fixed-fps check read None and let fps through. Read the family off the pinned state instead.
…uploading it

/v1/videos takes at most 24 MB per reference audio, but audio_ref uploads up to 200 MB first, so a large local file was read, sent and stored only to be refused.
…combinations before uploading audio

- Each reference audio string now fits a 24 MB clip as a base64 data URL with its header, the size the upload and audio id paths accept.
- reference_images and reference_audios say one request body carries about 32 MB of inline media, and that larger or several clips go as Unsloth Studio audio ids.
- MCP generate_video refuses seconds with num_frames, last_frame with references and first_frame with reference_images before it uploads any audio.
…econds take fractions

- Before an automatic switch, each reference audio is decoded the way the engine would, so an unreadable clip is a 400 on reference_audios instead of a failure after the requested model loaded.
- MCP generate_video's seconds accepts a fractional number such as 2.5, as /v1/videos does.
More than 9 reference_images (or 3 reference_audios) in a multipart body were each base64-encoded before the request model refused the count, so ten modest files could grow past 50 MB in memory.
@danielhanchen

Copy link
Copy Markdown
Member

@codex security review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4782549b35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

or bool(body.reference_images or reference_audios),
)
# Decoded here, like the images above, so unreadable audio never costs a switch.
_refuse_unreadable_audio(reference_audios)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preflight audio when no model switch occurs

When model is omitted, auto-switching is disabled, or the requested model is already resident, maybe_auto_switch_media_model never invokes its before_switch callback, so this only production call to _refuse_unreadable_audio is skipped. A corrupt but valid-base64 reference_audios item then reaches PyAV in begin_generate; errors such as InvalidDataError/FFmpegError are not handled by this route's ValueError and RuntimeError catches, turning bad client media into a 500 instead of the intended 400. Run this preflight for every request before the optional switch.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not reachable as a 500: PyAV raises InvalidDataError for undecodable input, and in PyAV 19 that class subclasses ValueError (MRO InvalidDataError -> FFmpegError -> ValueError), so begin_generate's decode failure lands in this route's except ValueError and returns 400. The preflight only exists so unreadable audio never costs a model switch.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up in 2528986: ordinary corrupt audio was already a 400, but a codec the FFmpeg build cannot decode raises a non-ValueError, so requests with no switch now run the same readability check before rendering.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8bd89f7edb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +50554 to +50556
expected_load = load_identity(
status.get("repo_id"), status.get("base_repo"), status.get("family")
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the checkpoint file in the defaults pin

When omitted defaults are used and another load replaces a local model with a different GGUF/safetensors file in the same repo/base/family between this status read and generate, this pin still compares equal because LoadIdentity contains only those three values. _image_generation_defaults explicitly depends on gguf_filename and the checkpoint-content variant, so variants such as FLUX dev and schnell in one directory can run the replacement checkpoint with the previous variant's steps/guidance instead of taking the retry; include the selected checkpoint/build in the identity used for this pin.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not this PR's contract: the (repo, base, family) load identity and its pin predate this change (#9448) and the OpenAI image route already used it on main. Reaching it needs a concurrent load of a sibling checkpoint in the same repo between the status read and generate; widening the identity touches all three engines and belongs in its own change.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 18, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 18, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 18, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 18, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 18, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 18, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 8bd89f7edb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

Etherll added a commit to Etherll/unsloth that referenced this pull request Oct 18, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 96966f031f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 18, 2026
@danielhanchen
danielhanchen merged commit 4a1037e into unslothai:main Oct 19, 2026
danielhanchen added a commit that referenced this pull request Oct 19, 2026
…ed local models (#14110)

Includes #14078 (Studio: image and video generation follow each model's
defaults and prompting tips, and /v1/videos takes Unsloth Studio
controls); review the last 10 commits (bbee492..HEAD). The own
commits are bbee492, 809dc77, c713699, 282a66e and
d14fb5b, plus a pre-commit.ci formatting commit (1d466b6); the
merges only bring in #14078's latest heads, `main` (the one conflict,
the bundle budget, keeps both raises) and that formatting commit.

## Summary

In chat, the Images pill only worked with a hosted provider's built-in
`image_generation`. A local chat model, or any model that calls Unsloth
Studio tools, could not use the image or video model loaded in Unsloth
Studio. Now the Images pill and the + menu's Images item show for these
models whenever a text-to-image or video model is loaded. With the pill
on, a turn offers `generate_image` and/or `generate_video`, and the
result shows inline in chat as an image or a playable video.

Neither tool loads, unloads or switches a model. Hosted image models
keep their own `image_generation` as before.

## Changes

Backend:

- `generate_image` (`core/inference/generate_image_tool.py`) runs the
Images route's local path on the server loop, bound to the chat's
account. So the image lands in that account's gallery and goes through
the same access checks as `POST /api/inference/images/generate`. The
route is split in place: `generate_diffusion_image` keeps its provider
branch and then calls `_generate_diffusion_image_core(request)`, with
the body unchanged. The tool builds the request only from the arguments
the model sent, so omitted steps and guidance follow the loaded model's
defaults (#14078). `negative_prompt` is offered only when the loaded
model supports it. The size is snapped to a multiple of 16 between 256
and 2752.
- `generate_video` (`core/inference/generate_video_tool.py`) goes
through the `/v1/videos` job path (`_create_openai_video`) with no model
named, so the auto-switch returns at once and nothing loads. It polls
the job and copies the finished `.mp4` into the chat's files. Clip
lengths and sizes in its description come from the loaded model's
`defaults`.
- Both tools append the model's `prompt_hint` (#14078) to their
description. They return `Error: ...` results for:
  - nothing loaded, or an edit-only image model;
  - another image or video already rendering;
  - another account on the GPU;
  - Stop;
- a timeout. Image generation is stopped on the GPU too. A video is left
rendering, and the result says to find it on the Video page.
- The tools are offered only when the request names them in
`enabled_tools` and a model the account may use is loaded. The server
loop is captured lazily in `_select_request_tools` the first time a
request offers them. There is no `main.py` or lifespan change.
- Keep-warm counts each chat-tool call exactly once, in the tool
wrapper. The HTTP route is still counted only by the middleware.
- One `MEDIA_CHAT_TOOLS` set (`core/inference/media_chat_tools.py`)
feeds:
  - the file and image sentinels;
- `_ALWAYS_SAFE_TOOLS` and the Anthropic unprompted-safe list (the
Anthropic path never selects these tools);
- the dedupe exemption in the controller, `llama_cpp.py` and
`safetensors_agentic.py`. Two identical calls are two images.

Frontend:

- One rule decides whether the pill shows: the provider's built-in image
generation, or a local tool, meaning the model calls Unsloth Studio
tools and an image or video model is loaded. It applies in the thread
composer, the compare composer and the + menu.
- Readiness comes from the image and video status endpoints. It is
re-read on mount, when a model load settles, when an image or video
model is ejected, and on window focus. Another account's hidden model
(`yours: false`) and an edit-only image model don't count.
- Like RAG, the local pill takes composer room only while it is on, so
the pill-count layout is unchanged while it is off.
- The stored Images choice is limited by what the model can do, not by
whether an image model is loaded right now. Loading and unloading an
image model doesn't drop a chat's Images setting. Images stays one
setting, as Search and Code are: turning it on for a local model also
leaves it on for a hosted image model.
- Gemini's image mode still turns off Code only for hosted image models.
- The `generate_image` card fetches the PNG from the chat's sandbox. It
has Download and no Edit, because Edit needs an OpenAI image-generation
call id. The new `generate_video` card plays the `.mp4` inline, with
Download.
- The frontend `MEDIA_CHAT_TOOLS` set feeds `SANDBOX_FILE_TOOLS`,
`IMAGE_SENTINEL_TOOLS`, the tool-fold exemptions and the
response-details labels. A test keeps it equal to the backend set.
- The bundle budget goes up by 4,975 B raw and 1,658 B transfer (chunk
count unchanged at 95). That is the image and video cards in the eager
tool UI registry, plus the composer and adapter gates in the chat chunk.
The measurement is in `check-bundle-budget.ts`.

## Testing

- New: `test_generate_image_tool.py`, `test_generate_video_tool.py`,
`studio/frontend/tests/chat-images-local-tool.test.ts` and
`tests/studio/test_generate_image_frontend_contract.py`. Extended:
`test_llama_cpp_tool_loop.py`, `test_nudge_tool_calls_wiring.py` and
`image-sentinel-tools.test.ts`. They cover:
- which tools are offered, including a managed account that can't see
the model;
  - `negative_prompt` per family;
- a managed account's chat image landing in its own gallery and passing
`require_media_generation_access`;
  - Stop and timeout stopping the engine;
  - `GpuBusyForAnotherAccountError` becoming an `Error:` string;
  - omitted steps and guidance resolving per model;
  - keep-warm counted once per call;
- for video, `model=None` never switching or loading, the busy 409
mapping, and a timeout leaving the job running;
  - hosted vs local routing and the pill count;
  - the frontend and backend sets staying in step.
- The new and touched backend tests, plus #14078's image-defaults and
`/v1/videos` controls tests on the merged tree: 106 passed. Frontend:
`typecheck` clean, the targeted node tests pass (30), and an earlier
full `npm test` run had 12,539 passing. The 2 failures there were load
timeouts that pass when run alone. `bundle:check` is within the new
budget. ESLint adds nothing new on the changed files.
- End to end on one B200, with a resident Z-Image-Turbo GGUF image model
and then a Wan2.2-TI2V-5B video model, both loaded under the default
Off. The chat model was Qwen3-4B on CPU, served by llama-server and
added as a Custom provider that uses Unsloth Studio tools:
- From the Images pill, the model called `generate_image`. It rendered
at 1024x1024 with 8 steps, Z-Image-Turbo's own default, and the image
showed inline.
- The model called `generate_video` with no model named, nothing
switched or loaded, and a 2 s clip played inline.
- In-process GGUF chat can't stay loaded beside an image or video model
on this base: the GPU arbiter evicts the chat model for diffusion even
with `gpu_layers=0`. Media co-residency comes with the multi-model
loading PR. The in-process path is covered by the tests above.

UI before and after screenshots (both composers, the + menu, and the
image and video cards) follow in a comment.


<!-- ui-evidence:start -->
### UI before / after

With a local GGUF chat model that uses Studio tools
(unsloth/Qwen3-1.7B-GGUF Q4_K_M) and a text-to-image model loaded, the
chat composer now shows an "Images" pill next to Tools; before this PR
it never appeared for local models. BEFORE is the head of #14078 (this
PR's base), AFTER is this PR, two separate installs with the same two
models loaded.

![Chat composer pills before and
after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/14110/pr14110_before_after-154d1b3f81a9.png)
<!-- ui-evidence:end -->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniel Han <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants