Skip to content

Studio: install the pinned Diffusers commit from a zip when there is no git - #11565

Merged
danielhanchen merged 1 commit into
mainfrom
studio-diffusers-main-nogit
Sep 22, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
studio-diffusers-main-nogit

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Users on fresh, correct installs get this when they load Qwen-Image-2.1:

'qwen-image-2.1' needs diffusers >= 0.41.0 (QwenImage21Pipeline), which has not been released yet;
this environment has diffusers 0.40.0.

Cause

The pinned main build is a git+https requirement, and install_python_stack._diffusers_main_step skips 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 macOS git is frequently a bare xcrun shim that exits non-zero, which _has_working_git counts 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, git shimmed to exit 1:

arm after installing 0.1.811 after updating to 0.1.812
git works 0.41.0.dev0 at the pinned commit 0.41.0.dev0, unchanged
git exits non-zero 0.40.0 0.40.0, unchanged

So 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>.zip instead of skipping.

  • _github_archive_url derives 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.
  • The derivation is deliberately narrow: github.com over http(s), a full 40 character commit, no #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_installed now reads archive_info back. Without that half the fallback works exactly once: the archive install reads as absent to a vcs_info-only check, _diffusers_main_supersedes_release then 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 manual pip install ...zip workaround people have been passing around does not survive an update.
  • The refusal message pointed at 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:

deps  [================----] 15/18  diffusers main (no git, from archive)
diffusers 0.41.0.dev0
direct_url: {"url": "https://github.com/huggingface/diffusers/archive/80c7ed262aeffbeb43ef13ae04baeb9b84515a69.zip",
             "archive_info": {}}
_diffusers_main_resident()        -> True
_diffusers_main_supersedes_release() -> True

A second forced dependency pass leaves it at 0.41.0.dev0 rather than putting 0.40.0 back, which is the regression the residency half exists to prevent.

The new refusal text, rendered:

'qwen-image-2.1' needs diffusers >= 0.41.0 (QwenImage21Pipeline), which has not been released yet;
this environment has diffusers 0.40.0. Unsloth installs a pinned build of diffusers main for this
and that build is not here, which almost always means the install had no working git
(run: git --version) or could not reach github.com. Re-run the Unsloth installer (leaving
UNSLOTH_DIFFUSERS_MAIN unset), which installs it from a zip archive when git is missing. To install
it by hand with no git at all: pip install "diffusers @ https://github.com/huggingface/diffusers/archive/80c7ed262aeffbeb43ef13ae04baeb9b84515a69.zip"

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.

…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.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T17:29:36.225686Z 6bb7415 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

@oobabooga

Copy link
Copy Markdown
Member

Alternative solution: #11566

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 6bb7415428

ℹ️ 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 f394701 into main Sep 22, 2026
11 of 74 checks passed
@danielhanchen
danielhanchen deleted the studio-diffusers-main-nogit branch September 22, 2026 17:32
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…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.
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.

2 participants