Advertisement
underlines

SDXL1.0 ComfyUI ControlNets Control-LoRA runpod

Aug 20th, 2023 (edited)
1,180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.19 KB | Source Code | 0 0
  1. #!/bin/bash
  2. set -e
  3. set -x
  4. # forward port 8188 in runpod first, before running an instance
  5. echo "Did you forward the port 8188 in your runpod instance? Press Enter to continue..."
  6. read
  7.  
  8. # Check if /workspace exists
  9. if [ ! -d "/workspace" ]; then
  10.     echo "/workspace directory does not exist. Creating it now..."
  11.     mkdir /workspace
  12.     echo "NOTE: If /workspace doesn't exist, you're probably running this script on a different environment than runpod. The script will still attempt to install everything."
  13. fi
  14.  
  15. # install comfyui
  16. cd /workspace
  17. if [ -d "ComfyUI" ]; then
  18.     echo "ComfyUI repository already exists. Pulling latest changes..."
  19.     cd ComfyUI
  20.     git pull
  21. else
  22.     echo "Cloning ComfyUI repository..."
  23.     git clone https://github.com/comfyanonymous/ComfyUI
  24.     cd ComfyUI
  25. fi
  26. pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu118 xformers
  27. pip install -r requirements.txt
  28.  
  29. # install custom nodes
  30. cd custom_nodes/
  31. if [ -d "ComfyUI-Manager" ]; then
  32.     echo "ComfyUI-Manager repository already exists. Pulling latest changes..."
  33.     cd ComfyUI-Manager
  34.     git pull
  35.     cd ..
  36. else
  37.     echo "Cloning ComfyUI-Manager repository..."
  38.     git clone https://github.com/ltdrdata/ComfyUI-Manager
  39. fi
  40. if [ -d "comfyui_controlnet_aux" ]; then
  41.     echo "comfyui_controlnet_aux repository already exists. Pulling latest changes..."
  42.     cd comfyui_controlnet_aux
  43.     git pull
  44.     cd ..
  45. else
  46.     echo "Cloning comfyui_controlnet_aux repository..."
  47.     git clone https://github.com/Fannovel16/comfyui_controlnet_aux/
  48. fi
  49. pip install -r comfyui_controlnet_aux/requirements.txt
  50. if [ -d "stability-ComfyUI-nodes" ]; then
  51.     echo "stability-ComfyUI-nodes repository already exists. Pulling latest changes..."
  52.     cd stability-ComfyUI-nodes
  53.     git pull
  54.     cd ..
  55. else
  56.     echo "Cloning stability-ComfyUI-nodes repository..."
  57.     git clone https://github.com/Stability-AI/stability-ComfyUI-nodes
  58. fi
  59. if [ -d "ComfyUI-post-processing-nodes" ]; then
  60.     echo "ComfyUI-post-processing-nodes repository already exists. Pulling latest changes..."
  61.     cd ComfyUI-post-processing-nodes
  62.     git pull
  63.     cd ..
  64. else
  65.     echo "Cloning ComfyUI-post-processing-nodes repository..."
  66.     git clone https://github.com/EllangoK/ComfyUI-post-processing-nodes
  67. fi
  68.  
  69.  
  70. # download SDXL base and refiner
  71. cd ../models/checkpoints
  72. [ ! -f sd_xl_base_1.0_0.9vae.safetensors ] && wget https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0_0.9vae.safetensors
  73. [ ! -f sd_xl_refiner_1.0_0.9vae.safetensors ] && wget https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0/resolve/main/sd_xl_refiner_1.0_0.9vae.safetensors
  74.  
  75. # download controlnets
  76. cd ../controlnet
  77. [ ! -f controlnet-canny-sdxl-1.0.safetensors ] && wget -O controlnet-canny-sdxl-1.0.safetensors https://huggingface.co/diffusers/controlnet-canny-sdxl-1.0/resolve/main/diffusion_pytorch_model.fp16.safetensors
  78. [ ! -f controlnet-depth-sdxl-1.0.safetensors ] && wget -O controlnet-depth-sdxl-1.0.safetensors https://huggingface.co/diffusers/controlnet-depth-sdxl-1.0/resolve/main/diffusion_pytorch_model.fp16.safetensors
  79.  
  80. # download control loras
  81. [ ! -d control-lora ] && mkdir control-lora
  82. cd control-lora
  83. [ ! -f control-lora-canny-rank256.safetensors ] && wget https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-canny-rank256.safetensors
  84. [ ! -f control-lora-depth-rank256.safetensors ] && wget https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-depth-rank256.safetensors
  85. [ ! -f control-lora-recolor-rank256.safetensors ] && wget https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-recolor-rank256.safetensors
  86. [ ! -f control-lora-sketch-rank256.safetensors ] && wget https://huggingface.co/stabilityai/control-lora/resolve/main/control-LoRAs-rank256/control-lora-sketch-rank256.safetensors
  87.  
  88. # download clip vision
  89. cd ../../clip_vision
  90. [ ! -f clip_vision_g.safetensors ] && wget https://huggingface.co/stabilityai/control-lora/resolve/main/revision/clip_vision_g.safetensors
  91. cd ../..
  92.  
  93. # download workflows
  94. [ ! -d workflows ] && mkdir workflows
  95. cd workflows
  96. [ ! -f revision-image_mixing_example.json ] && wget https://huggingface.co/stabilityai/control-lora/resolve/main/revision/revision-image_mixing_example.json
  97. [ ! -f control-lora-canny-basic_example.json ] && wget https://huggingface.co/stabilityai/control-lora/resolve/main/comfy-control-LoRA-workflows/control-lora-canny-basic_example.json
  98. [ ! -f control-lora-depth-basic_example.json ] && wget https://huggingface.co/stabilityai/control-lora/resolve/main/comfy-control-LoRA-workflows/control-lora-depth-basic_example.json
  99. [ ! -f control-lora-recolor-basic_example.json ] && wget https://huggingface.co/stabilityai/control-lora/resolve/main/comfy-control-LoRA-workflows/control-lora-recolor-basic_example.json
  100. [ ! -f control-lora-sketch-basic_example.json ] && wget https://huggingface.co/stabilityai/control-lora/resolve/main/comfy-control-LoRA-workflows/control-lora-sketch-basic_example.json
  101. cd ..
  102.  
  103. # run comfyui
  104. echo "connect through runpod's CONNECT button to the interface"
  105. python main.py --listen 0.0.0.0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement