Skip to content

Instantly share code, notes, and snippets.

@saftle
saftle / replace_vae.py
Last active January 21, 2023 10:00 — forked from ProGamerGov/replace_vae.py
Fixed script to work with models that were merged with Automatic1111, and included the numpy dependency which the script uses.
# Script by https://github.com/ProGamerGov
import copy
import torch
import numpy as np
# Path to model and VAE files that you want to merge
vae_file_path = "vae-ft-mse-840000-ema-pruned.ckpt"
model_file_path = "v1-5-pruned-emaonly.ckpt"
# Name to use for new model file