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
77fc197f
Unverified
Commit
77fc197f
authored
Nov 28, 2022
by
Patrick von Platen
Committed by
GitHub
Nov 28, 2022
Browse files
Speed up test and remove kwargs from call (#1446)
Remove kwargs from call
parent
edf22c05
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
3 additions
and
17 deletions
+3
-17
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
...ffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
+0
-1
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
...pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
...rs/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py
...elines/stable_diffusion/pipeline_flax_stable_diffusion.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py
...elines/stable_diffusion/pipeline_onnx_stable_diffusion.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py
...table_diffusion/pipeline_onnx_stable_diffusion_img2img.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py
...table_diffusion/pipeline_onnx_stable_diffusion_inpaint.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint_legacy.py
...iffusion/pipeline_onnx_stable_diffusion_inpaint_legacy.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py
...s/pipelines/stable_diffusion/pipeline_stable_diffusion.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py
...le_diffusion/pipeline_stable_diffusion_image_variation.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
...nes/stable_diffusion/pipeline_stable_diffusion_img2img.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
...nes/stable_diffusion/pipeline_stable_diffusion_inpaint.py
+0
-1
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
...ble_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
+0
-1
src/diffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py
...s/stable_diffusion_safe/pipeline_stable_diffusion_safe.py
+0
-1
tests/pipelines/stable_diffusion/test_stable_diffusion.py
tests/pipelines/stable_diffusion/test_stable_diffusion.py
+3
-3
No files found.
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
View file @
77fc197f
...
@@ -445,7 +445,6 @@ class AltDiffusionPipeline(DiffusionPipeline):
...
@@ -445,7 +445,6 @@ class AltDiffusionPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
View file @
77fc197f
...
@@ -484,7 +484,6 @@ class AltDiffusionImg2ImgPipeline(DiffusionPipeline):
...
@@ -484,7 +484,6 @@ class AltDiffusionImg2ImgPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
View file @
77fc197f
...
@@ -528,7 +528,6 @@ class CycleDiffusionPipeline(DiffusionPipeline):
...
@@ -528,7 +528,6 @@ class CycleDiffusionPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py
View file @
77fc197f
...
@@ -289,7 +289,6 @@ class FlaxStableDiffusionPipeline(FlaxDiffusionPipeline):
...
@@ -289,7 +289,6 @@ class FlaxStableDiffusionPipeline(FlaxDiffusionPipeline):
jit
:
bool
=
False
,
jit
:
bool
=
False
,
debug
:
bool
=
False
,
debug
:
bool
=
False
,
neg_prompt_ids
:
jnp
.
array
=
None
,
neg_prompt_ids
:
jnp
.
array
=
None
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py
View file @
77fc197f
...
@@ -205,7 +205,6 @@ class OnnxStableDiffusionPipeline(DiffusionPipeline):
...
@@ -205,7 +205,6 @@ class OnnxStableDiffusionPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
if
isinstance
(
prompt
,
str
):
if
isinstance
(
prompt
,
str
):
batch_size
=
1
batch_size
=
1
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py
View file @
77fc197f
...
@@ -241,7 +241,6 @@ class OnnxStableDiffusionImg2ImgPipeline(DiffusionPipeline):
...
@@ -241,7 +241,6 @@ class OnnxStableDiffusionImg2ImgPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py
View file @
77fc197f
...
@@ -259,7 +259,6 @@ class OnnxStableDiffusionInpaintPipeline(DiffusionPipeline):
...
@@ -259,7 +259,6 @@ class OnnxStableDiffusionInpaintPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint_legacy.py
View file @
77fc197f
...
@@ -241,7 +241,6 @@ class OnnxStableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
...
@@ -241,7 +241,6 @@ class OnnxStableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
np
.
ndarray
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py
View file @
77fc197f
...
@@ -444,7 +444,6 @@ class StableDiffusionPipeline(DiffusionPipeline):
...
@@ -444,7 +444,6 @@ class StableDiffusionPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py
View file @
77fc197f
...
@@ -342,7 +342,6 @@ class StableDiffusionImageVariationPipeline(DiffusionPipeline):
...
@@ -342,7 +342,6 @@ class StableDiffusionImageVariationPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
View file @
77fc197f
...
@@ -493,7 +493,6 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
...
@@ -493,7 +493,6 @@ class StableDiffusionImg2ImgPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
View file @
77fc197f
...
@@ -566,7 +566,6 @@ class StableDiffusionInpaintPipeline(DiffusionPipeline):
...
@@ -566,7 +566,6 @@ class StableDiffusionInpaintPipeline(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
View file @
77fc197f
...
@@ -492,7 +492,6 @@ class StableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
...
@@ -492,7 +492,6 @@ class StableDiffusionInpaintPipelineLegacy(DiffusionPipeline):
return_dict
:
bool
=
True
,
return_dict
:
bool
=
True
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback
:
Optional
[
Callable
[[
int
,
int
,
torch
.
FloatTensor
],
None
]]
=
None
,
callback_steps
:
Optional
[
int
]
=
1
,
callback_steps
:
Optional
[
int
]
=
1
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
src/diffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py
View file @
77fc197f
...
@@ -546,7 +546,6 @@ class StableDiffusionPipelineSafe(DiffusionPipeline):
...
@@ -546,7 +546,6 @@ class StableDiffusionPipelineSafe(DiffusionPipeline):
sld_threshold
:
Optional
[
float
]
=
0.01
,
sld_threshold
:
Optional
[
float
]
=
0.01
,
sld_momentum_scale
:
Optional
[
float
]
=
0.3
,
sld_momentum_scale
:
Optional
[
float
]
=
0.3
,
sld_mom_beta
:
Optional
[
float
]
=
0.4
,
sld_mom_beta
:
Optional
[
float
]
=
0.4
,
**
kwargs
,
):
):
r
"""
r
"""
Function invoked when calling the pipeline for generation.
Function invoked when calling the pipeline for generation.
...
...
tests/pipelines/stable_diffusion/test_stable_diffusion.py
View file @
77fc197f
...
@@ -765,18 +765,18 @@ class StableDiffusionPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
...
@@ -765,18 +765,18 @@ class StableDiffusionPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
prompt
=
"hey"
prompt
=
"hey"
output
=
sd_pipe
(
prompt
,
num
ber_of
_steps
=
1
,
output_type
=
"np"
)
output
=
sd_pipe
(
prompt
,
num
_inference
_steps
=
1
,
output_type
=
"np"
)
image_shape
=
output
.
images
[
0
].
shape
[:
2
]
image_shape
=
output
.
images
[
0
].
shape
[:
2
]
assert
image_shape
==
(
64
,
64
)
assert
image_shape
==
(
64
,
64
)
output
=
sd_pipe
(
prompt
,
num
ber_of
_steps
=
1
,
height
=
96
,
width
=
96
,
output_type
=
"np"
)
output
=
sd_pipe
(
prompt
,
num
_inference
_steps
=
1
,
height
=
96
,
width
=
96
,
output_type
=
"np"
)
image_shape
=
output
.
images
[
0
].
shape
[:
2
]
image_shape
=
output
.
images
[
0
].
shape
[:
2
]
assert
image_shape
==
(
96
,
96
)
assert
image_shape
==
(
96
,
96
)
config
=
dict
(
sd_pipe
.
unet
.
config
)
config
=
dict
(
sd_pipe
.
unet
.
config
)
config
[
"sample_size"
]
=
96
config
[
"sample_size"
]
=
96
sd_pipe
.
unet
=
UNet2DConditionModel
.
from_config
(
config
).
to
(
torch_device
)
sd_pipe
.
unet
=
UNet2DConditionModel
.
from_config
(
config
).
to
(
torch_device
)
output
=
sd_pipe
(
prompt
,
num
ber_of
_steps
=
1
,
output_type
=
"np"
)
output
=
sd_pipe
(
prompt
,
num
_inference
_steps
=
1
,
output_type
=
"np"
)
image_shape
=
output
.
images
[
0
].
shape
[:
2
]
image_shape
=
output
.
images
[
0
].
shape
[:
2
]
assert
image_shape
==
(
192
,
192
)
assert
image_shape
==
(
192
,
192
)
...
...
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