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
31c4f24f
Unverified
Commit
31c4f24f
authored
Apr 10, 2025
by
Yao Matrix
Committed by
GitHub
Apr 10, 2025
Browse files
make test_instant_style_multiple_masks pass on XPU (#11266)
Signed-off-by:
Matrix Yao
<
matrix.yao@intel.com
>
parent
0efdf411
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
1 deletion
+45
-1
tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py
...pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py
+45
-1
No files found.
tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py
View file @
31c4f24f
...
@@ -34,6 +34,7 @@ from diffusers import (
...
@@ -34,6 +34,7 @@ from diffusers import (
from
diffusers.image_processor
import
IPAdapterMaskProcessor
from
diffusers.image_processor
import
IPAdapterMaskProcessor
from
diffusers.utils
import
load_image
from
diffusers.utils
import
load_image
from
diffusers.utils.testing_utils
import
(
from
diffusers.utils.testing_utils
import
(
Expectations
,
backend_empty_cache
,
backend_empty_cache
,
enable_full_determinism
,
enable_full_determinism
,
is_flaky
,
is_flaky
,
...
@@ -664,7 +665,50 @@ class IPAdapterSDXLIntegrationTests(IPAdapterNightlyTestsMixin):
...
@@ -664,7 +665,50 @@ class IPAdapterSDXLIntegrationTests(IPAdapterNightlyTestsMixin):
images
=
pipeline
(
**
inputs
).
images
images
=
pipeline
(
**
inputs
).
images
image_slice
=
images
[
0
,
:
3
,
:
3
,
-
1
].
flatten
()
image_slice
=
images
[
0
,
:
3
,
:
3
,
-
1
].
flatten
()
expected_slice
=
np
.
array
([
0.2323
,
0.1026
,
0.1338
,
0.0638
,
0.0662
,
0.0000
,
0.0000
,
0.0000
,
0.0199
])
expected_slices
=
Expectations
(
{
(
"xpu"
,
3
):
np
.
array
(
[
0.2520
,
0.1050
,
0.1510
,
0.0997
,
0.0893
,
0.0019
,
0.0000
,
0.0000
,
0.0210
,
]
),
(
"cuda"
,
7
):
np
.
array
(
[
0.2323
,
0.1026
,
0.1338
,
0.0638
,
0.0662
,
0.0000
,
0.0000
,
0.0000
,
0.0199
,
]
),
(
"cuda"
,
8
):
np
.
array
(
[
0.2518
,
0.1059
,
0.1553
,
0.0977
,
0.0852
,
0.0000
,
0.0000
,
0.0000
,
0.0220
,
]
),
}
)
expected_slice
=
expected_slices
.
get_expectation
()
max_diff
=
numpy_cosine_similarity_distance
(
image_slice
,
expected_slice
)
max_diff
=
numpy_cosine_similarity_distance
(
image_slice
,
expected_slice
)
assert
max_diff
<
5e-4
assert
max_diff
<
5e-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