diff --git a/artifact_comfyui_download.sh b/artifact_comfyui_download.sh index 7f40095..438f503 100755 --- a/artifact_comfyui_download.sh +++ b/artifact_comfyui_download.sh @@ -97,11 +97,16 @@ else CONFIG_FILE="" # No config file by default fi -# Default cache directory (use HuggingFace default) -CACHE_DIR="${CACHE_DIR:-${HOME}/.cache/huggingface}" - -# Default ComfyUI models directory -COMFYUI_DIR="${COMFYUI_DIR:-${HOME}/ComfyUI/models}" +# Default cache directory - detect RunPod or use HuggingFace default +if [[ -d "/workspace" ]]; then + # RunPod environment + CACHE_DIR="${CACHE_DIR:-/workspace/huggingface_cache}" + COMFYUI_DIR="${COMFYUI_DIR:-/workspace/ComfyUI/models}" +else + # Local environment + CACHE_DIR="${CACHE_DIR:-${HOME}/.cache/huggingface}" + COMFYUI_DIR="${COMFYUI_DIR:-${HOME}/ComfyUI/models}" +fi # Default command COMMAND="both" @@ -727,8 +732,12 @@ while [[ $# -gt 0 ]]; do echo "" echo "Options:" echo " -c, --config FILE Configuration file (default: NONE)" - echo " --cache-dir DIR Cache directory (default: ~/.cache/huggingface)" - echo " --comfyui-dir DIR ComfyUI models directory (default: ~/ComfyUI/models)" + echo " --cache-dir DIR Cache directory (default: auto-detect)" + echo " RunPod: /workspace/huggingface_cache" + echo " Local: ~/.cache/huggingface" + echo " --comfyui-dir DIR ComfyUI models directory (default: auto-detect)" + echo " RunPod: /workspace/ComfyUI/models" + echo " Local: ~/ComfyUI/models" echo " -h, --help Show this help message" echo "" echo "Examples:" diff --git a/comfyui_models.example.yaml b/comfyui_models.example.yaml new file mode 100644 index 0000000..8a9563c --- /dev/null +++ b/comfyui_models.example.yaml @@ -0,0 +1,112 @@ +# ComfyUI Models Configuration Example +# +# This file defines which models to download from HuggingFace +# and explicit source->destination file mappings for symlinks. +# +# IMPORTANT: Use the 'files' array to specify EXACTLY which files to link +# and where to link them. Without explicit file mappings, ALL files from +# the repository will be linked (which causes trash/wrong files). +# +# Format: +# - repo_id: HuggingFace repository (e.g., "runwayml/stable-diffusion-v1-5") +# - description: Human-readable description +# - size_gb: Approximate size +# - essential: Is this a core model? +# - type: ComfyUI subdirectory (checkpoints, vae, loras, controlnet, etc.) +# - filename: Optional filter for find_model_files (usually leave empty) +# - files: Array of {source: "filename_in_repo", dest: "filename_in_comfyui"} +# +# Example: +# files: +# - source: "v1-5-pruned-emaonly.safetensors" +# dest: "sd-v1-5.safetensors" +# +# This will create: ComfyUI/models/checkpoints/sd-v1-5.safetensors +# Pointing to: ~/.cache/huggingface/.../v1-5-pruned-emaonly.safetensors + +settings: + # RunPod: /workspace/huggingface_cache + # Local: ~/.cache/huggingface + cache_dir: /workspace/huggingface_cache + parallel_downloads: 1 + +model_categories: + # Stable Diffusion Checkpoints + checkpoints: + - repo_id: runwayml/stable-diffusion-v1-5 + description: Stable Diffusion v1.5 + size_gb: 4 + essential: true + type: checkpoints + filename: "" + files: + - source: "v1-5-pruned-emaonly.safetensors" + dest: "sd-v1-5.safetensors" + + - repo_id: stabilityai/stable-diffusion-xl-base-1.0 + description: SDXL Base 1.0 + size_gb: 7 + essential: true + type: checkpoints + filename: "" + files: + - source: "sd_xl_base_1.0.safetensors" + dest: "sdxl-base-1.0.safetensors" + + # VAE Models + vae: + - repo_id: stabilityai/sd-vae-ft-mse-original + description: SD VAE ft MSE + size_gb: 0.3 + essential: true + type: vae + filename: "" + files: + - source: "vae-ft-mse-840000-ema-pruned.safetensors" + dest: "sd-vae-ft-mse.safetensors" + + # LoRA Models + loras: + - repo_id: latent-consistency/lcm-lora-sdv1-5 + description: LCM LoRA for SD v1.5 + size_gb: 0.1 + essential: false + type: loras + filename: "" + files: + - source: "pytorch_lora_weights.safetensors" + dest: "lcm-lora-sdv1-5.safetensors" + + # ControlNet Models + controlnet: + - repo_id: lllyasviel/control_v11p_sd15_canny + description: ControlNet Canny + size_gb: 1.4 + essential: false + type: controlnet + filename: "" + files: + - source: "diffusion_pytorch_model.safetensors" + dest: "control_v11p_sd15_canny.safetensors" + + - repo_id: lllyasviel/control_v11p_sd15_openpose + description: ControlNet OpenPose + size_gb: 1.4 + essential: false + type: controlnet + filename: "" + files: + - source: "diffusion_pytorch_model.safetensors" + dest: "control_v11p_sd15_openpose.safetensors" + + # Upscale Models + upscale_models: + - repo_id: ai-forever/Real-ESRGAN + description: Real-ESRGAN x4 + size_gb: 0.1 + essential: false + type: upscale_models + filename: "" + files: + - source: "RealESRGAN_x4plus.pth" + dest: "RealESRGAN_x4plus.pth"