We benchmarked SD v1.5 on 23 consumer GPUs - To generate 460,000 fancy QR codes.

The best performing GPU/backend combination delivered almost 20,000 images generated per dollar (512x512 resolution).

You can read the full benchmark here: https://blog.salad.com/stable-diffusion-v1-5-benchmark/

Some key observations:

  1. Do not use the GTX series GPUs for production stable diffusion inference. Absolute performance and cost performance are dismal in the GTX series, and in many cases the benchmark could not be fully completed, with jobs repeatedly running out of CUDA memory. Additionally, many images generated on these GPUs came out all black, instead of as fancy QR codes as desired.
  2. There are very few surprises for which GPU is fastest for each backend. Newer GPUs with higher model numbers are faster in nearly all situations.
  3. Batching saves time and money. In most situations, you can expect anywhere from 5-30% savings using batch size 4, vs batch size 1.
  4. Generation time scales close to linearly with number of pixels. a 768x768px image has 2.25x the pixels as a 512x512px image, and typically takes around 2x the time to generate.
  5. You can get surprisingly good cost performance out of the 20-series and 30-series RTX GPUs, regardless of the backend you choose.
  6. If you have a use-case that allows you to take advantage of the optimizations offered by Stable Fast, and the engineering availability to build and maintain an in-house solution, this is a great option that could save you a bunch of money while providing a fast and reliable image generation experience for your users.
  7. Many factors go into scannability for these stable diffusion QR codes, and consistently getting good results is no simple task. Shorter URLs lead to better results, as there is less data to encode. Using QR codes with lighter backgrounds leads to easier scanning, but less interesting images. Some prompts work much better than others, and some prompts can sustain much higher guidance than others. In addition, iOS and Android phones use different QR scanning implementations, so some codes scan fine on one platform but not the other.

Code and Docker Images

https://preview.redd.it/62axtxgkob3c1.png?width=1900&format=png&auto=webp&s=a26b147b6a705260cb3e82b4c831fc99024d47d2