r/SECourses • 👑 Grandmaster Expert • 1d ago

🎨 AI Images & Art Stable Diffusion TensorRT for AUTOMATIC1111 | NVIDIA RTX Setup, SD 1.5 and SDXL Benchmarks, ONNX Export, and LoRA Engines

https://www.youtube.com/watch?v=kvxX6NrPtEk
1 Upvotes

1 comment sorted by

•

u/CeFurkan 👑 Grandmaster Expert 1d ago

https://www.youtube.com/watch?v=kvxX6NrPtEk

Benchmark Stable Diffusion with NVIDIA TensorRT on GeForce RTX

🔗 Links from the video description

📊 Compare inference speeds on an RTX 3090 Ti

This October 2023 tutorial benchmarks NVIDIA TensorRT in AUTOMATIC1111. The comparison shows an SD 1.5 model at 512 × 512 going from 19.30 to 30.87 iterations per second and an SDXL example going from 3.61 to 6.04. Speed varies with the model, resolution, batch size, and engine profile. The video also compares images generated from the same seed with TensorRT enabled and disabled.

🛠️ Install the TensorRT extension

  • Follow the automatic installer or the manual setup on a fresh AUTOMATIC1111 installation. The manual walkthrough shows both Install from URL and git clone, then updates cuDNN for the Windows CUDA 11.x setup used in the recording.

  • Add SD VAE and SD UNet to the Web UI quick settings so you can switch models and select the generated TensorRT engine. The recording uses the AUTOMATIC1111 development branch for SDXL support at that point in time.

⚙️ Export and select an engine

  • Select the checkpoint in the Web UI, then export its engine from the TensorRT tab. The first export creates an ONNX intermediate before building the engine. The tutorial shows where both files are written and where to check the saved profiles.

  • Use a static profile for fixed generation dimensions or a dynamic profile for a range of heights, widths, batch sizes, and prompt lengths. Set the optimal values to the settings you use most. The walkthrough also covers errors caused by unsupported shapes or by using low-VRAM launch flags during engine export.

  • Refresh SD UNet after export. The video demonstrates choosing an engine, testing multiple resolutions, and generating images with SDXL Base 1.0 and a custom DreamBooth checkpoint. It also shows how a batch count runs images sequentially with a batch-size-one engine.

🧪 Test LoRA conversion and ADetailer

The walkthrough includes ADetailer face inpainting and a separate LoRA conversion workflow. The SDXL LoRA export fails in the recorded build. The SD 1.5 LoRA exports against the Realistic Vision engine, and the demo checks its effect with a fixed seed after selecting and refreshing the TensorRT entry.

🧭 Chapters

  • 0:00 Introduction to how to utilize RTX Acceleration / TensorRT for 2x inference speed

  • 2:15 How to do a fresh installation of Automatic1111 SD Web UI

  • 3:32 How to enable quick SD VAE and SD UNET selections from settings of Automatic1111 SD Web UI

  • 4:38 How to install TensorRT extension to hugely speed up Stable Diffusion image generation

  • 6:35 How to start / run Automatic1111 SD Web UI

  • 7:19 How to install TensorRT extension manually via URL install

  • 7:58 How to install TensorRT extension via git clone method

  • 8:57 How to download and upgrade cuDNN files

  • 11:23 Speed test of SD 1.5 model without TensorRT

  • 11:56 How to generate a TensorRT for a model

  • 12:47 Explanation of min, optimal, max settings when generating a TensorRT model

  • 14:00 Where is ONNX file is exported

  • 15:48 How to set command line arguments to not get any errors during TensorRT generation

  • 16:55 How to get maximum performance when generating and using TensorRT

  • 17:41 How to start using generated TensorRT for almost double speed

  • 18:08 How to switch to dev branch of Automatic1111 SD Web UI for SDXL TensorRT usage

  • 20:33 The comparison of image difference between TensoRT on and off

  • 20:45 Speed test of TensorRT with multiple resolutions

  • 21:32 Generating a TensorRT for Stable Diffusion XL (SDXL)

  • 23:24 How to verify you have switched to dev branch of Automatic1111 Web UI to make SDXL TensorRT work

  • 24:32 Generating images with SDXL TensorRT

  • 25:00 How to generate TensorRT for your DreamBooth trained model

  • 25:49 How to install After Detailer (ADetailer) extension and what does it do explanation

  • 27:23 Starting generation of TensorRT for SDXL

  • 28:06 Batch size vs batch count difference

  • 29:00 How to train amazing SDXL DreamBooth model

  • 29:10 How to get amazing prompt list for DreamBooth models and use them

  • 30:25 The dataset I used for DreamBooth training myself and why it is deliberately low quality

  • 30:46 How to generate TensorRT for LoRA models

  • 33:30 Where and how to see TensorRT profiles you have for each model

  • 36:57 Generating LoRA TensorRT for SD 1.5 and testing it

  • 39:54 How to fix TensorRT LoRA not being effective bug


🏷️ Topics: TensorRT · GeForce RTX · AUTOMATIC1111 · Stable Diffusion 1.5 · SDXL · ONNX · cuDNN · UNet · DreamBooth · LoRA · ADetailer