This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script by https://github.com/ProGamerGov | |
import copy | |
import torch | |
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from PIL import Image | |
def convert_webp_to_png(directory: str, delete_old_webp_images: bool = False): | |
for root, dirs, files in os.walk(directory): | |
for file in files: | |
if file.endswith(".webp"): | |
filepath = os.path.join(root, file) | |
img = Image.open(filepath) | |
new_filepath = os.path.splitext(filepath)[0] + ".png" |
OlderNewer