Move latent scale factor from VAE to model.

This commit is contained in:
comfyanonymous
2023-06-23 02:14:12 -04:00
parent 30a3861946
commit 8607c2d42d
7 changed files with 73 additions and 33 deletions

16
comfy/latent_formats.py Normal file
View File

@@ -0,0 +1,16 @@
class LatentFormat:
def process_in(self, latent):
return latent * self.scale_factor
def process_out(self, latent):
return latent / self.scale_factor
class SD15(LatentFormat):
def __init__(self, scale_factor=0.18215):
self.scale_factor = scale_factor
class SDXL(LatentFormat):
def __init__(self):
self.scale_factor = 0.13025