Skip to content

Latest commit

 

History

History
 
 

271-sdxl-turbo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Single-step image generation using SDXL-turbo and OpenVINO

SDXL-Turbo is a fast generative text-to-image model that can synthesize photorealistic images from a text prompt in a single network evaluation. SDXL-Turbo is a distilled version of SDXL 1.0, trained for real-time synthesis. SDXL Turbo is based on a novel distillation technique called Adversarial Diffusion Distillation (ADD), which enables the model to synthesize image outputs in a single step and generate real-time text-to-image outputs while maintaining high sampling fidelity. More details about this distillation approach can be found in technical report. More details about model can be found in Stability AI blog post.

Previously, we already discussed how to launch Stable Diffusion XL model using OpenVINO in the following notebook, in this tutorial we will focus on the SDXL-turbo version. Additionally, to improve image decoding speed, we will use Tiny Autoencoder, which is useful for real-time previewing of the SDXL generation process.

We will use a pre-trained model from the Hugging Face Diffusers library. To simplify the user experience, the Hugging Face Optimum Intel library is used to convert the models to OpenVINO™ IR format.

The notebook provides a simple interface that allows communication with a model using text instruction. In this demonstration user can provide input instructions and the model generates an image. An additional part demonstrates how to run quantization with NNCF to speed up pipeline.

The image below illustrates the provided generated image example.

text2img_example.png

Note: Some demonstrated models can require at least 32GB RAM for conversion and running.

Notebook Contents

The tutorial consists of the following steps:

  • Install prerequisites
  • Convert model to OpenVINO intermediate representation (IR) format
  • Run Text-to-Image generation
  • Run Image-to-Image generation
  • Optimize model with NNCF quantization
  • Compare results of original and optimized pipelines
  • Launch interactive demo

Installation Instructions

This is a self-contained example that relies solely on its own code.
We recommend running the notebook in a virtual environment. You only need a Jupyter server to start. For details, please refer to Installation Guide.