stable-diffusion icon indicating copy to clipboard operation
stable-diffusion copied to clipboard

Inference Speed

Open blessedcoolant opened this issue 3 years ago • 2 comments

I wanted to compare the inference speeds to https://github.com/harubaru/waifu-diffusion/

I noticed that while the first inference is around the same speed, the waifu-diffusion repo infers the iterations that follow at a much faster speed than this one does.

I'm already using --skip_grid and --small_batch.

Any idea why that is the case and what we could change to get the same output?

Additionally what are the chances of being able to add weighted prompts like this repo does: https://github.com/lstein/stable-diffusion

blessedcoolant avatar Aug 23 '22 07:08 blessedcoolant

Hi, you can use a larger batch size to reduce the inference time per image. Although I am working on reducing the inference time further, it's not very straightforward. Hoping to see positive results in a day or two. Also, thank you for the idea of weighted prompts; I will add this feature as soon as possible.

basujindal avatar Aug 24 '22 12:08 basujindal

Hi, I have added an optional argument --turbo. Using it will reduce the inference time to 25 sec per image for txt2img and 15sec per image for img2img (excluding the time to load the model once) at the expense of around 1GB VRAM.

Although this is not the optimization I was taking earlier. That is still in the works.

basujindal avatar Aug 26 '22 19:08 basujindal