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
1a6def3d
Unverified
Commit
1a6def3d
authored
Apr 04, 2023
by
YiYi Xu
Committed by
GitHub
Apr 04, 2023
Browse files
fix post-processing (#2968)
Co-authored-by:
yiyixuxu
<
yixu310@gmail,com
>
parent
0c63c383
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
...pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
+7
-6
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
...nes/stable_diffusion/pipeline_stable_diffusion_img2img.py
+7
-6
No files found.
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
View file @
1a6def3d
...
...
@@ -734,14 +734,15 @@ class AltDiffusionImg2ImgPipeline(DiffusionPipeline, TextualInversionLoaderMixin
image
=
latents
has_nsfw_concept
=
None
image
=
self
.
decode_latents
(
latents
)
if
self
.
safety_checker
is
not
None
:
image
,
has_nsfw_concept
=
self
.
run_safety_checker
(
image
,
device
,
prompt_embeds
.
dtype
)
else
:
has_nsfw_concept
=
False
image
=
self
.
decode_latents
(
latents
)
if
self
.
safety_checker
is
not
None
:
image
,
has_nsfw_concept
=
self
.
run_safety_checker
(
image
,
device
,
prompt_embeds
.
dtype
)
else
:
has_nsfw_concept
=
False
image
=
self
.
image_processor
.
postprocess
(
image
,
output_type
=
output_type
)
image
=
self
.
image_processor
.
postprocess
(
image
,
output_type
=
output_type
)
# Offload last model to CPU
if
hasattr
(
self
,
"final_offload_hook"
)
and
self
.
final_offload_hook
is
not
None
:
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
View file @
1a6def3d
...
...
@@ -742,14 +742,15 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline, TextualInversionLoaderMi
image
=
latents
has_nsfw_concept
=
None
image
=
self
.
decode_latents
(
latents
)
if
self
.
safety_checker
is
not
None
:
image
,
has_nsfw_concept
=
self
.
run_safety_checker
(
image
,
device
,
prompt_embeds
.
dtype
)
else
:
has_nsfw_concept
=
False
image
=
self
.
decode_latents
(
latents
)
if
self
.
safety_checker
is
not
None
:
image
,
has_nsfw_concept
=
self
.
run_safety_checker
(
image
,
device
,
prompt_embeds
.
dtype
)
else
:
has_nsfw_concept
=
False
image
=
self
.
image_processor
.
postprocess
(
image
,
output_type
=
output_type
)
image
=
self
.
image_processor
.
postprocess
(
image
,
output_type
=
output_type
)
# Offload last model to CPU
if
hasattr
(
self
,
"final_offload_hook"
)
and
self
.
final_offload_hook
is
not
None
:
...
...
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