Repository navigation
Studio: use a cached earlier FLUX.3 upsampler quant when the default is missing - #14842
Merged
danielhanchen merged 2 commits intoOct 23, 2026
Merged
Conversation
…is missing The default prompt upsampler quant moved to UD-Q4_K_XL, but the cache lookup only checked that file, so installs that already downloaded the previous Q4_K_M (or Q8_0) default lost Enhance prompt until the new file was fetched. Look up the default first, then Q8_0, then Q4_K_M, each paired with the projector at its own revision. Status reports the file in use. Fresh installs still download UD-Q4_K_XL and the env overrides are unchanged.
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. |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
danielhanchen
added a commit
that referenced
this pull request
Oct 23, 2026
… in #14822 (#14852) pre-commit.ci fails `ruff-format-with-kwargs` again on PRs queued after 00:36 UTC (#14834, #14835, #14836, #14842, #14845): `studio/backend/tests/test_video_stream_encode.py` was merged in #14822 without the formatter, so every PR's all-files run rewrites it. Same class as #14817. `python scripts/run_ruff_format.py` (the hook's entry point, `ruff==0.6.9`) applied to that one file. The AST is identical before and after, `ruff check` passes, and a full run of the hook over every tracked Python file on this branch changes nothing else.
danielhanchen
deleted the
studio-flux3-upsampler-cached-quant-fallback
branch
October 23, 2026 03:58
danielhanchen
added a commit
that referenced
this pull request
Oct 23, 2026
main landed #14842, which also runs from a cached earlier upsampler quant (UPSAMPLER_MODEL_FILE_PREFERENCE: UD-Q4_K_XL, then Q8_0, then Q4_K_M) and lets the unpinned _cached_download_paths count any cached quant. Conflicts in studio/backend/core/inference/flux3_prompt_upsampler.py: - Run order: took main's UPSAMPLER_CACHED_FALLBACK_QUANTS / UPSAMPLER_MODEL_FILE_PREFERENCE (Q8_0 before Q4_K_M) and dropped this branch's UPSAMPLER_RUN_FILES (dict order, Q4_K_M before Q8_0). - _cached_pair: kept this branch's model_files parameter, now defaulting to UPSAMPLER_MODEL_FILE_PREFERENCE, so model_path / mmproj_path / unpinned _cached_download_paths behave as on main. - status(): kept main's size_bytes fallback chain and this branch's current_filename / current_downloaded / current_missing_bytes. Since main's unpinned _cached_download_paths is now satisfied by an earlier quant, current_downloaded reads _cached_pair(model_files=(default,)) instead, so the Download control stays offered while an earlier quant serves. Conflicts in studio/backend/tests/test_flux3_prompt_upsampler.py: kept both test sets. This branch's "only Q4_K_M cached" test now asserts current_downloaded is False and a pinned check at that revision is None, instead of an unpinned _cached_download_paths None (main asserts it returns the earlier pair). Main's matching test also asserts current_downloaded is False, replacing its "UI offers no download" comment. [skip ci]
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.
Problem
#14177 changed the FLUX.3 prompt upsampler default quant to
UD-Q4_K_XL._cached_pair(),_cached_download_paths()andmodel_path()only looked upUPSAMPLER_MODEL_FILE, the new default. An install that had already downloaded the previous defaultflux-3-image-klein-pup-Q4_K_M.gguf(or theQ8_0file) 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
UPSAMPLER_MODEL_FILE_PREFERENCE: the defaultUD-Q4_K_XLfirst, thenQ8_0(higher quality), thenQ4_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.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. TheUNSLOTH_FLUX3_UPSAMPLER_GGUF/_MMPROJoverrides 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.pybuild a real Hugging Face cache layout undertmp_path(no downloads):Q4_K_M+ projector cached:model_path()returnsQ4_K_Mandstatus()reports readyQ8_0is preferred overQ4_K_MUD-Q4_K_XLtests/test_flux3_prompt_upsampler.pyThe three failures on main are the
Q4_K_Monly,Q8_0preference and fallback pairing tests.test_diffusion_flux3.py,test_orchestrator_unload_cancel.pyandtest_gpu_selection.pyalso pass.Not covered