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
577a6a65
Commit
577a6a65
authored
Aug 22, 2022
by
anton-l
Browse files
Fix SD tests .to(device)
parent
21ceda3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
tests/test_modeling_utils.py
tests/test_modeling_utils.py
+4
-4
No files found.
tests/test_modeling_utils.py
View file @
577a6a65
...
...
@@ -866,7 +866,7 @@ class PipelineTesterMixin(unittest.TestCase):
@
unittest
.
skipIf
(
torch_device
==
"cpu"
,
"Stable diffusion is supposed to run on GPU"
)
def
test_stable_diffusion
(
self
):
# make sure here that pndm scheduler skips prk
sd_pipe
=
StableDiffusionPipeline
.
from_pretrained
(
"CompVis/stable-diffusion-v1-1
-diffusers"
)
sd_pipe
=
StableDiffusionPipeline
.
from_pretrained
(
"CompVis/stable-diffusion-v1-1
"
).
to
(
torch_device
)
prompt
=
"A painting of a squirrel eating a burger"
generator
=
torch
.
Generator
(
device
=
torch_device
).
manual_seed
(
0
)
...
...
@@ -886,7 +886,7 @@ class PipelineTesterMixin(unittest.TestCase):
@
slow
@
unittest
.
skipIf
(
torch_device
==
"cpu"
,
"Stable diffusion is supposed to run on GPU"
)
def
test_stable_diffusion_fast_ddim
(
self
):
sd_pipe
=
StableDiffusionPipeline
.
from_pretrained
(
"CompVis/stable-diffusion-v1-1
-diffusers"
)
sd_pipe
=
StableDiffusionPipeline
.
from_pretrained
(
"CompVis/stable-diffusion-v1-1
"
).
to
(
torch_device
)
scheduler
=
DDIMScheduler
(
beta_start
=
0.00085
,
...
...
@@ -1003,8 +1003,8 @@ class PipelineTesterMixin(unittest.TestCase):
@
slow
@
unittest
.
skipIf
(
torch_device
==
"cpu"
,
"Stable diffusion is supposed to run on GPU"
)
def
test_lms_stable_diffusion_pipeline
(
self
):
model_id
=
"CompVis/stable-diffusion-v1-1
-diffusers
"
pipe
=
StableDiffusionPipeline
.
from_pretrained
(
model_id
,
use_auth_token
=
True
)
model_id
=
"CompVis/stable-diffusion-v1-1"
pipe
=
StableDiffusionPipeline
.
from_pretrained
(
model_id
,
use_auth_token
=
True
)
.
to
(
torch_device
)
scheduler
=
LMSDiscreteScheduler
.
from_config
(
model_id
,
subfolder
=
"scheduler"
,
use_auth_token
=
True
)
pipe
.
scheduler
=
scheduler
...
...
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