Skip to content

Commit

Permalink
Ensure CLIP models are downloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
robballantyne committed Aug 6, 2024
1 parent d2cf98c commit 52ef945
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions config/provisioning/flux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# Packages are installed after nodes so we can fix them...

DEFAULT_WORKFLOW="https://raw.githubusercontent.com/ai-dock/comfyui/main/config/workflows/flux-comfyui-example.json"

APT_PACKAGES=(
#"package-1"
#"package-2"
Expand Down Expand Up @@ -34,11 +36,6 @@ UNET_MODELS=(
VAE_MODELS=(
)

workflow_json=$(curl -s https://raw.githubusercontent.com/ai-dock/comfyui/main/config/workflows/flux-comfyui-example.json)
echo "export const defaultGraph = $workflow_json;" > /opt/ComfyUI/web/scripts/defaultGraph.js



if [[ -n $HF_TOKEN ]]; then
UNET_MODELS+=("https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/flux1-dev.safetensors")
VAE_MODELS+=("https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.safetensors")
Expand Down Expand Up @@ -73,6 +70,7 @@ function provisioning_start() {

provisioning_print_header
provisioning_get_apt_packages
provisioning_get_default_workflow
provisioning_get_nodes
provisioning_get_pip_packages
provisioning_get_models \
Expand All @@ -90,6 +88,9 @@ function provisioning_start() {
provisioning_get_models \
"${WORKSPACE}/storage/stable_diffusion/models/vae" \
"${VAE_MODELS[@]}"
provisioning_get_models \
"${WORKSPACE}/storage/stable_diffusion/models/clip" \
"${CLIP_MODELS[@]}"
provisioning_get_models \
"${WORKSPACE}/storage/stable_diffusion/models/esrgan" \
"${ESRGAN_MODELS[@]}"
Expand Down Expand Up @@ -139,6 +140,14 @@ function provisioning_get_nodes() {
done
}

function provisioning_get_default_workflow() {
if [[ -n $DEFAULT_WORKFLOW ]]; then
workflow_json=$(curl -s "$DEFAULT_WORKFLOW")
if [[ -n $workflow_json ]]; then
echo "export const defaultGraph = $workflow_json;" > /opt/ComfyUI/web/scripts/defaultGraph.js
fi
fi
}

function provisioning_get_models() {
if [[ -z $2 ]]; then return 1; fi
Expand Down

0 comments on commit 52ef945

Please sign in to comment.