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
9db9be65
Unverified
Commit
9db9be65
authored
Jul 21, 2025
by
Aryan
Committed by
GitHub
Jul 21, 2025
Browse files
[tests] Add fast test slices for HiDream-Image (#11953)
update
parent
d87134ad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
tests/pipelines/hidream_image/test_pipeline_hidream.py
tests/pipelines/hidream_image/test_pipeline_hidream.py
+8
-4
No files found.
tests/pipelines/hidream_image/test_pipeline_hidream.py
View file @
9db9be65
...
@@ -146,11 +146,15 @@ class HiDreamImagePipelineFastTests(PipelineTesterMixin, unittest.TestCase):
...
@@ -146,11 +146,15 @@ class HiDreamImagePipelineFastTests(PipelineTesterMixin, unittest.TestCase):
inputs
=
self
.
get_dummy_inputs
(
device
)
inputs
=
self
.
get_dummy_inputs
(
device
)
image
=
pipe
(
**
inputs
)[
0
]
image
=
pipe
(
**
inputs
)[
0
]
generated_image
=
image
[
0
]
generated_image
=
image
[
0
]
self
.
assertEqual
(
generated_image
.
shape
,
(
128
,
128
,
3
))
self
.
assertEqual
(
generated_image
.
shape
,
(
128
,
128
,
3
))
expected_image
=
torch
.
randn
(
128
,
128
,
3
).
numpy
()
max_diff
=
np
.
abs
(
generated_image
-
expected_image
).
max
()
# fmt: off
self
.
assertLessEqual
(
max_diff
,
1e10
)
expected_slice
=
np
.
array
([
0.4507
,
0.5256
,
0.4205
,
0.5791
,
0.4848
,
0.4831
,
0.4443
,
0.5107
,
0.6586
,
0.3163
,
0.7318
,
0.5933
,
0.6252
,
0.5512
,
0.5357
,
0.5983
])
# fmt: on
generated_slice
=
generated_image
.
flatten
()
generated_slice
=
np
.
concatenate
([
generated_slice
[:
8
],
generated_slice
[
-
8
:]])
self
.
assertTrue
(
np
.
allclose
(
generated_slice
,
expected_slice
,
atol
=
1e-3
))
def
test_inference_batch_single_identical
(
self
):
def
test_inference_batch_single_identical
(
self
):
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
3e-4
)
super
().
test_inference_batch_single_identical
(
expected_max_diff
=
3e-4
)
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