Skip to content

Commit 008c22d

Browse files
Improve transformers versions handling (huggingface#2104)
1 parent b562b66 commit 008c22d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/diffusers/pipelines/stable_diffusion/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class StableDiffusionPipelineOutput(BaseOutput):
5757

5858

5959
try:
60-
if not (is_transformers_available() and is_torch_available() and is_transformers_version(">=", "4.26.0.dev0")):
60+
if not (is_transformers_available() and is_torch_available() and is_transformers_version(">=", "4.26.0")):
6161
raise OptionalDependencyNotAvailable()
6262
except OptionalDependencyNotAvailable:
6363
from ...utils.dummy_torch_and_transformers_objects import StableDiffusionDepth2ImgPipeline

src/diffusers/utils/import_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ def requires_backends(obj, backends):
392392

393393
if name in [
394394
"StableDiffusionDepth2ImgPipeline",
395-
] and is_transformers_version("<", "4.26.0.dev0"):
395+
] and is_transformers_version("<", "4.26.0"):
396396
raise ImportError(
397-
f"You need to install `transformers` from 'main' in order to use {name}: \n```\n pip install"
398-
" git+https://github.com/huggingface/transformers \n```"
397+
f"You need to install `transformers>=4.26` in order to use {name}: \n```\n pip install"
398+
" --upgrade transformers \n```"
399399
)
400400

401401

0 commit comments

Comments
 (0)