MCPcopy Create free account
hub / github.com/apple/ml-stable-diffusion / VAEDecoder

Class VAEDecoder

python_coreml_stable_diffusion/torch2coreml.py:500–510  ·  view source on GitHub ↗

Wrapper nn.Module wrapper for pipe.decode() method

Source from the content-addressed store, hash-verified

498 }
499
500 class VAEDecoder(nn.Module):
501 """ Wrapper nn.Module wrapper for pipe.decode() method
502 """
503
504 def __init__(self):
505 super().__init__()
506 self.post_quant_conv = pipe.vae.post_quant_conv.to(dtype=torch.float32)
507 self.decoder = pipe.vae.decoder.to(dtype=torch.float32)
508
509 def forward(self, z):
510 return self.decoder(self.post_quant_conv(z))
511
512 baseline_decoder = VAEDecoder().eval()
513

Callers 1

convert_vae_decoderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected