"vscode:/vscode.git/clone" did not exist on "ccaa0bf282683dc1647147271f63ffbd0e972603"
Unverified Commit 92ea5bac authored by superlabs-dev's avatar superlabs-dev Committed by GitHub
Browse files

fix tiled vae blend extent range (#3384)

fix tiled vae bleand extent range
parent 754fac82
...@@ -196,12 +196,14 @@ class AutoencoderKL(ModelMixin, ConfigMixin): ...@@ -196,12 +196,14 @@ class AutoencoderKL(ModelMixin, ConfigMixin):
return DecoderOutput(sample=decoded) return DecoderOutput(sample=decoded)
def blend_v(self, a, b, blend_extent): 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) b[:, :, y, :] = a[:, :, -blend_extent + y, :] * (1 - y / blend_extent) + b[:, :, y, :] * (y / blend_extent)
return b return b
def blend_h(self, a, b, blend_extent): 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) b[:, :, :, x] = a[:, :, :, -blend_extent + x] * (1 - x / blend_extent) + b[:, :, :, x] * (x / blend_extent)
return b return b
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment