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
92ea5bac
Unverified
Commit
92ea5bac
authored
May 17, 2023
by
superlabs-dev
Committed by
GitHub
May 16, 2023
Browse files
fix tiled vae blend extent range (#3384)
fix tiled vae bleand extent range
parent
754fac82
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/diffusers/models/autoencoder_kl.py
src/diffusers/models/autoencoder_kl.py
+4
-2
No files found.
src/diffusers/models/autoencoder_kl.py
View file @
92ea5bac
...
...
@@ -196,12 +196,14 @@ class AutoencoderKL(ModelMixin, ConfigMixin):
return
DecoderOutput
(
sample
=
decoded
)
def
blend_v
(
self
,
a
,
b
,
blend_extent
):
for
y
in
range
(
min
(
a
.
shape
[
2
],
b
.
shape
[
2
],
blend_extent
)):
blend_extent
=
min
(
a
.
shape
[
2
],
b
.
shape
[
2
],
blend_extent
)
for
y
in
range
(
blend_extent
):
b
[:,
:,
y
,
:]
=
a
[:,
:,
-
blend_extent
+
y
,
:]
*
(
1
-
y
/
blend_extent
)
+
b
[:,
:,
y
,
:]
*
(
y
/
blend_extent
)
return
b
def
blend_h
(
self
,
a
,
b
,
blend_extent
):
for
x
in
range
(
min
(
a
.
shape
[
3
],
b
.
shape
[
3
],
blend_extent
)):
blend_extent
=
min
(
a
.
shape
[
3
],
b
.
shape
[
3
],
blend_extent
)
for
x
in
range
(
blend_extent
):
b
[:,
:,
:,
x
]
=
a
[:,
:,
:,
-
blend_extent
+
x
]
*
(
1
-
x
/
blend_extent
)
+
b
[:,
:,
:,
x
]
*
(
x
/
blend_extent
)
return
b
...
...
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