stabilityai / stable-diffusion-xl-1.0-tensorrt

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: December 29 2023
text-to-image

Introduction of stable-diffusion-xl-1.0-tensorrt

Model Details of stable-diffusion-xl-1.0-tensorrt

Stable Diffusion XL 1.0 TensorRT

Introduction

This repository hosts the TensorRT versions(sdxl, sdxl-lcm, sdxl-lcmlora) of Stable Diffusion XL 1.0 created in collaboration with NVIDIA . The optimized versions give substantial improvements in speed and efficiency.

See the usage instructions for how to run the SDXL pipeline with the ONNX files hosted in this repository.

examples

Model Description
Performance Comparison
Timings for 30 steps at 1024x1024
Accelerator Baseline (non-optimized) NVIDIA TensorRT (optimized) Percentage improvement
A10 9399 ms 8160 ms ~13%
A100 3704 ms 2742 ms ~26%
H100 2496 ms 1471 ms ~41%
Image throughput for 30 steps at 1024x1024
Accelerator Baseline (non-optimized) NVIDIA TensorRT (optimized) Percentage improvement
A10 0.10 images/sec 0.12 images/sec ~20%
A100 0.27 images/sec 0.36 images/sec ~33%
H100 0.40 images/sec 0.68 images/sec ~70%
Timings for Latent Consistency Model(LCM) version for 4 steps at 1024x1024
Accelerator CLIP Unet VAE Total
A100 1.08 ms 192.02 ms 228.34 ms 426.16 ms
H100 0.78 ms 102.8 ms 126.95 ms 234.22 ms
Usage Example
  1. Following the setup instructions on launching a TensorRT NGC container.
git clone https://github.com/rajeevsrao/TensorRT.git
cd TensorRT
git checkout release/9.2
docker run --rm -it --gpus all -v $PWD:/workspace nvcr.io/nvidia/pytorch:23.11-py3 /bin/bash
  1. Download the SDXL TensorRT files from this repo
git lfs install 
git clone https://huggingface.co/stabilityai/stable-diffusion-xl-1.0-tensorrt
cd stable-diffusion-xl-1.0-tensorrt
git lfs pull
cd ..
  1. Install libraries and requirements
cd demo/Diffusion
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
python3 -m pip install --pre --upgrade --extra-index-url https://pypi.nvidia.com tensorrt
  1. Perform TensorRT optimized inference:
  • SDXL

    The first invocation produces plan files in engine_xl_base and engine_xl_refiner specific to the accelerator being run on and are reused for later invocations.

    python3 demo_txt2img_xl.py \
      "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" \
      --build-static-batch \
      --use-cuda-graph \
      --num-warmup-runs 1 \
      --width 1024 \
      --height 1024 \
      --denoising-steps 30 \
      --onnx-base-dir /workspace/stable-diffusion-xl-1.0-tensorrt/sdxl-1.0-base \
      --onnx-refiner-dir /workspace/stable-diffusion-xl-1.0-tensorrt/sdxl-1.0-refiner
    
  • SDXL-LCM

    The first invocation produces plan files in --engine-dir specific to the accelerator being run on and are reused for later invocations.

    python3 demo_txt2img_xl.py \
      ""Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"" \
      --version=xl-1.0 \
      --onnx-dir /workspace/stable-diffusion-xl-1.0-tensorrt/lcm \
      --engine-dir /workspace/stable-diffusion-xl-1.0-tensorrt/lcm/engine-sdxl-lcm-nocfg \
      --scheduler LCM \
      --denoising-steps 4 \
      --guidance-scale 0.0 \
      --seed 42
    
  • SDXL-LCMLORA

    The first invocation produces plan files in --engine-dir specific to the accelerator being run on and are reused for later invocations.

    python3 demo_txt2img_xl.py \
      ""Astronaut in a jungle, cold color palette, muted colors, detailed, 8k"" \
      --version=xl-1.0 \
      --onnx-dir /workspace/stable-diffusion-xl-1.0-tensorrt/lcmlora \
      --engine-dir /workspace/stable-diffusion-xl-1.0-tensorrt/lcm/engine-sdxl-lcmlora-nocfg \
      --scheduler LCM \
      --lora-path latent-consistency/lcm-lora-sdxl \
      --lora-scale 1.0 \
      --denoising-steps 4 \
      --guidance-scale 0.0 \
      --seed 42
    

Runs of stabilityai stable-diffusion-xl-1.0-tensorrt on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About stable-diffusion-xl-1.0-tensorrt huggingface.co Model

More stable-diffusion-xl-1.0-tensorrt license Visit here:

https://choosealicense.com/licenses/openrail++

stable-diffusion-xl-1.0-tensorrt huggingface.co

stable-diffusion-xl-1.0-tensorrt huggingface.co is an AI model on huggingface.co that provides stable-diffusion-xl-1.0-tensorrt's model effect (), which can be used instantly with this stabilityai stable-diffusion-xl-1.0-tensorrt model. huggingface.co supports a free trial of the stable-diffusion-xl-1.0-tensorrt model, and also provides paid use of the stable-diffusion-xl-1.0-tensorrt. Support call stable-diffusion-xl-1.0-tensorrt model through api, including Node.js, Python, http.

stable-diffusion-xl-1.0-tensorrt huggingface.co Url

https://huggingface.co/stabilityai/stable-diffusion-xl-1.0-tensorrt

stabilityai stable-diffusion-xl-1.0-tensorrt online free

stable-diffusion-xl-1.0-tensorrt huggingface.co is an online trial and call api platform, which integrates stable-diffusion-xl-1.0-tensorrt's modeling effects, including api services, and provides a free online trial of stable-diffusion-xl-1.0-tensorrt, you can try stable-diffusion-xl-1.0-tensorrt online for free by clicking the link below.

stabilityai stable-diffusion-xl-1.0-tensorrt online free url in huggingface.co:

https://huggingface.co/stabilityai/stable-diffusion-xl-1.0-tensorrt

stable-diffusion-xl-1.0-tensorrt install

stable-diffusion-xl-1.0-tensorrt is an open source model from GitHub that offers a free installation service, and any user can find stable-diffusion-xl-1.0-tensorrt on GitHub to install. At the same time, huggingface.co provides the effect of stable-diffusion-xl-1.0-tensorrt install, users can directly use stable-diffusion-xl-1.0-tensorrt installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

stable-diffusion-xl-1.0-tensorrt install url in huggingface.co:

https://huggingface.co/stabilityai/stable-diffusion-xl-1.0-tensorrt

Url of stable-diffusion-xl-1.0-tensorrt

stable-diffusion-xl-1.0-tensorrt huggingface.co Url

Provider of stable-diffusion-xl-1.0-tensorrt huggingface.co

stabilityai
ORGANIZATIONS

Other API from stabilityai

huggingface.co

Total runs: 417.3K
Run Growth: -63.8K
Growth Rate: -15.97%
Updated: July 10 2024
huggingface.co

Total runs: 143.2K
Run Growth: 7.6K
Growth Rate: 5.33%
Updated: August 04 2023
huggingface.co

Total runs: 137.2K
Run Growth: 23.3K
Growth Rate: 16.83%
Updated: July 10 2024
huggingface.co

Total runs: 34.3K
Run Growth: 3.5K
Growth Rate: 10.14%
Updated: August 09 2024
huggingface.co

Total runs: 378
Run Growth: -98.0K
Growth Rate: -25246.65%
Updated: August 03 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: July 10 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated: April 14 2024