Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
a60f5555
Unverified
Commit
a60f5555
authored
Feb 16, 2023
by
Pedro Cuenca
Committed by
GitHub
Feb 16, 2023
Browse files
Make diffusers importable with transformers < 4.26 (#2380)
parent
90a624f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/diffusers/pipelines/stable_diffusion/__init__.py
src/diffusers/pipelines/stable_diffusion/__init__.py
+4
-1
No files found.
src/diffusers/pipelines/stable_diffusion/__init__.py
View file @
a60f5555
...
...
@@ -64,7 +64,10 @@ try:
if
not
(
is_transformers_available
()
and
is_torch_available
()
and
is_transformers_version
(
">="
,
"4.26.0"
)):
raise
OptionalDependencyNotAvailable
()
except
OptionalDependencyNotAvailable
:
from
...utils.dummy_torch_and_transformers_objects
import
StableDiffusionDepth2ImgPipeline
from
...utils.dummy_torch_and_transformers_objects
import
(
StableDiffusionDepth2ImgPipeline
,
StableDiffusionPix2PixZeroPipeline
,
)
else
:
from
.pipeline_stable_diffusion_depth2img
import
StableDiffusionDepth2ImgPipeline
from
.pipeline_stable_diffusion_pix2pix_zero
import
StableDiffusionPix2PixZeroPipeline
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment