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
OpenDAS
diffusers
Commits
187ea539
Unverified
Commit
187ea539
authored
Jul 06, 2023
by
Patrick von Platen
Committed by
GitHub
Jul 06, 2023
Browse files
Improve SD XL (#3968)
* improve sd xl * correct more * finish * make style * fix more
parent
8bf80fc8
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tests/pipelines/stable_diffusion/test_stable_diffusion.py
tests/pipelines/stable_diffusion/test_stable_diffusion.py
+3
-3
No files found.
tests/pipelines/stable_diffusion/test_stable_diffusion.py
View file @
187ea539
...
@@ -1029,7 +1029,7 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
...
@@ -1029,7 +1029,7 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
]
]
for
ckpt_path
in
ckpt_paths
:
for
ckpt_path
in
ckpt_paths
:
pipe
=
StableDiffusionPipeline
.
from_
ckpt
(
ckpt_path
,
torch_dtype
=
torch
.
float16
)
pipe
=
StableDiffusionPipeline
.
from_
single_file
(
ckpt_path
,
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"
)
...
@@ -1040,7 +1040,7 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
...
@@ -1040,7 +1040,7 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
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"
)
filename
=
hf_hub_download
(
"runwayml/stable-diffusion-v1-5"
,
filename
=
"v1-5-pruned-emaonly.ckpt"
)
pipe
=
StableDiffusionPipeline
.
from_
ckpt
(
filename
,
torch_dtype
=
torch
.
float16
)
pipe
=
StableDiffusionPipeline
.
from_
single_file
(
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"
)
...
@@ -1051,7 +1051,7 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
...
@@ -1051,7 +1051,7 @@ class StableDiffusionPipelineCkptTests(unittest.TestCase):
def
test_download_ckpt_diff_format_is_same
(
self
):
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.ckpt"
pipe
=
StableDiffusionPipeline
.
from_
ckpt
(
ckpt_path
)
pipe
=
StableDiffusionPipeline
.
from_
single_file
(
ckpt_path
)
pipe
.
scheduler
=
DDIMScheduler
.
from_config
(
pipe
.
scheduler
.
config
)
pipe
.
scheduler
=
DDIMScheduler
.
from_config
(
pipe
.
scheduler
.
config
)
pipe
.
unet
.
set_attn_processor
(
AttnProcessor
())
pipe
.
unet
.
set_attn_processor
(
AttnProcessor
())
pipe
.
to
(
"cuda"
)
pipe
.
to
(
"cuda"
)
...
...
Prev
1
2
Next
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