This file contains 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 torch | |
import numpy as np | |
import k_diffusion as K | |
from PIL import Image | |
from torch import autocast | |
from einops import rearrange, repeat | |
def pil_img_to_torch(pil_img, half=False): | |
image = np.array(pil_img).astype(np.float32) / 255.0 |