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
03ca1131
Unverified
Commit
03ca1131
authored
May 02, 2024
by
Dhruv Nair
Committed by
GitHub
May 02, 2024
Browse files
Update download diff format tests (#7831)
update Co-authored-by:
Sayak Paul
<
spsayakpaul@gmail.com
>
parent
3ffa7b46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
tests/pipelines/stable_diffusion/test_stable_diffusion.py
tests/pipelines/stable_diffusion/test_stable_diffusion.py
+5
-5
No files found.
tests/pipelines/stable_diffusion/test_stable_diffusion.py
View file @
03ca1131
...
...
@@ -1257,8 +1257,8 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
def
test_download_from_hub
(
self
):
ckpt_paths
=
[
"https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.
ckpt
"
,
"https://huggingface.co/WarriorMama777/OrangeMixs/blob/main/Models/AbyssOrangeMix/AbyssOrangeMix
_base.ckpt
"
,
"https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.
safetensors
"
,
"https://huggingface.co/WarriorMama777/OrangeMixs/blob/main/Models/AbyssOrangeMix/AbyssOrangeMix
.safetensors
"
,
]
for
ckpt_path
in
ckpt_paths
:
...
...
@@ -1271,7 +1271,7 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
assert
image_out
.
shape
==
(
512
,
512
,
3
)
def
test_download_local
(
self
):
ckpt_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.
safetensors
"
)
config_filename
=
hf_hub_download
(
"runwayml/stable-diffusion-v1-5"
,
filename
=
"v1-inference.yaml"
)
pipe
=
StableDiffusionPipeline
.
from_single_file
(
...
...
@@ -1285,7 +1285,7 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
assert
image_out
.
shape
==
(
512
,
512
,
3
)
def
test_download_ckpt_diff_format_is_same
(
self
):
ckpt_path
=
"https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.
ckpt
"
ckpt_path
=
"https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.
safetensors
"
sf_pipe
=
StableDiffusionPipeline
.
from_single_file
(
ckpt_path
)
sf_pipe
.
scheduler
=
DDIMScheduler
.
from_config
(
sf_pipe
.
scheduler
.
config
)
...
...
@@ -1310,7 +1310,7 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
def
test_single_file_component_configs
(
self
):
pipe
=
StableDiffusionPipeline
.
from_pretrained
(
"runwayml/stable-diffusion-v1-5"
)
ckpt_path
=
"https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.
ckpt
"
ckpt_path
=
"https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.
safetensors
"
single_file_pipe
=
StableDiffusionPipeline
.
from_single_file
(
ckpt_path
,
load_safety_checker
=
True
)
for
param_name
,
param_value
in
single_file_pipe
.
text_encoder
.
config
.
to_dict
().
items
():
...
...
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