Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replicate #126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# The .dockerignore file excludes files from the container build process.
#
# https://docs.docker.com/engine/reference/builder/#dockerignore-file

# Exclude Git files
.git
.github
.gitignore

# Exclude Python cache files
__pycache__
.mypy_cache
.pytest_cache
.ruff_cache

# Exclude Python virtual environment
/venv
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -239,3 +239,9 @@ src/animatediff/_version.py
# envrc
.env*
!.envrc.example

# Cog
output.gif
output.mp4
nb.ipynb
.cog/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

[AnimateDiff](https://github.com/guoyww/AnimateDiff) with prompt travel + [ControlNet](https://github.com/lllyasviel/ControlNet) + [IP-Adapter](https://github.com/tencent-ailab/IP-Adapter)

[![Replicate](https://replicate.com/zsxkib/animatediff-prompt-travel/badge)](https://replicate.com/zsxkib/animatediff-prompt-travel)

I added a experimental feature to animatediff-cli to change the prompt in the middle of the frame.

It seems to work surprisingly well!
69 changes: 69 additions & 0 deletions cog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Configuration for Cog ⚙️
# Reference: https://github.com/replicate/cog/blob/main/docs/yaml.md

build:
# set to true if your model requires a GPU
gpu: true

# a list of ubuntu apt packages to install
system_packages:
- "libgl1-mesa-glx"
# - "libglib2.0-0"

# python version in the form '3.10'
python_version: "3.10"

# a list of packages in the format <package-name>==<version>
python_packages:
- "torch==2.0.1"
- "torchvision==0.15.2"
- "torchaudio==2.0.2"
- "accelerate>=0.20.3"
- "colorama>=0.4.3,<0.5.0"
- "cmake>=3.25.0"
- "diffusers==0.18.2"
- "einops>=0.6.1"
- "gdown>=4.6.6"
- "ninja>=1.11.0"
- "numpy>=1.22.4"
- "omegaconf>=2.3.0"
- "pillow>=9.4.0,<10.0.0"
- "pydantic>=1.10.0,<2.0.0"
- "rich>=13.0.0,<14.0.0"
- "safetensors>=0.3.1"
- "sentencepiece>=0.1.99"
- "shellingham>=1.5.0,<2.0.0"
- "torch>=2.0.0,<2.2.0"
- "torchaudio"
- "torchvision"
- "transformers>=4.30.2"
- "typer>=0.9.0,<1.0.0"
- "controlnet_aux"
- "matplotlib"
- "ffmpeg-python>=0.2.0"
- "black>=22.3.0"
- "ruff>=0.0.234"
- "setuptools-scm>=7.0.0"
- "pre-commit>=3.3.0"
- "ipython"
- "xformers>=0.0.21"
- "onnxruntime-gpu"
- "pandas"
- "segment-anything-hq==0.3"
- "groundingdino-py==0.4.0"
- "gitpython"
- "mediapipe"
- "xformers"
- "git+https://github.com/s9roll7/animatediff-cli-prompt-travel.git"
- "git+https://github.com/s9roll7/animatediff-cli-prompt-travel.git#egg=animatediff[stylize]"
- "git+https://github.com/s9roll7/animatediff-cli-prompt-travel.git#egg=animatediff[dwpose]"
- "git+https://github.com/s9roll7/animatediff-cli-prompt-travel.git#egg=animatediff[stylize_mask]"

run:
- pip install --upgrade pip
- apt-get update && apt-get install -y ffmpeg
- pip install imageio[ffmpeg]
- curl -o /usr/local/bin/pget -L "https://github.com/replicate/pget/releases/download/v0.0.3/pget" && chmod +x /usr/local/bin/pget

# predict.py defines how predictions are run on your model
predict: "predict.py:Predictor"
14 changes: 14 additions & 0 deletions cog_download_models.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

mkdir -p data/share/Stable-diffusion/

pget https://civitai.com/api/download/models/78775 data/share/Stable-diffusion/toonyou_beta3.safetensors || true
pget https://civitai.com/api/download/models/72396 data/share/Stable-diffusion/lyriel_v16.safetensors || true
pget https://civitai.com/api/download/models/71009 data/share/Stable-diffusion/rcnzCartoon3d_v10.safetensors || true
pget https://civitai.com/api/download/models/79068 data/share/Stable-diffusion/majicmixRealistic_v5Preview.safetensors || true
pget https://civitai.com/api/download/models/29460 data/share/Stable-diffusion/realisticVisionV40_v20Novae.safetensors || true

# Download Motion_Module models
wget -O data/models/motion-module/mm_sd_v14.ckpt https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v14.ckpt || true
wget -O data/models/motion-module/mm_sd_v15.ckpt https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v15.ckpt || true
wget -O data/models/motion-module/mm_sd_v15_v2.ckpt https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v15_v2.ckpt || true
Loading