Downloads · 30 days
111
4% of all-time downloads
madebyollin/taesd-x4-upscaler
taesd-x4-upscaler is a machine learning model from madebyollin. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for diffusers. The card lists the license as mit.
taesd-x4-upscaler is very tiny autoencoder which uses the same "latent API" as stable-diffusion-x4-upscaler's VAE. taesd-x4-upscaler is useful for real-time previewing of the upsampling process.
Downloads · 30 days
111
4% of all-time downloads
All-time downloads
3.1K
Public
Parameters
1.7M
20.5 MB on disk
Likes
5
Public
Click a slice to open those files.
.safetensors13.7 MB · 67%
From the Hugging Face model README
taesd-x4-upscaler is very tiny autoencoder which uses the same "latent API" as stable-diffusion-x4-upscaler's VAE.
taesd-x4-upscaler is useful for real-time previewing of the upsampling process.
This repo contains .safetensors versions of the taesd-x4-upscaler weights.
import requests
from PIL import Image
from io import BytesIO
url = "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd2-upscale/low_res_cat.png"
low_res_img = Image.open(BytesIO(requests.get(url).content)).convert("RGB").resize((128, 128))
import torch
from diffusers import StableDiffusionUpscalePipeline, AutoencoderTiny
pipe = StableDiffusionUpscalePipeline.from_pretrained("stabilityai/stable-diffusion-x4-upscaler", torch_dtype=torch.float16)
pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taesd-x4-upscaler", torch_dtype=torch.float16)
pipe = pipe.to("cuda")
image = pipe("a white cat", image=low_res_img, num_inference_steps=25).images[0]
image.save("upsampled.png")