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
bbb46ad3
Unverified
Commit
bbb46ad3
authored
Feb 07, 2023
by
Patrick von Platen
Committed by
GitHub
Feb 07, 2023
Browse files
[Tests] Fix slow tests (#2271)
parent
b1dad2e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
tests/pipelines/stable_diffusion/test_stable_diffusion_inpaint_legacy.py
.../stable_diffusion/test_stable_diffusion_inpaint_legacy.py
+2
-2
tests/pipelines/stable_diffusion_2/test_stable_diffusion_latent_upscale.py
...table_diffusion_2/test_stable_diffusion_latent_upscale.py
+2
-2
No files found.
tests/pipelines/stable_diffusion/test_stable_diffusion_inpaint_legacy.py
View file @
bbb46ad3
...
@@ -384,7 +384,7 @@ class StableDiffusionInpaintLegacyPipelineSlowTests(unittest.TestCase):
...
@@ -384,7 +384,7 @@ class StableDiffusionInpaintLegacyPipelineSlowTests(unittest.TestCase):
image_slice
=
image
[
0
,
253
:
256
,
253
:
256
,
-
1
].
flatten
()
image_slice
=
image
[
0
,
253
:
256
,
253
:
256
,
-
1
].
flatten
()
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
expected_slice
=
np
.
array
([
0.566
9
,
0.61
24
,
0.643
1
,
0.407
3
,
0.4
61
4
,
0.56
70
,
0.1
609
,
0.31
28
,
0.43
3
0
])
expected_slice
=
np
.
array
([
0.566
5
,
0.61
17
,
0.643
0
,
0.40
5
7
,
0.4
59
4
,
0.56
58
,
0.1
596
,
0.31
06
,
0.430
5
])
assert
np
.
abs
(
expected_slice
-
image_slice
).
max
()
<
1e-4
assert
np
.
abs
(
expected_slice
-
image_slice
).
max
()
<
1e-4
...
@@ -402,7 +402,7 @@ class StableDiffusionInpaintLegacyPipelineSlowTests(unittest.TestCase):
...
@@ -402,7 +402,7 @@ class StableDiffusionInpaintLegacyPipelineSlowTests(unittest.TestCase):
image_slice
=
image
[
0
,
253
:
256
,
253
:
256
,
-
1
].
flatten
()
image_slice
=
image
[
0
,
253
:
256
,
253
:
256
,
-
1
].
flatten
()
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
assert
image
.
shape
==
(
1
,
512
,
512
,
3
)
expected_slice
=
np
.
array
([
0.453
3
,
0.446
5
,
0.432
7
,
0.4329
,
0.4339
,
0.42
19
,
0.424
3
,
0.4332
,
0.4426
])
expected_slice
=
np
.
array
([
0.453
4
,
0.446
7
,
0.432
9
,
0.4329
,
0.4339
,
0.42
20
,
0.424
4
,
0.4332
,
0.4426
])
assert
np
.
abs
(
expected_slice
-
image_slice
).
max
()
<
1e-4
assert
np
.
abs
(
expected_slice
-
image_slice
).
max
()
<
1e-4
...
...
tests/pipelines/stable_diffusion_2/test_stable_diffusion_latent_upscale.py
View file @
bbb46ad3
...
@@ -188,7 +188,7 @@ class StableDiffusionLatentUpscalePipelineIntegrationTests(unittest.TestCase):
...
@@ -188,7 +188,7 @@ class StableDiffusionLatentUpscalePipelineIntegrationTests(unittest.TestCase):
expected_image
=
load_numpy
(
expected_image
=
load_numpy
(
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/latent-upscaler/astronaut_1024.npy"
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/latent-upscaler/astronaut_1024.npy"
)
)
assert
np
.
abs
((
expected_image
-
image
).
max
())
<
1
e-
3
assert
np
.
abs
((
expected_image
-
image
).
max
())
<
5
e-
2
def
test_latent_upscaler_fp16_image
(
self
):
def
test_latent_upscaler_fp16_image
(
self
):
generator
=
torch
.
manual_seed
(
33
)
generator
=
torch
.
manual_seed
(
33
)
...
@@ -216,4 +216,4 @@ class StableDiffusionLatentUpscalePipelineIntegrationTests(unittest.TestCase):
...
@@ -216,4 +216,4 @@ class StableDiffusionLatentUpscalePipelineIntegrationTests(unittest.TestCase):
expected_image
=
load_numpy
(
expected_image
=
load_numpy
(
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/latent-upscaler/fire_temple_1024.npy"
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/latent-upscaler/fire_temple_1024.npy"
)
)
assert
np
.
abs
((
expected_image
-
image
).
max
())
<
1
e-
3
assert
np
.
abs
((
expected_image
-
image
).
max
())
<
5
e-
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