Last active
January 20, 2024 16:40
-
-
Save socertis/3553737f3bf11dc571b29a5c867679b2 to your computer and use it in GitHub Desktop.
AnimateDiff Povisioning Script that support AD v3 for Ai-Dock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/false | |
# This file will be sourced in init.sh | |
# https://raw.githubusercontent.com/ai-dock/comfyui/main/config/provisioning/animated.sh | |
printf "\n##############################################\n# #\n# Provisioning container #\n# #\n# This will take some time #\n# #\n# Your container will be ready on completion #\n# #\n##############################################\n\n" | |
## Set paths | |
## main paths | |
nodes_dir=/opt/ComfyUI/custom_nodes | |
models_dir=/opt/ComfyUI/models | |
## internal paths | |
checkpoints_dir=${models_dir}/checkpoints | |
vae_dir=${models_dir}/vae | |
controlnet_dir=${models_dir}/controlnet | |
loras_dir=${models_dir}/loras | |
upscale_dir=${models_dir}/upscale_models | |
### Install custom nodes | |
desired_nodes=( | |
"https://github.com/ltdrdata/ComfyUI-Manager" | |
"https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved" | |
"https://github.com/Kosinkadink/ComfyUI-Advanced-ControlNet" | |
"https://github.com/ltdrdata/ComfyUI-Impact-Pack" | |
"https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite" | |
"https://github.com/FizzleDorf/ComfyUI_FizzNodes" | |
"https://github.com/crystian/ComfyUI-Crystools" | |
"https://github.com/Fannovel16/comfyui_controlnet_aux" | |
"https://github.com/kijai/ComfyUI-Marigold" | |
"https://github.com/FizzleDorf/ComfyUI-AIT" | |
"https://github.com/space-nuko/ComfyUI-OpenPose-Editor" | |
) | |
animated_diff_checkpoints=( | |
#v2 | |
"https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v15.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/mm_sd_v15_v2.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/mm_sdxl_v10_beta.ckpt" | |
#v3 | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v3_sd15_mm.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v3_sd15_sparsectrl_rgb.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v3_sd15_sparsectrl_scribble.ckpt" | |
#sdxl | |
"https://huggingface.co/guoyww/animatediff/resolve/main/mm_sdxl_v10_beta.ckpt" | |
) | |
civitai_checkpoints=( | |
#sd1.5 | |
"https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt" | |
#epicReaslimNaturalSin | |
"https://civitai.com/api/download/models/160989" | |
#epicReaslimPureEvolution | |
"https://civitai.com/api/download/models/134065" | |
#epicReaslimPureEvolution Inpainting | |
"https://civitai.com/api/download/models/134361" | |
#epicRealism New Era | |
"https://civitai.com/api/download/models/67990" | |
) | |
## animatediff | |
animated_diff_loras=( | |
# v3_sd15_adapter.ckpt | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v3_sd15_adapter.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_PanLeft.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_PanRight.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_TiltUp.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_TiltDown.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_RollingAnticlockwise.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_RollingClockwise.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_ZoomIn.ckpt" | |
"https://huggingface.co/guoyww/animatediff/resolve/main/v2_lora_ZoomOut.ckpt" | |
) | |
desired_loras=( | |
) | |
desired_controlnets=( | |
"https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_canny-fp16.safetensors" | |
) | |
## download animated checkpoints | |
function download_animated_ckpts() { | |
wget -q --content-disposition --show-progress -e dotbytes="${3:-4M}" -O "$2" "$1" | |
} | |
## download checkpoints | |
function download_civit_ckpts() { | |
echo "downloading from $1" | |
wget -q --content-disposition --show-progress -e dotbytes="${3:-4M}" -P "$2" "$1" | |
} | |
## download nodes | |
function download_node(){ | |
node_name=$(echo "$1" | awk -F/ '{print $NF}') | |
echo "downloading Node $node_name.........\n" | |
this_node_dir="${nodes_dir}/${node_name}" | |
if [[ ! -d $this_node_dir ]]; then | |
git clone "$1" "$this_node_dir" | |
else | |
(cd "$this_node_dir" && git pull) | |
fi | |
} | |
for node in "${desired_nodes[@]}"; do | |
download_node "$node" | |
done | |
for ckpt in "${civitai_checkpoints[@]}"; do | |
download_civit_ckpts "$ckpt" "${checkpoints_dir}" | |
done | |
for animated_ckpt in "${animated_diff_checkpoints[@]}"; do | |
ckpt_name=$(echo "$animated_ckpt" | awk -F/ '{print $NF}') | |
echo "downloading $animated_ckpt........." | |
download_animated_ckpts "$animated_ckpt" "${nodes_dir}/ComfyUI-AnimateDiff-Evolved/models/${ckpt_name}" | |
done | |
for lora in "${animated_diff_loras[@]}"; do | |
lora_name=$(echo "$lora" | awk -F/ '{print $NF}') | |
echo "downloading $lora........." | |
download_animated_ckpts "$lora" "${loras_dir}/${lora_name}" | |
done | |
for cnet in "${desired_controlnets[@]}"; do | |
cnet_name=$(echo "$cnet" | awk -F/ '{print $NF}') | |
echo "downloading $cnet........." | |
download_animated_ckpts "$cnet" "${controlnet_dir}/${cnet_name}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment