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
OpenDAS
diffusers
Commits
bbf70c87
Unverified
Commit
bbf70c87
authored
Feb 25, 2024
by
Aryan
Committed by
GitHub
Feb 24, 2024
Browse files
Fix truthy-ness condition in pipelines that use denoising_start (#6912)
* fix denoising start * fix tests * remove debug
parent
738c9869
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
12 deletions
+15
-12
examples/community/lpw_stable_diffusion_xl.py
examples/community/lpw_stable_diffusion_xl.py
+2
-2
examples/community/pipeline_sdxl_style_aligned.py
examples/community/pipeline_sdxl_style_aligned.py
+2
-2
examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py
...ipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py
+2
-2
src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py
...pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py
+5
-2
src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py
...able_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py
+2
-2
src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py
...able_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py
+2
-2
No files found.
examples/community/lpw_stable_diffusion_xl.py
View file @
bbf70c87
...
...
@@ -1766,7 +1766,7 @@ class SDXLLongPromptWeightingPipeline(
# 4. Prepare timesteps
def
denoising_value_valid
(
dnv
):
return
isinstance
(
self
.
denoising_end
,
float
)
and
0
<
dnv
<
1
return
isinstance
(
dnv
,
float
)
and
0
<
dnv
<
1
timesteps
,
num_inference_steps
=
retrieve_timesteps
(
self
.
scheduler
,
num_inference_steps
,
device
,
timesteps
)
if
image
is
not
None
:
...
...
@@ -1774,7 +1774,7 @@ class SDXLLongPromptWeightingPipeline(
num_inference_steps
,
strength
,
device
,
denoising_start
=
self
.
denoising_start
if
denoising_value_valid
else
None
,
denoising_start
=
self
.
denoising_start
if
denoising_value_valid
(
self
.
denoising_start
)
else
None
,
)
# check that number of inference steps is not < 1 - as this doesn't make sense
...
...
examples/community/pipeline_sdxl_style_aligned.py
View file @
bbf70c87
...
...
@@ -1769,7 +1769,7 @@ class StyleAlignedSDXLPipeline(
# 4. Prepare timesteps
def
denoising_value_valid
(
dnv
):
return
isinstance
(
self
.
denoising_end
,
float
)
and
0
<
dnv
<
1
return
isinstance
(
dnv
,
float
)
and
0
<
dnv
<
1
timesteps
,
num_inference_steps
=
retrieve_timesteps
(
self
.
scheduler
,
num_inference_steps
,
device
,
timesteps
)
...
...
@@ -1778,7 +1778,7 @@ class StyleAlignedSDXLPipeline(
num_inference_steps
,
strength
,
device
,
denoising_start
=
self
.
denoising_start
if
denoising_value_valid
else
None
,
denoising_start
=
self
.
denoising_start
if
denoising_value_valid
(
self
.
denoising_start
)
else
None
,
)
# check that number of inference steps is not < 1 - as this doesn't make sense
...
...
examples/community/pipeline_stable_diffusion_xl_controlnet_adapter_inpaint.py
View file @
bbf70c87
...
...
@@ -1563,14 +1563,14 @@ class StableDiffusionXLControlNetAdapterInpaintPipeline(DiffusionPipeline, FromS
# 4. set timesteps
def
denoising_value_valid
(
dnv
):
return
isinstance
(
d
enoising_end
,
float
)
and
0
<
dnv
<
1
return
isinstance
(
d
nv
,
float
)
and
0
<
dnv
<
1
self
.
scheduler
.
set_timesteps
(
num_inference_steps
,
device
=
device
)
timesteps
,
num_inference_steps
=
self
.
get_timesteps
(
num_inference_steps
,
strength
,
device
,
denoising_start
=
denoising_start
if
denoising_value_valid
else
None
,
denoising_start
=
denoising_start
if
denoising_value_valid
(
denoising_start
)
else
None
,
)
# check that number of inference steps is not < 1 - as this doesn't make sense
if
num_inference_steps
<
1
:
...
...
src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py
View file @
bbf70c87
...
...
@@ -1477,11 +1477,14 @@ class StableDiffusionXLControlNetInpaintPipeline(
# 4. set timesteps
def
denoising_value_valid
(
dnv
):
return
isinstance
(
d
enoising_end
,
float
)
and
0
<
dnv
<
1
return
isinstance
(
d
nv
,
float
)
and
0
<
dnv
<
1
self
.
scheduler
.
set_timesteps
(
num_inference_steps
,
device
=
device
)
timesteps
,
num_inference_steps
=
self
.
get_timesteps
(
num_inference_steps
,
strength
,
device
,
denoising_start
=
denoising_start
if
denoising_value_valid
else
None
num_inference_steps
,
strength
,
device
,
denoising_start
=
denoising_start
if
denoising_value_valid
(
denoising_start
)
else
None
,
)
# check that number of inference steps is not < 1 - as this doesn't make sense
if
num_inference_steps
<
1
:
...
...
src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_img2img.py
View file @
bbf70c87
...
...
@@ -1315,14 +1315,14 @@ class StableDiffusionXLImg2ImgPipeline(
# 5. Prepare timesteps
def
denoising_value_valid
(
dnv
):
return
isinstance
(
self
.
denoising_end
,
float
)
and
0
<
dnv
<
1
return
isinstance
(
dnv
,
float
)
and
0
<
dnv
<
1
timesteps
,
num_inference_steps
=
retrieve_timesteps
(
self
.
scheduler
,
num_inference_steps
,
device
,
timesteps
)
timesteps
,
num_inference_steps
=
self
.
get_timesteps
(
num_inference_steps
,
strength
,
device
,
denoising_start
=
self
.
denoising_start
if
denoising_value_valid
else
None
,
denoising_start
=
self
.
denoising_start
if
denoising_value_valid
(
self
.
denoising_start
)
else
None
,
)
latent_timestep
=
timesteps
[:
1
].
repeat
(
batch_size
*
num_images_per_prompt
)
...
...
src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl_inpaint.py
View file @
bbf70c87
...
...
@@ -1581,14 +1581,14 @@ class StableDiffusionXLInpaintPipeline(
# 4. set timesteps
def
denoising_value_valid
(
dnv
):
return
isinstance
(
self
.
denoising_end
,
float
)
and
0
<
dnv
<
1
return
isinstance
(
dnv
,
float
)
and
0
<
dnv
<
1
timesteps
,
num_inference_steps
=
retrieve_timesteps
(
self
.
scheduler
,
num_inference_steps
,
device
,
timesteps
)
timesteps
,
num_inference_steps
=
self
.
get_timesteps
(
num_inference_steps
,
strength
,
device
,
denoising_start
=
self
.
denoising_start
if
denoising_value_valid
else
None
,
denoising_start
=
self
.
denoising_start
if
denoising_value_valid
(
self
.
denoising_start
)
else
None
,
)
# check that number of inference steps is not < 1 - as this doesn't make sense
if
num_inference_steps
<
1
:
...
...
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