Repository navigation
Studio: download the UD-Q4_K_XL FLUX.3 prompt upsampler by default - #14177
Merged
Merged
Conversation
Member
Author
|
@codex review |
Codex Review SummaryThis 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. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 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". |
This was referenced Oct 23, 2026
danielhanchen
added a commit
that referenced
this pull request
Oct 23, 2026
…is missing (#14842) ## Problem #14177 changed the FLUX.3 prompt upsampler default quant to `UD-Q4_K_XL`. `_cached_pair()`, `_cached_download_paths()` and `model_path()` only looked up `UPSAMPLER_MODEL_FILE`, the new default. An install that had already downloaded the previous default `flux-3-image-klein-pup-Q4_K_M.gguf` (or the `Q8_0` file) therefore reported the upsampler as not downloaded, and Enhance prompt stopped working until the new ~6 GB file was fetched. The cached older quant was never used. ## Fix - New `UPSAMPLER_MODEL_FILE_PREFERENCE`: the default `UD-Q4_K_XL` first, then `Q8_0` (higher quality), then `Q4_K_M`. - `_cached_pair()` walks that order and, for each file, the candidate revisions (recorded one first). It still pairs a model with the projector at the same revision, and still falls back to a model with no projector only when no revision holds both. A complete pair of a fallback quant wins over the default with no projector, as it did before across revisions. - `model_path()`, `mmproj_path()`, `status()` and the unpinned `_cached_download_paths()` all go through `_cached_pair()`, so the status route (`downloaded` / `mmproj_downloaded`), the frontend download prompt and the Enhance gates in the generate route agree: a user with the old file sees Enhance as ready. - `status()` now reports the filename and on-disk size of the file in use, not the default name beside an older file. - Unchanged: the download spec still fetches `UD-Q4_K_XL` + `mmproj-F16.gguf`, so a fresh install gets the new default. The completion check for a pinned download still requires the default at that revision. The `UNSLOTH_FLUX3_UPSAMPLER_GGUF` / `_MMPROJ` overrides behave as before, including a missing override path never falling back to the cache. ## Tests New tests in `studio/backend/tests/test_flux3_prompt_upsampler.py` build a real Hugging Face cache layout under `tmp_path` (no downloads): - only `Q4_K_M` + projector cached: `model_path()` returns `Q4_K_M` and `status()` reports ready - default and fallbacks cached: the default wins - `Q8_0` is preferred over `Q4_K_M` - a fallback quant pairs with the projector at its own revision - a pinned download's completion check still wants the default - nothing cached: not ready, and the download targets `UD-Q4_K_XL` - the env override still beats a cached quant | | main | this branch | |---|---|---| | `tests/test_flux3_prompt_upsampler.py` | 3 failed, 205 passed | 208 passed | The three failures on main are the `Q4_K_M` only, `Q8_0` preference and fallback pairing tests. `test_diffusion_flux3.py`, `test_orchestrator_unload_cancel.py` and `test_gpu_selection.py` also pass. ## Not covered - A user with only an older quant and no projector still downloads the default plus the projector when they ask for the projector, and the frontend size estimate for that case counts only the projector. - No change to the frontend; no live Studio run with a real cached quant.
danielhanchen
added a commit
to Imagineer99/unsloth
that referenced
this pull request
Oct 25, 2026
…mpler quant (unslothai#14836) ## Summary unslothai#14177 made `flux-3-image-klein-pup-UD-Q4_K_XL.gguf` the default prompt upsampler file. unslothai#14842 (merged) lets an install that still holds the earlier default, `flux-3-image-klein-pup-Q4_K_M.gguf`, keep enhancing from it. But that install then reads as fully downloaded, so the Images panel never offers the new default, which scores about 39% lower mean KL divergence for 6% more bytes. This change, on top of unslothai#14842: - `status()` reports `current_filename`, `current_downloaded` (the default pair at one revision) and `current_missing_bytes` (only blobs not already cached at any revision), apart from `downloaded` / `mmproj_downloaded`, which still mean "can run". - The Enhance prompt panel keeps the Download control offered while an earlier quant serves, says which file is in use, and sizes the button at what the download actually fetches. A model-only earlier quant is sized at the default model plus projector, not the projector alone. - A complete `Q8_0` pair is not offered the smaller default: Q8_0 is closer to BF16, so "for better captions" would be wrong there. - An older backend without the new fields reads as before (`current_downloaded` falls back to `downloaded && mmproj_downloaded`). - Unchanged: what a run reads (`model_path()` / `mmproj_path()`), the download spec (UD-Q4_K_XL + `mmproj-F16.gguf`), the env overrides, and a fresh install. ## Testing - `studio/backend/tests/test_flux3_prompt_upsampler.py`: 223 passed. Base vs head differential: 5 tests fixed, 217 unchanged, 0 failing on head. New tests cover: an install with only Q4_K_M keeps enhancing offline and is still offered the default; the default wins once downloaded; a complete earlier pair beats a default model with no projector; a model-only earlier quant is priced at the whole default download; a Q8_0 pair is not offered the download (fails without the guard). - `studio/frontend/tests/image-prompt-enhance.test.ts`: 12 passed. - `status()` on an install serving Q4_K_M: about 2.0 ms per call vs 1.5 ms on main (the status route, not the generation path). ## Screenshots Two isolated Studio installs (merge base vs this branch), both on one HF cache holding only the Q4_K_M upsampler and projector. The upsampler status comes from each backend; the image model status is set to a loaded FLUX.3 klein model in the browser so the panel renders without image weights.  Before: the Q4_K_M install shows no download, so it never gets the better default. After: the panel names the earlier quant in use and offers Download (6.0 GB). --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhance prompt (the FLUX.3 prompt upsampler) now downloads
flux-3-image-klein-pup-UD-Q4_K_XL.ggufby default instead offlux-3-image-klein-pup-Q4_K_M.gguf, both fromunsloth/flux-3-image-klein-pup-GGUF. The repo's Q4_K_M and Q6_K were also rebuilt with an importance matrix, so the expected Q4_K_M size is updated too.That measurement uses 96 held-out requests with the t2i system prompt, scored on assistant tokens only. UD-Q4_K_XL is also better on wikitext-2 and on held-out code, Chinese, math and general chat. With greedy decoding its captions first diverge from BF16 at a median of word 49, against word 20 for both Q4_K_M files.
Speed (llama-bench, median t/s):
Existing installs that already have the Q4_K_M file will see the download notice once for the new default; until it is downloaded, Enhance prompt falls back to the prompt as typed, as it does for any missing upsampler.
Testing
tests/test_flux3_prompt_upsampler.py,tests/test_training_vram_coexistence.py,tests/test_gpu_arbiter.py: 220 passed.