MCPcopy Create free account
hub / github.com/FireRedTeam/LayerDiffuse-Flux / decode

Method decode

lib_layerdiffuse/vae.py:267–278  ·  view source on GitHub ↗
(self, latent, aug=True)

Source from the content-addressed store, hash-verified

265 return self.sd_vae.decode(latent)
266
267 def decode(self, latent, aug=True):
268 origin_pixel = self.sd_vae.decode(latent).sample
269 origin_pixel = (origin_pixel * 0.5 + 0.5)
270 if not aug:
271 y = self.decoder(origin_pixel.to(self.dtype), latent.to(self.dtype))
272 return origin_pixel, y
273 list_y = []
274 for i in range(int(latent.shape[0])):
275 y = self.estimate_augmented(origin_pixel[i:i + 1].to(self.dtype), latent[i:i + 1].to(self.dtype))
276 list_y.append(y)
277 y = torch.concat(list_y, dim=0)
278 return origin_pixel, y
279
280 def encode(self, img_rgba, img_rgb, padded_img_rgb, use_offset=True):
281 a_bchw_01 = img_rgba[:, 3:, :, :]

Callers 6

forwardMethod · 0.95
generate_imgFunction · 0.80
generate_imgFunction · 0.80
__call__Method · 0.80
sd_decodeMethod · 0.80
forwardMethod · 0.80

Calls 1

estimate_augmentedMethod · 0.95

Tested by

no test coverage detected