Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
diffusers
Commits
95d37484
Unverified
Commit
95d37484
authored
May 14, 2024
by
Sayak Paul
Committed by
GitHub
May 13, 2024
Browse files
[LoRA] Fix LoRA tests (side effects of RGB ordering) part ii (#7932)
* check * check 2. * update slices
parent
44aa9e56
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
tests/lora/test_lora_layers_sdxl.py
tests/lora/test_lora_layers_sdxl.py
+2
-3
No files found.
tests/lora/test_lora_layers_sdxl.py
View file @
95d37484
...
@@ -224,7 +224,7 @@ class LoraSDXLIntegrationTests(unittest.TestCase):
...
@@ -224,7 +224,7 @@ class LoraSDXLIntegrationTests(unittest.TestCase):
).
images
).
images
images
=
images
[
0
,
-
3
:,
-
3
:,
-
1
].
flatten
()
images
=
images
[
0
,
-
3
:,
-
3
:,
-
1
].
flatten
()
expected
=
np
.
array
([
0.4468
,
0.40
87
,
0.4134
,
0.36
6
,
0.3202
,
0.3
50
5
,
0.3786
,
0.3
8
7
,
0.3535
])
expected
=
np
.
array
([
0
0
.4468
,
0.40
61
,
0.4134
,
0.36
37
,
0.3202
,
0.3
6
5
,
0.3786
,
0.37
25
,
0.3535
])
max_diff
=
numpy_cosine_similarity_distance
(
expected
,
images
)
max_diff
=
numpy_cosine_similarity_distance
(
expected
,
images
)
assert
max_diff
<
1e-4
assert
max_diff
<
1e-4
...
@@ -507,13 +507,12 @@ class LoraSDXLIntegrationTests(unittest.TestCase):
...
@@ -507,13 +507,12 @@ class LoraSDXLIntegrationTests(unittest.TestCase):
image
=
load_image
(
image
=
load_image
(
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/bird_canny.png"
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd_controlnet/bird_canny.png"
)
)
images
=
pipe
(
prompt
,
image
=
image
,
generator
=
generator
,
output_type
=
"np"
,
num_inference_steps
=
3
).
images
images
=
pipe
(
prompt
,
image
=
image
,
generator
=
generator
,
output_type
=
"np"
,
num_inference_steps
=
3
).
images
assert
images
[
0
].
shape
==
(
768
,
512
,
3
)
assert
images
[
0
].
shape
==
(
768
,
512
,
3
)
original_image
=
images
[
0
,
-
3
:,
-
3
:,
-
1
].
flatten
()
original_image
=
images
[
0
,
-
3
:,
-
3
:,
-
1
].
flatten
()
expected_image
=
np
.
array
([
0.4574
,
0.44
61
,
0.4435
,
0.
4462
,
0.4396
,
0.4
39
,
0.
4474
,
0.44
8
6
,
0.4333
])
expected_image
=
np
.
array
([
0.4574
,
0.44
87
,
0.4435
,
0.
5163
,
0.4396
,
0.4
411
,
0.
518
,
0.446
5
,
0.4333
])
max_diff
=
numpy_cosine_similarity_distance
(
expected_image
,
original_image
)
max_diff
=
numpy_cosine_similarity_distance
(
expected_image
,
original_image
)
assert
max_diff
<
1e-4
assert
max_diff
<
1e-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