Remove v2 latent code

v1 and v2 are compatible
This commit is contained in:
City
2023-07-31 00:44:30 +02:00
parent 8088cd1f7f
commit 94ff9e4780
2 changed files with 1 additions and 3 deletions
+1 -1
View File
@@ -47,5 +47,5 @@ def run_xl(file_path=None):
if __name__ == "__main__":
# run_v1("./vae/ft-mse-840000.ckpt") # probably doesn't reflect internal SD latent
run_v1()
run_v2()
# run_v2() # v2 and v1 share a latent space
run_xl("./vae/sdxl_v0.9.safetensors") # 1.0 has artifacts
-2
View File
@@ -20,11 +20,9 @@ latent_dst = "xl"
class Latent:
def __init__(self, md5, lat_src, lat_dst, dev):
if lat_src == "v1": src = os.path.join("latent_v1", f"{md5}.npy")
if lat_src == "v2": src = os.path.join("latent_v2", f"{md5}.npy")
if lat_src == "xl": src = os.path.join("latent_xl", f"{md5}.npy")
if lat_dst == "v1": dst = os.path.join("latent_v1", f"{md5}.npy")
if lat_dst == "v2": dst = os.path.join("latent_v2", f"{md5}.npy")
if lat_dst == "xl": dst = os.path.join("latent_xl", f"{md5}.npy")
self.src = torch.from_numpy(np.load(src)).to(dev)