MCPcopy Index your code
hub / github.com/FireRedTeam/LayerDiffuse-Flux / dist_sample_deterministic

Function dist_sample_deterministic

lib_layerdiffuse/vae.py:229–232  ·  view source on GitHub ↗
(dist: DiagonalGaussianDistribution, perturbation: torch.Tensor)

Source from the content-addressed store, hash-verified

227
228
229def dist_sample_deterministic(dist: DiagonalGaussianDistribution, perturbation: torch.Tensor):
230 # Modified from diffusers.models.autoencoders.vae.DiagonalGaussianDistribution.sample()
231 x = dist.mean + dist.std * perturbation.to(dist.std)
232 return x
233
234class TransparentVAE(torch.nn.Module):
235 def __init__(self, sd_vae, dtype=torch.float16, encoder_file=None, decoder_file=None, alpha=300.0, latent_c=16, *args, **kwargs):

Callers 2

encodeMethod · 0.85
forwardMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected