Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
diffusers
Commits
5d441300
Commit
5d441300
authored
Aug 24, 2023
by
Patrick von Platen
Browse files
make style
parent
863e7416
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py
...diffusers/pipelines/stable_diffusion/convert_from_ckpt.py
+4
-4
No files found.
src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py
View file @
5d441300
...
@@ -1387,7 +1387,7 @@ def download_from_original_stable_diffusion_ckpt(
...
@@ -1387,7 +1387,7 @@ def download_from_original_stable_diffusion_ckpt(
unet
=
UNet2DConditionModel
(
**
unet_config
)
unet
=
UNet2DConditionModel
(
**
unet_config
)
if
is_accelerate_available
():
if
is_accelerate_available
():
if
model_type
not
in
[
"SDXL"
,
"SDXL-Refiner"
]:
# SBM Delay this.
if
model_type
not
in
[
"SDXL"
,
"SDXL-Refiner"
]:
# SBM Delay this.
for
param_name
,
param
in
converted_unet_checkpoint
.
items
():
for
param_name
,
param
in
converted_unet_checkpoint
.
items
():
set_module_tensor_to_device
(
unet
,
param_name
,
"cpu"
,
value
=
param
)
set_module_tensor_to_device
(
unet
,
param_name
,
"cpu"
,
value
=
param
)
else
:
else
:
...
@@ -1589,7 +1589,7 @@ def download_from_original_stable_diffusion_ckpt(
...
@@ -1589,7 +1589,7 @@ def download_from_original_stable_diffusion_ckpt(
checkpoint
,
config_name
,
prefix
=
"conditioner.embedders.1.model."
,
has_projection
=
True
,
**
config_kwargs
checkpoint
,
config_name
,
prefix
=
"conditioner.embedders.1.model."
,
has_projection
=
True
,
**
config_kwargs
)
)
if
is_accelerate_available
():
# SBM Now move model to cpu.
if
is_accelerate_available
():
# SBM Now move model to cpu.
if
model_type
in
[
"SDXL"
,
"SDXL-Refiner"
]:
if
model_type
in
[
"SDXL"
,
"SDXL-Refiner"
]:
for
param_name
,
param
in
converted_unet_checkpoint
.
items
():
for
param_name
,
param
in
converted_unet_checkpoint
.
items
():
set_module_tensor_to_device
(
unet
,
param_name
,
"cpu"
,
value
=
param
)
set_module_tensor_to_device
(
unet
,
param_name
,
"cpu"
,
value
=
param
)
...
@@ -1617,11 +1617,11 @@ def download_from_original_stable_diffusion_ckpt(
...
@@ -1617,11 +1617,11 @@ def download_from_original_stable_diffusion_ckpt(
checkpoint
,
config_name
,
prefix
=
"conditioner.embedders.0.model."
,
has_projection
=
True
,
**
config_kwargs
checkpoint
,
config_name
,
prefix
=
"conditioner.embedders.0.model."
,
has_projection
=
True
,
**
config_kwargs
)
)
if
is_accelerate_available
():
# SBM Now move model to cpu.
if
is_accelerate_available
():
# SBM Now move model to cpu.
if
model_type
in
[
"SDXL"
,
"SDXL-Refiner"
]:
if
model_type
in
[
"SDXL"
,
"SDXL-Refiner"
]:
for
param_name
,
param
in
converted_unet_checkpoint
.
items
():
for
param_name
,
param
in
converted_unet_checkpoint
.
items
():
set_module_tensor_to_device
(
unet
,
param_name
,
"cpu"
,
value
=
param
)
set_module_tensor_to_device
(
unet
,
param_name
,
"cpu"
,
value
=
param
)
pipe
=
StableDiffusionXLImg2ImgPipeline
(
pipe
=
StableDiffusionXLImg2ImgPipeline
(
vae
=
vae
,
vae
=
vae
,
text_encoder
=
text_encoder
,
text_encoder
=
text_encoder
,
...
...
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