stabilityai / stable-diffusion-3-medium-tensorrt

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: Juni 12 2024
text-to-image

Introduction of stable-diffusion-3-medium-tensorrt

Model Details of stable-diffusion-3-medium-tensorrt

Stable Diffusion 3 Medium TensorRT

Introduction

This repository hosts the TensorRT version of Stable Diffusion 3 Medium created in collaboration with NVIDIA . The optimized versions give substantial improvements in speed and efficiency.

Stable Diffusion 3 Medium is a fast generative text-to-image model with greatly improved performance in multi-subject prompts, image quality, and spelling abilities.

Model Details
Model Description

Stable Diffusion 3 Medium combines a diffusion transformer architecture and flow matching.

  • Developed by: Stability AI
  • Model type: MMDiT text-to-image model
  • Model Description: This is a conversion of the Stable Diffusion 3 Medium model
Performance using TensorRT 10.1
Timings for 50 steps at 1024x1024
Accelerator CLIP-G CLIP-L T5XXL MMDiT VAE Decoder Total
A100 11.95 ms 5.04 ms 21.39 ms 5468.17 ms 72.25 ms 5622.47 ms
Timings for 30 steps at 1024x1024 with input image conditioning
Accelerator VAE Encoder CLIP-G CLIP-L T5XXL MMDiT VAE Decoder Total
A100 37.04 ms 12.07 ms 5.07 ms 21.49 ms 3340.69 ms 72.02 ms 3531.49 ms
Int8 quantization with TensorRT Model Optimizer

The MMDiT in Stable Diffusion 3 Medium can be further optimized with INT8 quantization using TensorRT Model Optimizer. The estimated end-to-end speedup comparing TensorRT fp16 and TensorRT int8 is 1.2x~1.4x on various NVidia GPUs. The memory saving is about 2x for the int8 MMDiT engine compared with the fp16 counterpart. The image quality can be maintained with minimal to negligible degradation.

Usage Example
  1. Follow the setup instructions on launching a TensorRT NGC container.
git clone https://github.com/NVIDIA/TensorRT.git
cd TensorRT
git checkout release/sd3
docker run --rm -it --gpus all -v $PWD:/workspace nvcr.io/nvidia/pytorch:24.05-py3 /bin/bash
  1. Download the Stable Diffusion 3 Medium TensorRT files from this repo
git lfs install 
git clone https://huggingface.co/stabilityai/stable-diffusion-3-medium-tensorrt
cd stable-diffusion-3-medium-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-cu12
  1. Perform TensorRT optimized inference:
  • Stable Diffusion 3 Medium

    Works best for 1024x1024 images. 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_sd3.py \
      "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" \
      --version=sd3 \
      --onnx-dir /workspace/stable-diffusion-3-medium-tensorrt/ \
      --engine-dir /workspace/stable-diffusion-3-medium-tensorrt/engine \
      --seed 42 \
      --width 1024 \
      --height 1024 \
      --build-static-batch \
      --use-cuda-graph
    
  • Stable Diffusion 3 Medium with input image conditioning

    Provide an input image conditioning using below. Works best for 1024x1024 but may also work at 512x512.

    wget https://raw.githubusercontent.com/CompVis/latent-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png -O dog-on-bench.png
    
    python3 demo_txt2img_sd3.py \
      "dog wearing a sweater and a blue collar" \
      --version=sd3 \
      --onnx-dir /workspace/stable-diffusion-3-medium-tensorrt/ \
      --engine-dir /workspace/stable-diffusion-3-medium-tensorrt/engine \
      --seed 42 \
      --width 1024 \
      --height 1024 \
      --input-image dog-on-bench.png \
      --build-static-batch \
      --use-cuda-graph
    

Runs of stabilityai stable-diffusion-3-medium-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-3-medium-tensorrt huggingface.co Model

More stable-diffusion-3-medium-tensorrt license Visit here:

https://choosealicense.com/licenses/stabilityai-nc-research-community

stable-diffusion-3-medium-tensorrt huggingface.co

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

stable-diffusion-3-medium-tensorrt huggingface.co Url

https://huggingface.co/stabilityai/stable-diffusion-3-medium-tensorrt

stabilityai stable-diffusion-3-medium-tensorrt online free

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

stabilityai stable-diffusion-3-medium-tensorrt online free url in huggingface.co:

https://huggingface.co/stabilityai/stable-diffusion-3-medium-tensorrt

stable-diffusion-3-medium-tensorrt install

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

stable-diffusion-3-medium-tensorrt install url in huggingface.co:

https://huggingface.co/stabilityai/stable-diffusion-3-medium-tensorrt

Url of stable-diffusion-3-medium-tensorrt

stable-diffusion-3-medium-tensorrt huggingface.co Url

Provider of stable-diffusion-3-medium-tensorrt huggingface.co

stabilityai
ORGANIZATIONS

Other API from stabilityai

huggingface.co

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

Total runs: 137.2K
Run Growth: 16.4K
Growth Rate: 11.93%
Updated: Juli 10 2024
huggingface.co

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

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

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

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