Member-only story

Introduction to Stable Diffusion Latent Upscaler

Ng Wai Foong
4 min readFeb 21, 2023

Upscale generated images by 2x natively

Image by the author

The topic for today is about a latent diffusion-based upscaler model to upscale Stable Diffusion generated images by 2x natively. The model was trained by Katherine Crowson in collaboration with Stability AI.

As of version 0.13.0, the diffusers package officially supports the stabilityai/sd-x2-latent-upscaler model under the StableDiffusionLatentUpscalePipeline class.

One main advantage of this pipeline is that you can use the latent output from any StableDiffusionPipeline and pass it as input to the upscaler before decoding it with the desired VAE.

Alternatively, you can encode an existing image to latent space before passing it to the upscaler and decode the output with any VAE.

Let’s proceed to the next section to install all the necessary modules.

Setup

Before that, it is highly recommended to create a new virtual environment.

diffusers

Activate the virtual environment and install the standard diffusers package via the following command:

pip install diffusers

Alternatively, install the latest diffusers package as follows:

--

--

Ng Wai Foong
Ng Wai Foong

Written by Ng Wai Foong

Senior AI Engineer@Yoozoo | Content Writer #NLP #datascience #programming #machinelearning | Linkedin: https://www.linkedin.com/in/wai-foong-ng-694619185/

Responses (2)