Skip to content

Unsloth Studio: raise the huggingface_hub floor to what the pinned Diffusers main build needs - #11625

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
LeoBorcherding:raise-hub-floor-for-pinned-diffusers
Sep 23, 2026
Merged

danielhanchen merged 3 commits into
unslothai:mainfrom
LeoBorcherding:raise-hub-floor-for-pinned-diffusers

Conversation

@LeoBorcherding

@LeoBorcherding LeoBorcherding commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

On an environment whose huggingface_hub resolved below 1.31, plain import diffusers fails:

ImportError: cannot import name 'httpx' from 'huggingface_hub.utils'

So it is not one model. Every image and video model on the diffusers engine is unreachable. Reported against Unsloth Studio v0.1.814-beta, loading Qwen-Image-2.1-GGUF Q4_K_M.

Cause

diffusers reads httpx out of huggingface_hub.utils in utils/hub_utils.py and pipelines/pipeline_utils.py. Hub only grew that name at 1.31, as a forwarding shim in utils/__init__.py that re-exports the real httpx module. utils/hub_utils.py is reached by diffusers/__init__.py, which is why the whole package goes down rather than one pipeline.

The pinned main build declares the floor correctly. Unsloth did not:

declares window
diffusers @ 80c7ed26 (diffusers-main.txt) huggingface-hub>=1.31.0,<2.0
Unsloth, py>=3.10 huggingface-hub>=1.23.0,<2.0

1.23.0 is the floor the diffusers release wanted, set for MiniMax-H3 and recorded as such in overrides-darwin-arm64.txt. #11405 then pinned a main commit with a higher floor and left this one where it was. A fresh resolve picks the newest hub and is fine, which is why this did not show up in testing; an environment carrying an older hub forward satisfies Unsloth, fails diffusers, and nothing in the install says so.

Change

The py>=3.10 floor moves to 1.31.0 in the five places that declare it, and the comment in overrides-darwin-arm64.txt says where the new number comes from. The quoted uv error in that comment keeps its original 1.23.0, because it is a transcript of an error that was actually seen.

The py<3.10 lines are untouched. That interpreter cannot run the main build at all: _diffusers_main_step returns early below 3.10.

Nothing caps hub below 1.31 on py>=3.10. Every installed distribution in a working Studio env was checked, and the sub-1.31 entries are all floors with no ceiling: transformers >=1.5.0, datasets >=0.25.0, tokenizers >=0.16.4,<2.0, data-designer <2,>=0.34.0, peft >=0.25.0, accelerate >=0.21.0.

This also repairs an installation that is already in the gap. _skip_step asks whether the installed packages satisfy the file rather than whether the file changed, so a floor of 1.31.0 makes that step unsatisfied on the next update and hub is pulled up.

Verification

Scratch venv on Windows 11, diffusers installed from the pinned commit's zip with --no-deps so hub stays where it was put:

huggingface_hub import diffusers
1.30.0 ImportError: cannot import name 'httpx' from 'huggingface_hub.utils'
1.31.0 past it, then ModuleNotFoundError: torch, which is the empty venv and not the shim

The 1.30.0 row is the reporter's message verbatim. diffusers.utils, diffusers.utils.hub_utils and diffusers.pipelines.pipeline_utils each fail the same way at 1.30.0.

pytest tests/studio/install/test_diffusers_pin.py tests/studio/install/test_base_requirements_reach_install.py passes, 62 tests, at 21066587c9.

The wider tests/studio/install/ run is red on this machine, but not from this diff: test_uv_boolish_parity.py alone fails 380 of 544 on stock d6806d3613 with nothing applied. I have not attributed the rest of that suite's failures either way.

Not run: a full Studio install resolving from the changed files. The change is five requirement lines, and the floor it moves to is the one diffusers itself declares.

Cross-platform check (staging CI)

Each job installs huggingface_hub==1.30.0 first, then studio.txt, then the pinned Diffusers build (with overrides-darwin-arm64.txt applied through UV_OVERRIDE on Apple Silicon, as the installer does), then imports huggingface_hub, diffusers and QwenImage21Pipeline. Base reads the requirement files from main, head from this PR.

OS base (main) head (this PR)
macos-15 (arm64), py3.10 and 3.13 hub stays 1.30.0, ImportError: cannot import name 'httpx' from 'huggingface_hub.utils' hub 1.32.0, hub 1.32.0 diffusers 0.41.0.dev0 import OK
ubuntu-latest, py3.10 and 3.13 hub 1.32.0, import OK hub 1.32.0, import OK
windows-latest, py3.10 and 3.13 hub 1.32.0, import OK hub 1.32.0, import OK

So the gap is reachable on a fresh resolve on Apple Silicon, where the override file held the old floor, and this PR closes it. Linux and Windows are unchanged. 12 jobs, 2 red, both base on macos-15.

…ffusers main build needs

diffusers reads httpx out of huggingface_hub.utils, a forwarding shim that only
exists from hub 1.31, and it does so in utils/hub_utils.py, so plain `import
diffusers` fails on an older hub and every model on the diffusers engine is
unreachable, not just Qwen-Image-2.1.

The pinned main build declares huggingface-hub>=1.31.0,<2.0. Unsloth declared
>=1.23.0, which was the floor the diffusers RELEASE wanted; unslothai#11405 pinned a main
commit with a higher floor and left this one behind. Anything resolved into the
gap satisfies Unsloth, breaks diffusers, and nothing in the install says so.
base.txt has never declared huggingface_hub. The fifth place that moved to the 1.x window is the studio extra in pyproject.toml.
@unslothai unslothai deleted a comment from shimmyshimmer Sep 23, 2026
@danielhanchen

danielhanchen commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Review record for #11625, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#66.

Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found.

Round 1: reviewed mirror 5c778ec18 (no equivalent commit found on this PR)

chatgpt-codex-connector[bot] (on the mirror)

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 5c778ec184

No triage reaction was recorded on the mirror

Round 2: reviewed mirror 8729ad8846 (this PR's 55c69d432)

chatgpt-codex-connector[bot] (on the mirror)

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 8729ad8846

No triage reaction was recorded on the mirror

Verdict

The round converged at mirror 8729ad8846 (this PR's 55c69d432).

This is the review as it stood at that commit. Anything pushed to this PR afterwards was not part of it.

@unslothai unslothai deleted a comment from shimmyshimmer Sep 23, 2026
@danielhanchen
danielhanchen merged commit 78fbee7 into unslothai:main Sep 23, 2026
60 of 61 checks passed
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…ffusers main build needs (unslothai#11625)

* Unsloth Studio: raise the huggingface_hub floor to what the pinned Diffusers main build needs

diffusers reads httpx out of huggingface_hub.utils, a forwarding shim that only
exists from hub 1.31, and it does so in utils/hub_utils.py, so plain `import
diffusers` fails on an older hub and every model on the diffusers engine is
unreachable, not just Qwen-Image-2.1.

The pinned main build declares huggingface-hub>=1.31.0,<2.0. Unsloth declared
>=1.23.0, which was the floor the diffusers RELEASE wanted; unslothai#11405 pinned a main
commit with a higher floor and left this one behind. Anything resolved into the
gap satisfies Unsloth, breaks diffusers, and nothing in the install says so.

* Correct the list of files that carry the hub floor

base.txt has never declared huggingface_hub. The fifth place that moved to the 1.x window is the studio extra in pyproject.toml.

* Shorten the hub floor comment in the macOS arm64 overrides

---------

Co-authored-by: Daniel Han <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants