|
#!/bin/bash |
|
|
|
echo "pod started" |
|
|
|
if [[ $PUBLIC_KEY ]] |
|
then |
|
mkdir -p ~/.ssh |
|
chmod 700 ~/.ssh |
|
cd ~/.ssh |
|
echo $PUBLIC_KEY >> authorized_keys |
|
chmod 700 -R ~/.ssh |
|
cd / |
|
service ssh start |
|
fi |
|
|
|
|
|
if [[ -z "${HF_TOKEN}" ]] || [[ "${HF_TOKEN}" == "enter_your_huggingface_token_here" ]] |
|
then |
|
echo "HF_TOKEN is not set" |
|
else |
|
echo "HF_TOKEN is set, logging in..." |
|
huggingface-cli login --token ${HF_TOKEN} |
|
fi |
|
|
|
|
|
|
|
service nginx start |
|
|
|
|
|
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.allow_origin='*' --NotebookApp.token='' & |
|
echo "JupyterLab started" |
|
|
|
|
|
if [ -d "/workspace/venv" ]; then |
|
echo "venv directory found, activating it" |
|
source /workspace/venv/bin/activate |
|
fi |
|
|
|
|
|
|
|
python3 /workspace/ComfyUI/main.py --listen |
|
|
|
|
|
|
|
download_file() { |
|
local url=$1 |
|
local target_dir=$2 |
|
local target_file=$3 |
|
|
|
if [ ! -f "${target_file}" ]; then |
|
echo "Downloading ${target_file}..." |
|
mkdir -p "${target_dir}" |
|
wget -O "${target_file}" "${url}" --progress=bar:force:noscroll |
|
else |
|
echo "${target_file} already exists, skipping download." |
|
fi |
|
} |
|
|
|
|
|
|
|
download_file "https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/ae.sft?download=true" \ |
|
"/ComfyUI/models/vae" \ |
|
"/ComfyUI/models/vae/ae.sft" |
|
|
|
|
|
download_file "https://huggingface.co/black-forest-labs/FLUX.1-dev/resolve/main/flux1-dev.sft?download=true" \ |
|
"/ComfyUI/models/diffusion_models" \ |
|
"/ComfyUI/models/diffusion_models/flux1-dev.sft" |
|
|
|
|
|
download_file "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors?download=true" \ |
|
"/ComfyUI/models/clip" \ |
|
"/ComfyUI/models/clip/clip_l.safetensors" |
|
|
|
download_file "https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors?download=true" \ |
|
"/ComfyUI/models/clip" \ |
|
"/ComfyUI/models/clip/t5xxl_fp8_e4m3fn.safetensors" |
|
|
|
|
|
echo "All required files have been checked/Downloaded!" |
|
|
|
|
|
|
|
sleep infinity |
|
|