File size: 2,540 Bytes
50eec37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
!/bin/bash

COMFYUI_DIR=/workspace/ComfyUI
MODELS_DIR=/workspace/models

# TODO: Download Flux 1 D

# TODO: Download Loras

# TODO: Download & install custom nodes
# https://github.com/ltdrdata/ComfyUI-Impact-Subpack
# https://github.com/ltdrdata/ComfyUI-Impact-Pack

# Install ReActor
if [ ! -d $COMFYUI_DIR/custom_nodes/ComfyUI-ReActor ]; then
  cd $COMFYUI_DIR/custom_nodes
  git clone https://github.com/Gourieff/ComfyUI-ReActor
  cd ComfyUI-ReActor
  python install.py
fi

# Download facerestore_models
function hf-pull {
    dest=$1
    url=$2
    filename=$3
    force=$4

    # Create destination directory if it does not exist
    if [ ! -d "$dest" ]; then
        mkdir -p $dest
    fi

    # Skip if destination file already exists and force is not set
    if [ -f "$dest/$filename" ] && [ -z "$force" ]; then
        echo "File $dest/$filename already exists. Skipping."
        return
    fi

    # Content-disposition sets the filename, but we allow overriding it
    if [ -z "$filename" ]; then
        filename=$(basename $url)
    fi
    wget -c $url -O $dest/$filename
}

hf-pull $MODELS_DIR/facerestore_models "https://huggingface.co/datasets/Gourieff/ReActor/resolve/main/models/facerestore_models/GFPGANv1.3.onnx?download=true"
hf-pull $MODELS_DIR/facerestore_models "https://huggingface.co/datasets/Gourieff/ReActor/resolve/main/models/facerestore_models/GFPGANv1.3.pth?download=true"
hf-pull $MODELS_DIR/facerestore_models "https://huggingface.co/datasets/Gourieff/ReActor/resolve/main/models/facerestore_models/GFPGANv1.4.onnx?download=true" 
hf-pull $MODELS_DIR/facerestore_models "https://huggingface.co/datasets/Gourieff/ReActor/resolve/main/models/facerestore_models/GFPGANv1.4.pth?download=true"
hf-pull $MODELS_DIR/facerestore_models "https://huggingface.co/datasets/Gourieff/ReActor/resolve/main/models/facerestore_models/GPEN-BFR-1024.onnx?download=true"
hf-pull $MODELS_DIR/facerestore_models "https://huggingface.co/datasets/Gourieff/ReActor/resolve/main/models/facerestore_models/GPEN-BFR-2048.onnx?download=true"
hf-pull $MODELS_DIR/facerestore_models "https://huggingface.co/datasets/Gourieff/ReActor/resolve/main/models/facerestore_models/GPEN-BFR-512.onnx?download=true"
hf-pull $MODELS_DIR/facerestore_models "https://huggingface.co/datasets/Gourieff/ReActor/resolve/main/models/facerestore_models/RestoreFormer_PP.onnx?download=true"
hf-pull $MODELS_DIR/facerestore_models "https://huggingface.co/datasets/Gourieff/ReActor/resolve/main/models/facerestore_models/codeformer-v0.1.0.pth?download=true"