Skip to content

Commit

Permalink
fix(api): return correct output from tiled VAE
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Apr 29, 2023
1 parent f420a3a commit b4dfc44
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions api/onnx_web/diffusers/patches/vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,10 @@ def tiled_encode(
result_rows.append(torch.cat(result_row, dim=3))

moments = torch.cat(result_rows, dim=2)
posterior = DiagonalGaussianDistribution(moments)
posterior = posterior.numpy()

if not return_dict:
return (posterior,)
return (moments,)

return AutoencoderKLOutput(latent_dist=posterior)
return AutoencoderKLOutput(latent_dist=moments)

@torch.no_grad()
def tiled_decode(
Expand Down

0 comments on commit b4dfc44

Please sign in to comment.