continue-revolution / sd-webui-animatediff

AnimateDiff for AUTOMATIC1111 Stable Diffusion WebUI
Other
3.11k stars 258 forks source link

diffusers + comfyui are 5x faster? #482

Open josephrocca opened 7 months ago

josephrocca commented 7 months ago

It's very possible that I've done something terribly wrong here. I've tried to make sure it's super easy to reproduce - I've just re-tested the reproduction steps below from scratch to be 100% sure, and am still seeing the same result.

Reproduction steps:

Test official ByteDance Gradio demo speed (~5 it/s on 4090):

Run the docker command below, then open localhost:7860 and type a prompt:

docker run --rm -it -p 7860:7860 --platform=linux/amd64 --gpus all registry.hf.space/bytedance-animatediff-lightning:latest python app.py

image


Test ComfyUI demo speed (~5 it/s on 4090):

Run this docker command:

docker run --rm --gpus all -p 5000:5000 r8.im/camenduru/animatediff-lightning-4-step@sha256:be39c6d599942831314b770f03cfd062bfd0faa8cc52e9289bcce830b721fcb6

Then run this:

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d $'{
    "input": {
      "prompt": "A dog running around",
      "guidance_scale": 1
    }
  }' \
  http://localhost:5000/predictions

image


Test A1111 speed (~1 it/s on 4090):

docker run -p 7860:7860 -it --rm --gpus all pytorch/pytorch:2.2.1-cuda12.1-cudnn8-devel bash
apt update

# install a1111 (according to readme):
apt install wget git python3 python3-venv libgl1 libglib2.0-0 -y
wget -q https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
chmod +x ./webui.sh
./webui.sh -f --listen --xformers # wait for install, then exit

# install sd-webui-animatediff:
cd stable-diffusion-webui/extensions
git clone https://github.com/continue-revolution/sd-webui-animatediff
cd sd-webui-animatediff/model
wget -O "animatediff_lightning_4step_comfyui.safetensors" https://huggingface.co/ByteDance/AnimateDiff-Lightning/resolve/main/animatediff_lightning_4step_comfyui.safetensors?download=true

cd /workspace
./webui.sh -f --listen --xformers
# Leave everything default except:
#   Prompt = A dog running around
#   CFG Scale = 1
#   Sampling steps = 4
#   Sampling method = DPM++SDE
#   Enable AnimateDiff = checked
#   Number of frames = 16

image