The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Don't add tiny bit of random noise when VAE encoding. (#8705)
comfyanonymous9093301a49a9
diff --git a/comfy/ldm/models/autoencoder.py b/comfy/ldm/models/autoencoder.pyindex e6493155e..13bd6e16b 100644--- a/comfy/ldm/models/autoencoder.py+++ b/comfy/ldm/models/autoencoder.py@@ -11,7 +11,7 @@ from comfy.ldm.modules.ema import LitEmaimport comfy.opsclass DiagonalGaussianRegularizer(torch.nn.Module):- def __init__(self, sample: bool = True):+ def __init__(self, sample: bool = False):super().__init__()self.sample = sample@@ -19,16 +19,12 @@ class DiagonalGaussianRegularizer(torch.nn.Module):yield from ()def forward(self, z: torch.Tensor) -> Tuple[torch.Tensor, dict]:- log = dict()posterior = DiagonalGaussianDistribution(z)if self.sample:z = posterior.sample()else:z = posterior.mode()- kl_loss = posterior.kl()- kl_loss = torch.sum(kl_loss) / kl_loss.shape[0]- log["kl_loss"] = kl_loss- return z, log+ return z, Noneclass AbstractAutoencoder(torch.nn.Module):