Skip to content

Commit

Permalink
Update/fix mounts for comfyUI (#432)
Browse files Browse the repository at this point in the history
I updated the paths to make all paths work

Now paths in ComfyUI are working
Added: 
- `input`
- `models/configs`
- `models/gligen`
- `models/diffusers`
- `models/hypernetworks`

Was broken:
- `custom_nodes`
- `models/clip_vision` 
- `models/clip`

---------

Co-authored-by: LEv145 <[email protected]>
Co-authored-by: AbdBarho <[email protected]>
  • Loading branch information
3 people authored May 7, 2023
1 parent 7fb8b97 commit d47e77f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 26 deletions.
1 change: 1 addition & 0 deletions data/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
/openpose
/ModelScope
/LyCORIS
/GLIGEN
1 change: 1 addition & 0 deletions services/comfy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \

# add info
COPY . /docker/
RUN cp /docker/extra_model_paths.yaml ${ROOT}

ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility NVIDIA_VISIBLE_DEVICES=all
ENV PYTHONPATH="${PYTHONPATH}:${PWD}" CLI_ARGS=""
Expand Down
28 changes: 3 additions & 25 deletions services/comfy/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,12 @@

set -Eeuo pipefail

declare -A MOUNTS


mkdir -vp /data/config/comfy/

# cache
MOUNTS["/root/.cache"]=/data/.cache
# ui specific
MOUNTS["${ROOT}/models/checkpoints"]="/data/StableDiffusion"
MOUNTS["${ROOT}/models/controlnet"]="/data/ControlNet"
MOUNTS["${ROOT}/models/upscale_models/RealESRGAN"]="/data/RealESRGAN"
MOUNTS["${ROOT}/models/upscale_models/GFPGAN"]="/data/GFPGAN"
MOUNTS["${ROOT}/models/upscale_models/SwinIR"]="/data/SwinIR"
MOUNTS["${ROOT}/models/vae"]="/data/VAE"

# data
MOUNTS["${ROOT}/models/loras"]="/data/Lora"
MOUNTS["${ROOT}/models/embeddings"]="/data/embeddings"

# config
# TODO: I am not sure if this is final, maybe it should change in the future
MOUNTS["${ROOT}/models/clip"]="/data/.cache/comfy/clip"
MOUNTS["${ROOT}/models/clip_vision"]="/data/.cache/comfy/clip_vision"
MOUNTS["${ROOT}/models/custom_nodes"]="/data/config/comfy/custom_nodes"
MOUNTS["${ROOT}/models/style_models"]="/data/config/comfy/style_models"
MOUNTS["${ROOT}/models/t2i_adapter"]="/data/config/comfy/t2i_adapter"
declare -A MOUNTS

# output
MOUNTS["/root/.cache"]="/data/.cache"
MOUNTS["${ROOT}/input"]="/data/config/comfy/input"
MOUNTS["${ROOT}/output"]="/output/comfy"

for to_path in "${!MOUNTS[@]}"; do
Expand Down
24 changes: 24 additions & 0 deletions services/comfy/extra_model_paths.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
a111:
base_path: /data

checkpoints: StableDiffusion
configs: StableDiffusion
vae: VAE
loras: Lora
upscale_models: |
RealESRGAN
ESRGAN
SwinIR
GFPGAN
embeddings: embeddings
hypernetworks: Hypernetworks
controlnet: ControlNet
gligen: GLIGEN
custom_nodes: config/comfy/custom_nodes

# TODO: I am unsure about these, need more testing
# clip: .cache/clip
# style_models: config/comfy/style_models
# t2i_adapter: config/comfy/t2i_adapter
# clip_vision: config/comfy/clip_vision
# diffusers: config/comfy/diffusers
2 changes: 1 addition & 1 deletion services/download/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -Eeuo pipefail

# TODO: maybe just use the .gitignore file to create all of these
mkdir -vp /data/.cache /data/StableDiffusion /data/LyCORIS /data/Codeformer /data/ModelScope /data/GFPGAN /data/ESRGAN /data/BSRGAN /data/RealESRGAN /data/SwinIR /data/LDSR /data/ScuNET /data/embeddings /data/VAE /data/Deepdanbooru /data/MiDaS /data/Lora /data/ControlNet /data/openpose
mkdir -vp /data/.cache /data/StableDiffusion /data/LyCORIS /data/Codeformer /data/ModelScope /data/GFPGAN /data/ESRGAN /data/BSRGAN /data/RealESRGAN /data/SwinIR /data/LDSR /data/ScuNET /data/embeddings /data/VAE /data/Deepdanbooru /data/MiDaS /data/Lora /data/ControlNet /data/openpose /data/GLIGEN

echo "Downloading, this might take a while..."

Expand Down

0 comments on commit d47e77f

Please sign in to comment.