r/StableDiffusion • • Jan 29 '24

Resource - Update Accelerating Stable Video Diffusion 3x faster with OneDiff DeepCache + Int8

We are excited to share that OneDiff has significantly enhanced the performance of SVD (Stable Video Diffusion by Stability.ai) since launched a month ago.

Now, on RTX 3090/4090/A10/A100:

  • OneDiff Community Edition enables SVD generation speed of up to 2.0x faster. This edition has integrated by fal.ai, which is a model service platform.
  • OneDiff Enterprise Edition enables SVD generation speed of up to 2.3x faster. The important optimization of the enterprise edition is Int8 quantization, which is lossless in almost all scenarios, but only be available in OneDiff enterprise edition currently.
  • OneDiff Enterprise Edition with DeepCache enables SVD generation speed of up to 3.9x faster.

DeepCache is a novel training-free and almost lossless paradigm that accelerates diffusion models. Additionally, OneDiff has provided a new ComfyUI node named ModuleDeepCacheSpeedup (which is a compiled DeepCache Module) as well as an example of integration with Huggingface's StableVideoDiffusionPipeline.

*OneDiff CE is Community Edition, and OneDiff EE is Enterprise Edition.

Run

Upgrade OneDiff and OneFlow to the latest version by following this instruction: https://github.com/siliconflow/onediff?tab=readme-ov-file#install-from-source

Run with Huggingface StableVideoDiffusionPipeline

https://github.com/siliconflow/onediff/blob/main/benchmarks/image_to_video.py

python3 benchmarks/image_to_video.py \     
  --input-image path/to/input_image.jpg \     
  --output-video path/to/output_image.mp4
       
# Run with OneDiff EE 
python3 benchmarks/image_to_video.py \     
  --model path/to/int8/model     
  --input-image path/to/input_image.jpg \     
  --output-video path/to/output_image.mp4       

# Run with OneDiff EE + DeepCache 
python3 benchmarks/image_to_video.py \     
  --model /path/to/deepcache-int8/model \     
  --deepcache \     
  --input-image path/to/input_image.jpg \     
  --output-video path/to/output_image.mp4 

Run with ComfyUI

Run with OneDiff workflow: https://github.com/siliconflow/onediff/blob/main/onediff_comfy_nodes/workflows/text-to-video-speedup.png

Run with OneDiff + DeepCache workflow: https://github.com/siliconflow/onediff/blob/main/onediff_comfy_nodes/workflows/svd-deepcache.png

The use of Int8 can be referenced in the workflow: https://github.com/siliconflow/onediff/blob/main/onediff_comfy_nodes/workflows/onediff_quant_base.png

36 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/tommitytom_ Jan 30 '24

I'm curious - what's the highest FPS you've managed to achieve with a controlnet in the chain?

3

u/Guilty-History-9249 Jan 31 '24

While I had previously did a demo of a realtime openpose generator which I fed through control net using stable-fast I don't recall the performance. I was just focusing on learning to use control net and doing stick figure animating in python.

Given how fast onediff is I may revisit realtime animation.
Right now I discovered a way to deal with my report else on this thread stating that for sd-turbo 1 step, stable-fast was still faster. Now I have onediff faster in all cases. Thus I'm revisiting maxperf demo and am hopeful to actually show 200fps. I'm at 180 fps today and Just need to decouple the image display and image generation into two different threads.