Fix macOS install: transformers 4.35.2 incompatible with diffusers 0.33.1#1
Open
MerrittLegacy wants to merge 1 commit into
Open
Conversation
… 0.33.1
The pinned transformers==4.35.2 breaks `import diffusers` on a fresh macOS
install: diffusers 0.33.1's IP-Adapter loader imports `SiglipImageProcessor`,
which only exists in transformers >= 4.45. Result:
cannot import name 'SiglipImageProcessor' from 'transformers'
Bump to transformers==4.49.0, verified end-to-end on Apple Silicon (MPS):
sd-turbo loads, the FastAPI server starts, and realtime img2img runs.
Also add demo/realtime-img2img/start_mac.sh, a launcher that (unlike
run_mac.sh) does not edit main.py in place and supports fully-offline model
loading via HF_HUB_OFFLINE=1.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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
On a fresh macOS install following
demo/realtime-img2img/requirements.txt, importing diffusers fails immediately:The pinned
transformers==4.35.2is too old fordiffusers==0.33.1: diffusers' IP-Adapter loader (diffusers/loaders/ip_adapter.py) importsSiglipImageProcessor, which was only added to transformers in 4.45.0. So the demo can't even start on a clean environment.Fix
Bump
transformersto 4.49.0 (lowest tested version withSiglipImageProcessorthat resolves cleanly with the rest of the pinned stack — it pullstokenizers>=0.21).Verified end-to-end on Apple Silicon (M-series, MPS), Python 3.10:
import diffusers/StableDiffusionPipelineimport OKpython main.py --taesd --acceleration none --debugstartsstabilityai/sd-turboloads on MPS,Uvicorn running on http://0.0.0.0:7860/api/settingsresponds — realtime img2img worksAlso included
demo/realtime-img2img/start_mac.sh— a small launcher that, unlikerun_mac.sh, does not editmain.pyin place (thesed -ithere mutates a tracked file on every run) and supports fully-offline model loading viaHF_HUB_OFFLINE=1. Happy to drop this if you'd prefer to keep the PR to the one-line requirements fix.🤖 Generated with Claude Code