Repository navigation
Studio: /v1/images/generations keeps a deployed LoRA on MiniMax-H3-Image and dense builds - #17961
Conversation
…age and on dense builds MiniMax-H3-Image merges its load LoRAs into the DiT but never recorded the load request behind them, so after Deploy to Create the OpenAI route sent an empty selection and the backend refused it (500 Image generation failed). Record the baked specs on that path as the int8 / fp8 bakes do. A dense load (bf16 / nf4 / bnb pipelines: SDXL, Z-Image, FLUX.2 Klein) applies its load LoRAs per generation, so an omitted loras field rendered the base model. Every committed load now records the adapters it was asked for, and an omitted loras field falls back to them after the baked set.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
[skip ci]
…ate no longer drops it), HunyuanImage-2.1 LoRA gated off (#17993) ## Summary A LoRA deployed with "Deploy to Create" on an int8 / fp8 image load was silently dropped by any `/images/generate` call that left `loras` out. That includes direct API calls and every internal caller built from such a request: the chat `generate_image` tool, the queue and XY cells. - The engine reads a missing LoRA selection as "none". On a load that baked its adapters into the quantized weights, "none" sets every baked adapter's weight to 0. - The image then renders without the LoRA, with no error. - `/v1/images/generations` already resolves an omitted list to the load's adapters (#17899, #17961); the native route did not. Three smaller gaps found by the same LoRA matrix are fixed too. ## Change - **`/images/generate`:** an omitted `loras` now means the adapters the model was loaded with (the baked set, or the set a dense load named), at their load weights. A load that named none still renders with none. An empty list `[]` renders without any adapter. - This is a behaviour change for API callers that relied on "omitted = none" after a LoRA load; they now need to send `[]`. - The field description in `models/inference.py` documents the new meaning. - Exception: a dense load that Speed compiled (it reports `supports_lora: false`) resolves an omitted list to none, so turning a LoRA off and letting Speed compile never brings it back as a refused request. The baked set of an int8 / fp8 load still resolves. - Resolving an omitted list pins the load it was read from (also when it resolved to none), so a model swapped in before the generation slot is retried with its own adapters. - **Images page:** sends `[]` instead of omitting the field when no adapter is active, so turning a LoRA off in the UI still turns it off. - **Compare grid (frontend) and server XY grid:** a cell whose LoRA weights are all 0 sends `[]` instead of omitting `loras`, so it stays adapter-free under the new meaning. - **HunyuanImage-2.1:** gated off for LoRA. Its diffusers pipeline has no `load_lora_weights`, so every LoRA generation and every int8 / fp8 LoRA load on it failed with an AttributeError. A new test checks that every diffusers image family either has a LoRA loader or is listed as gated off. ## Results Real GPU, Colab G4, Z-Image int8 through the REST API, compiled, same seed: | request | main | this PR | |---|---|---| | `loras` omitted after a Deploy-to-Create LoRA load | renders without the LoRA (same as `[]`; LoRA vs none LPIPS 0.147) | renders with the LoRA (same as sending it) | | `loras: []` | no LoRA | no LoRA | HunyuanImage-2.1 on main, same G4: the bf16, INT8-attention and fp16 LoRA cells fail to render, and the int8 / fp8 LoRA loads fail at load. With this PR the family no longer offers LoRA. The same G4 matrix checked LoRA application across 18 bf16 families plus GGUF, sd.cpp, nf4, fp16, INT8 attention and baked int8 / fp8 loads. ## Tests - New `tests/test_images_generate_load_loras.py`: omitted `loras` renders with the baked set; a dense load keeps the adapters it named; the chat `generate_image` tool keeps the baked set; `[]` renders with none. 3 fail on main. - `tests/test_diffusion_lora.py`: HunyuanImage-2.1 is gated off, and every diffusers pipeline family has a LoRA loader or is gated off. Both fail on main. - Also in `tests/test_images_generate_load_loras.py`: a compiled dense load that omits `loras` renders without its named set, and a load swapped in before the slot retries with its own set. Both fail without their fix. - The loader test names every family it cannot check on the installed diffusers (FLUX.3 needs 0.42+, MOSS-Image has its own loader, MiniMax-H3-Image merges at load), and any other missing class fails. - `tests/test_diffusion_xy.py`: an all-zero LoRA cell drops the adapter. Fails on main. - `studio/frontend/tests/images-compare-grid.test.ts`: the all-zero cell assertion fails on main; the file passes (47). - Backend LoRA, XY, routes and `/v1` baked LoRA suites: 914 passed. ## Not covered - The HunyuanImage-2.1 refusal was not re-run on GPU after the gate. - Studio UI journeys were not driven in a browser; the UI change only affects the request body (`[]` instead of a missing field).
Summary
Follow-up to #17899. After Train > Deploy to Create, two loads still rendered through
/v1/images/generationswithout the deployed LoRA (found running train, deploy and render for 13 families on Colab A100 / G4):lorasfield rendered the base model. On SDXL and Z-Image the render without the field was the base image.Change
load_lora_specsin the status).lorason/v1/images/generationsnow means the adapters the load named: the baked set when there is one, else the load's requested set.[]still renders without any; an explicit list is used as given. The field description is updated./images/generate(Studio's own route, which always sends its selection) is unchanged. The native sd.cpp and MLX engines do not record load adapters, so an omitted field there still renders without them, as before.Two cases now get a clear 400 instead of a silent plain-model image: a deployed LoRA on a dense load that Speed has since compiled ("Speed compiled this model, so LoRAs are off ..."), and a deployed adapter whose file was deleted after the load ("Unknown LoRA").
Tests
tests/test_openai_images_baked_loras.py: 4 new tests (an omitted field keeps a dense deploy's adapters, the status reports the load request, every bake including MiniMax-H3-Image records the specs/v1reads back, dense loads record their requested adapters). They fail on main and pass here; the 9 existing tests pass.GPU runs (Studio from main + this change, REST API)
/v1withoutloras