Skip to content

Studio images: return the remaining LoRA selection refusals as 400 on /v1 - #17909

Merged
danielhanchen merged 1 commit into
mainfrom
studio-h3-image-lora-400
Nov 16, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
studio-h3-image-lora-400

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

#17899 made /v1/images/generations answer a LoRA selection the loaded model cannot take with a 400 (param: loras) instead of a sanitized 500, by typing those refusals as LoraSelectionError (a ValueError subclass, so /images/generate is unchanged). A few generation-time refusals still raised a plain ValueError and so still reached API callers as "Image generation failed." with a 500. This types them too:

  • MiniMax-H3-Image: the LoRA set and weights are fixed for a load (_check_h3_image_loras).
  • A weight change on adapters merged into weights that are now offloaded (_remerge_quant_loras).
  • A GGUF LoRA file on the diffusers engine (_resolve_lora_set).
  • LoRAs blocked on this load (compiled model, unsupported quant or family) (_apply_loras).
  • The native sd.cpp engine refusing LoRAs for a family.

Internal failures that wrap another exception ("Failed to apply LoRA: ...", "Could not apply the new LoRA weights ...") stay plain ValueError, so /v1 keeps returning a sanitized 500 for them. Load-time refusals are untouched (they go through the load route).

Tests

  • New tests/test_lora_selection_refusals_typed.py: parses each refusing function and fails if a LoRA selection refusal still raises a plain ValueError (5 of 8 cases fail before, all pass after), and checks the class stays a ValueError.
  • The OpenAI image route tests (including the baked-LoRA tests from Studio: keep a load's baked LoRAs on /v1/images/generations #17899) pass; the diffusion LoRA, quant-merge and remerge suites pass with no failures on either side.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T05:23:50.234892Z a016cc8 Manual request
ℹ️ 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: a016cc8a8d

ℹ️ 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
danielhanchen merged commit 0e1fbd6 into main Nov 16, 2026
@danielhanchen
danielhanchen deleted the studio-h3-image-lora-400 branch November 16, 2026 06:08
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