Remove v2 latent code
v1 and v2 are compatible
This commit is contained in:
@@ -47,5 +47,5 @@ def run_xl(file_path=None):
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# run_v1("./vae/ft-mse-840000.ckpt") # probably doesn't reflect internal SD latent
|
# run_v1("./vae/ft-mse-840000.ckpt") # probably doesn't reflect internal SD latent
|
||||||
run_v1()
|
run_v1()
|
||||||
run_v2()
|
# run_v2() # v2 and v1 share a latent space
|
||||||
run_xl("./vae/sdxl_v0.9.safetensors") # 1.0 has artifacts
|
run_xl("./vae/sdxl_v0.9.safetensors") # 1.0 has artifacts
|
||||||
|
|||||||
@@ -20,11 +20,9 @@ latent_dst = "xl"
|
|||||||
class Latent:
|
class Latent:
|
||||||
def __init__(self, md5, lat_src, lat_dst, dev):
|
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 == "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_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 == "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")
|
if lat_dst == "xl": dst = os.path.join("latent_xl", f"{md5}.npy")
|
||||||
|
|
||||||
self.src = torch.from_numpy(np.load(src)).to(dev)
|
self.src = torch.from_numpy(np.load(src)).to(dev)
|
||||||
|
|||||||
Reference in New Issue
Block a user