MCPcopy Create free account
hub / github.com/Francis-Rings/FlashPortrait / sample

Method sample

wan/models/wan_vae.py:585–590  ·  view source on GitHub ↗
(self, imgs, deterministic=False)

Source from the content-addressed store, hash-verified

583 return eps * std + mu
584
585 def sample(self, imgs, deterministic=False):
586 mu, log_var = self.encode(imgs)
587 if deterministic:
588 return mu
589 std = torch.exp(0.5 * log_var.clamp(-30.0, 20.0))
590 return mu + std * torch.randn_like(std)
591
592 def clear_cache(self):
593 self._conv_num = count_conv3d(self.decoder)

Callers 3

_batch_encode_vaeFunction · 0.45
get_random_maskFunction · 0.45
get_random_maskFunction · 0.45

Calls 1

encodeMethod · 0.95

Tested by

no test coverage detected