Skip to content

fmk345/pythonProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Online Quantization for Comfyui

Install

  1. OneDiff Enterprise Installation Guide
  2. OneDiffx Installation Guide
  3. Before use, please confirm with python3 -m oneflow --doctor to confirm the argument enterprise: True. If the information displayed is as follows enterprise: True then it meets the requirements. If the information displayed is as follows enterprise: False, then run the following commandpip uninstall oneflow onediff_quant -y, and then follow the installation instructions for the Enterprise version to reinstall the OneDiff Enterprise version. You can find the relevant installation instructions through the following link: OneDiff Enterprise Installation Instructions

Usage:

Option Range Default Description
quantized_conv_percentage [0, 100] 100 Example value representing 100% quantization for linear layers
quantized_linear_percentage [0, 100] 100 Example value representing 100% quantization for convolutional layers
conv_compute_density_threshold [0, ∞) 100 Computational density threshold for quantizing convolutional modules to 100
linear_compute_density_threshold [0, ∞) 300 Computational density threshold for quantizing linear modules to 300

Notes:

  1. Specify the directory for saving graphs using export COMFYUI_ONEDIFF_SAVE_GRAPH_DIR="/path/to/save/graphs".
  2. The log *.pt file is cached. Quantization result information can be found in cache_dir/quantization_stats.json.

Performance Comparison

Accelerator Baseline (non-optimized) OneDiff(optimized) OneDiff Quant(optimized)
NVIDIA GeForce RTX 3090 5.63 s 3.38 s ( ~40.0%) 2.60 s ( ~53.8%)

The following table shows the workflows used separately:

Note that you can download all images in this page and then drag or load them on ComfyUI to get the workflow embedded in the image.

Examples

Baseline (non-optimized) OneDiff(optimized) OneDiff Quant(optimized)
image image image

Download the required model files

For NA/EU users
cd ComfyUI
wget -O models/checkpoints/sd_xl_base_1.0.safetensors https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors
For CN users
cd ComfyUI
wget -O models/checkpoints/sd_xl_base_1.0.safetensors https://hf-mirror.com/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors

Start ComfyUI

python main.py --gpu-only

SD1.5

Accelerator Baseline (non-optimized) OneDiff(optimized) OneDiff Quant(optimized)
NVIDIA GeForce RTX 3090 3.54 s 2.13 s ( ~39.8%) 1.85 s ( ~47.7%)

The following table shows the workflows used separately:

Note that you can download all images in this page and then drag or load them on ComfyUI to get the workflow embedded in the image.

Examples

Baseline (non-optimized) OneDiff(optimized) OneDiff Quant(optimized)
image image image

Download the required model files

For NA/EU users
cd ComfyUI
wget -O  models/v1-5-pruned-emaonly.ckpt  https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/v1-5-pruned-emaonly.ckpt
For CN users
cd ComfyUI
wget -O  models/v1-5-pruned-emaonly.ckpt  https://hf-mirror.com/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt

Start ComfyUI

python main.py --gpu-only

SVD

Accelerator Baseline (non-optimized) OneDiff(optimized) OneDiff Quant(optimized)
NVIDIA A800-SXM4-80GB 35.54 s 25.59 s (27.99 %) 22.30 s (37.25 %)

The following table shows the workflows used separately:

Note that you can download all images in this page and then drag or load them on ComfyUI to get the workflow embedded in the image.

Examples

Baseline (non-optimized) OneDiff(optimized) OneDiff Quant(optimized)
svd_baseline OneDiff(optimized) OneDiff Quant(optimized)

Download the required model files

For NA/EU users
cd ComfyUI
wget -O  models/checkpoints/sd_xl_base_1.0.safetensors https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors
wget -O  models/checkpoints/svd_xt_1_1.safetensors https://huggingface.co/vdo/stable-video-diffusion-img2vid-xt-1-1/resolve/main/svd_xt_1_1.safetensors
For CN users
cd ComfyUI
wget -O  models/checkpoints/sd_xl_base_1.0.safetensors https://hf-mirror.com/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors
wget -O  models/checkpoints/svd_xt_1_1.safetensors https://hf-mirror.com/vdo/stable-video-diffusion-img2vid-xt-1-1/resolve/main/svd_xt_1_1.safetensors

Start ComfyUI

python main.py --gpu-only

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages