latent_formats.py 377 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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