Repository navigation
Studio: install the pinned Diffusers commit from a zip when there is no git - #11565
Conversation
…no git Qwen-Image-2.1 refuses to load with "needs diffusers >= 0.41.0 ... this environment has diffusers 0.40.0" on installs that did nothing wrong. The pinned main build is a git+https requirement, and install_python_stack skips that step non-fatally when _has_working_git() is false. The desktop bundle ships no git, and on macOS `git` is frequently a bare xcrun shim that exits non-zero, so the skip fires for a large share of desktop installs and the only visible sign is one note during a long dependency pass. Reproduced end to end with the shipped bundles, git shimmed to exit 1: installing 0.1.811 leaves diffusers 0.40.0, and updating to 0.1.812 leaves it at 0.40.0 as well, so reinstalling the app does not repair it. With a working git both land on 0.41.0.dev0 at the pinned commit. Nothing in that step actually needs git: the same commit is a zip over plain https. _github_archive_url derives it from the requirement, so there is still one commit written down in one place, and the git clone stays the default because it records a ref. The derivation is deliberately narrow (github.com, full 40 character commit, no subdirectory) because an archive records no ref of its own, so only a SHA in the URL identifies the tree afterwards. _direct_reference_is_installed has to read that back or the fallback works exactly once. Measured: the archive install reads as absent to a vcs_info-only check, _diffusers_main_supersedes_release then says the release pin was not superseded, and the next pass reinstalls 0.40.0 straight over it. The refusal message also pointed at `pip install -r diffusers-main.txt`, which resolves the same git URL and fails identically for the most likely cause. It now names git as the thing to check and quotes the zip, read out of the pin file so it cannot drift from the commit that is installed. Verified on a real git-less install: the dependency pass logs "diffusers main (no git, from archive)", diffusers ends at 0.41.0.dev0 with direct_url.json recording the pinned commit's archive, _diffusers_main_resident() is True against it, and a second forced pass leaves it in place.
|
You have reached your Codex usage limits for security reviews. Please try again later. |
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 |
|
Alternative solution: #11566 |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
…no git (unslothai#11565) Qwen-Image-2.1 refuses to load with "needs diffusers >= 0.41.0 ... this environment has diffusers 0.40.0" on installs that did nothing wrong. The pinned main build is a git+https requirement, and install_python_stack skips that step non-fatally when _has_working_git() is false. The desktop bundle ships no git, and on macOS `git` is frequently a bare xcrun shim that exits non-zero, so the skip fires for a large share of desktop installs and the only visible sign is one note during a long dependency pass. Reproduced end to end with the shipped bundles, git shimmed to exit 1: installing 0.1.811 leaves diffusers 0.40.0, and updating to 0.1.812 leaves it at 0.40.0 as well, so reinstalling the app does not repair it. With a working git both land on 0.41.0.dev0 at the pinned commit. Nothing in that step actually needs git: the same commit is a zip over plain https. _github_archive_url derives it from the requirement, so there is still one commit written down in one place, and the git clone stays the default because it records a ref. The derivation is deliberately narrow (github.com, full 40 character commit, no subdirectory) because an archive records no ref of its own, so only a SHA in the URL identifies the tree afterwards. _direct_reference_is_installed has to read that back or the fallback works exactly once. Measured: the archive install reads as absent to a vcs_info-only check, _diffusers_main_supersedes_release then says the release pin was not superseded, and the next pass reinstalls 0.40.0 straight over it. The refusal message also pointed at `pip install -r diffusers-main.txt`, which resolves the same git URL and fails identically for the most likely cause. It now names git as the thing to check and quotes the zip, read out of the pin file so it cannot drift from the commit that is installed. Verified on a real git-less install: the dependency pass logs "diffusers main (no git, from archive)", diffusers ends at 0.41.0.dev0 with direct_url.json recording the pinned commit's archive, _diffusers_main_resident() is True against it, and a second forced pass leaves it in place.
Users on fresh, correct installs get this when they load Qwen-Image-2.1:
Cause
The pinned main build is a
git+httpsrequirement, andinstall_python_stack._diffusers_main_stepskips it non-fatally when_has_working_git()is false. That skip is correct as a safety valve and wrong as an outcome for most desktop users: the desktop bundle ships no git, and on macOSgitis frequently a bare xcrun shim that exits non-zero, which_has_working_gitcounts as missing by design. The install succeeds, prints one note in the middle of a long dependency pass, and the user finds out weeks later when a model refuses to load.Reproduced with the shipped Linux bundles,
gitshimmed to exit 1:0.41.0.dev0at the pinned commit0.41.0.dev0, unchanged0.40.00.40.0, unchangedSo reinstalling or updating the app does not repair it, which is the first thing anyone tries.
Change
Nothing in that step needs git. The same commit is a zip over plain https, so a host with no working git now installs
https://github.com/huggingface/diffusers/archive/<commit>.zipinstead of skipping._github_archive_urlderives that URL from the requirement, so there is still one commit written down in one place. The git clone stays the default, because a clone records a ref and an archive does not.#subdirectory=. An archive records no ref of its own, so only a SHA in the URL identifies the tree afterwards. Anything else keeps the old skip, which is still the right answer when neither route can pin the build._direct_reference_is_installednow readsarchive_infoback. Without that half the fallback works exactly once: the archive install reads as absent to avcs_info-only check,_diffusers_main_supersedes_releasethen reports the release pin as not superseded, and the very next pass reinstalls 0.40.0 straight over it. That is measured, not theorised, and it is also why the manualpip install ...zipworkaround people have been passing around does not survive an update.pip install -r studio/backend/requirements/diffusers-main.txt, which resolves the same git URL and so fails identically for the most likely cause. It now names git as the thing to check and quotes the zip, read out of the pin file so the commit in the message cannot drift from the commit that gets installed.Behaviour on a host with working git is unchanged: same requirement, same clone, same recorded ref.
Verification
On a real git-less install produced by the 0.1.812 bundle, with the shimmed git still in place:
A second forced dependency pass leaves it at
0.41.0.dev0rather than putting 0.40.0 back, which is the regression the residency half exists to prevent.The new refusal text, rendered:
Tests
tests/studio/install/test_diffusers_pin.py: 24 passed. The no-git test asserted the skip and now asserts the zip install, with the old skip kept as its own test reached through a pin the zip route cannot serve. Two new ones cover reading an archive install back as resident (including that a zip of a different commit is not this one) and the cases the derivation must refuse.studio/backend/tests/test_diffusion_more_families.py: the refusal test now checks the message names the commit the pin file actually carries, so the quoted command cannot go stale. The two failures in that module on this branch (test_create_causal_mask_patch_is_self_disabling_and_idempotent,test_qwen_image_21_gguf_reaches_sd_cpp_with_its_own_vae_and_a_qwen3vl_encoder) are already red on main and unrelated.Not in scope
The dependency pass is skipped entirely when the manifest says dependencies are up to date, so an install that took the old skip will not retry on its own until something else moves. Tracking the pin file in the manifest is a separate change.