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
5308cce9
Unverified
Commit
5308cce9
authored
Jan 23, 2024
by
Sayak Paul
Committed by
GitHub
Jan 23, 2024
Browse files
[Tests] Test for passing local config file to `from_single_file()` (#6638)
make config file local too.
parent
318556b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
tests/pipelines/stable_diffusion/test_stable_diffusion.py
tests/pipelines/stable_diffusion/test_stable_diffusion.py
+5
-2
No files found.
tests/pipelines/stable_diffusion/test_stable_diffusion.py
View file @
5308cce9
...
@@ -1246,9 +1246,12 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
...
@@ -1246,9 +1246,12 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
assert
image_out
.
shape
==
(
512
,
512
,
3
)
assert
image_out
.
shape
==
(
512
,
512
,
3
)
def
test_download_local
(
self
):
def
test_download_local
(
self
):
filename
=
hf_hub_download
(
"runwayml/stable-diffusion-v1-5"
,
filename
=
"v1-5-pruned-emaonly.ckpt"
)
ckpt_filename
=
hf_hub_download
(
"runwayml/stable-diffusion-v1-5"
,
filename
=
"v1-5-pruned-emaonly.ckpt"
)
config_filename
=
hf_hub_download
(
"runwayml/stable-diffusion-v1-5"
,
filename
=
"v1-inference.yaml"
)
pipe
=
StableDiffusionPipeline
.
from_single_file
(
filename
,
torch_dtype
=
torch
.
float16
)
pipe
=
StableDiffusionPipeline
.
from_single_file
(
ckpt_filename
,
config_files
=
{
"v1"
:
config_filename
},
torch_dtype
=
torch
.
float16
)
pipe
.
scheduler
=
DDIMScheduler
.
from_config
(
pipe
.
scheduler
.
config
)
pipe
.
scheduler
=
DDIMScheduler
.
from_config
(
pipe
.
scheduler
.
config
)
pipe
.
to
(
"cuda"
)
pipe
.
to
(
"cuda"
)
...
...
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