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
a808a853
Unverified
Commit
a808a853
authored
Nov 29, 2022
by
Patrick von Platen
Committed by
GitHub
Nov 29, 2022
Browse files
fix slow tests (#1467)
parent
4c54519e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
tests/pipelines/stable_diffusion/test_stable_diffusion_image_variation.py
...stable_diffusion/test_stable_diffusion_image_variation.py
+1
-1
tests/pipelines/stable_diffusion_2/test_stable_diffusion.py
tests/pipelines/stable_diffusion_2/test_stable_diffusion.py
+1
-1
tests/pipelines/stable_diffusion_2/test_stable_diffusion_v_pred.py
...elines/stable_diffusion_2/test_stable_diffusion_v_pred.py
+1
-1
tests/pipelines/versatile_diffusion/test_versatile_diffusion_mega.py
...ines/versatile_diffusion/test_versatile_diffusion_mega.py
+3
-3
No files found.
tests/pipelines/stable_diffusion/test_stable_diffusion_image_variation.py
View file @
a808a853
...
@@ -357,7 +357,7 @@ class StableDiffusionImageVariationPipelineIntegrationTests(unittest.TestCase):
...
@@ -357,7 +357,7 @@ class StableDiffusionImageVariationPipelineIntegrationTests(unittest.TestCase):
assert
latents
.
shape
==
(
1
,
4
,
64
,
64
)
assert
latents
.
shape
==
(
1
,
4
,
64
,
64
)
latents_slice
=
latents
[
0
,
-
3
:,
-
3
:,
-
1
]
latents_slice
=
latents
[
0
,
-
3
:,
-
3
:,
-
1
]
expected_slice
=
np
.
array
([
2.285
,
2.703
,
1.969
,
0.696
,
-
1.323
,
0.9253
,
-
0.5464
,
-
1.521
,
-
2.537
])
expected_slice
=
np
.
array
([
2.285
,
2.703
,
1.969
,
0.696
,
-
1.323
,
0.9253
,
-
0.5464
,
-
1.521
,
-
2.537
])
assert
np
.
abs
(
latents_slice
.
flatten
()
-
expected_slice
).
max
()
<
1
e-2
assert
np
.
abs
(
latents_slice
.
flatten
()
-
expected_slice
).
max
()
<
5
e-2
test_callback_fn
.
has_been_called
=
False
test_callback_fn
.
has_been_called
=
False
...
...
tests/pipelines/stable_diffusion_2/test_stable_diffusion.py
View file @
a808a853
...
@@ -668,7 +668,7 @@ class StableDiffusion2PipelineIntegrationTests(unittest.TestCase):
...
@@ -668,7 +668,7 @@ class StableDiffusion2PipelineIntegrationTests(unittest.TestCase):
assert
latents
.
shape
==
(
1
,
4
,
64
,
64
)
assert
latents
.
shape
==
(
1
,
4
,
64
,
64
)
latents_slice
=
latents
[
0
,
-
3
:,
-
3
:,
-
1
]
latents_slice
=
latents
[
0
,
-
3
:,
-
3
:,
-
1
]
expected_slice
=
np
.
array
([
1.0757
,
1.1860
,
1.1410
,
0.4645
,
-
0.2476
,
0.6100
,
-
0.7755
,
-
0.8841
,
-
0.9497
])
expected_slice
=
np
.
array
([
1.0757
,
1.1860
,
1.1410
,
0.4645
,
-
0.2476
,
0.6100
,
-
0.7755
,
-
0.8841
,
-
0.9497
])
assert
np
.
abs
(
latents_slice
.
flatten
()
-
expected_slice
).
max
()
<
1
e-2
assert
np
.
abs
(
latents_slice
.
flatten
()
-
expected_slice
).
max
()
<
5
e-2
test_callback_fn
.
has_been_called
=
False
test_callback_fn
.
has_been_called
=
False
...
...
tests/pipelines/stable_diffusion_2/test_stable_diffusion_v_pred.py
View file @
a808a853
...
@@ -385,7 +385,7 @@ class StableDiffusion2VPredictionPipelineIntegrationTests(unittest.TestCase):
...
@@ -385,7 +385,7 @@ class StableDiffusion2VPredictionPipelineIntegrationTests(unittest.TestCase):
image
=
output
.
images
[
0
]
image
=
output
.
images
[
0
]
assert
image
.
shape
==
(
768
,
768
,
3
)
assert
image
.
shape
==
(
768
,
768
,
3
)
assert
np
.
abs
(
expected_image
-
image
).
max
()
<
5e-
3
assert
np
.
abs
(
expected_image
-
image
).
max
()
<
5e-
1
def
test_stable_diffusion_text2img_intermediate_state_v_pred
(
self
):
def
test_stable_diffusion_text2img_intermediate_state_v_pred
(
self
):
number_of_steps
=
0
number_of_steps
=
0
...
...
tests/pipelines/versatile_diffusion/test_versatile_diffusion_mega.py
View file @
a808a853
...
@@ -105,7 +105,7 @@ class VersatileDiffusionMegaPipelineIntegrationTests(unittest.TestCase):
...
@@ -105,7 +105,7 @@ class VersatileDiffusionMegaPipelineIntegrationTests(unittest.TestCase):
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
expected_slice
=
np
.
array
([
0.0081
,
0.0032
,
0.0002
,
0.0056
,
0.0027
,
0.0000
,
0.0051
,
0.0020
,
0.0007
])
expected_slice
=
np
.
array
([
0.0081
,
0.0032
,
0.0002
,
0.0056
,
0.0027
,
0.0000
,
0.0051
,
0.0020
,
0.0007
])
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
1
e-2
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
5
e-2
prompt
=
"A painting of a squirrel eating a burger "
prompt
=
"A painting of a squirrel eating a burger "
generator
=
torch
.
Generator
(
device
=
torch_device
).
manual_seed
(
0
)
generator
=
torch
.
Generator
(
device
=
torch_device
).
manual_seed
(
0
)
...
@@ -117,7 +117,7 @@ class VersatileDiffusionMegaPipelineIntegrationTests(unittest.TestCase):
...
@@ -117,7 +117,7 @@ class VersatileDiffusionMegaPipelineIntegrationTests(unittest.TestCase):
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
expected_slice
=
np
.
array
([
0.0408
,
0.0181
,
0.0
,
0.0388
,
0.0046
,
0.0461
,
0.0411
,
0.0
,
0.0222
])
expected_slice
=
np
.
array
([
0.0408
,
0.0181
,
0.0
,
0.0388
,
0.0046
,
0.0461
,
0.0411
,
0.0
,
0.0222
])
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
1
e-2
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
5
e-2
image
=
pipe
.
image_variation
(
init_image
,
generator
=
generator
,
output_type
=
"numpy"
).
images
image
=
pipe
.
image_variation
(
init_image
,
generator
=
generator
,
output_type
=
"numpy"
).
images
...
@@ -125,4 +125,4 @@ class VersatileDiffusionMegaPipelineIntegrationTests(unittest.TestCase):
...
@@ -125,4 +125,4 @@ class VersatileDiffusionMegaPipelineIntegrationTests(unittest.TestCase):
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
expected_slice
=
np
.
array
([
0.3403
,
0.1809
,
0.0938
,
0.3855
,
0.2393
,
0.1243
,
0.4028
,
0.3110
,
0.1799
])
expected_slice
=
np
.
array
([
0.3403
,
0.1809
,
0.0938
,
0.3855
,
0.2393
,
0.1243
,
0.4028
,
0.3110
,
0.1799
])
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
1
e-2
assert
np
.
abs
(
image_slice
.
flatten
()
-
expected_slice
).
max
()
<
5
e-2
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