2025-11-22 02:13:07 +01:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
#
|
2025-11-23 17:58:50 +01:00
|
|
|
|
# CivitAI Model Downloader - A Beautiful CLI Tool
|
|
|
|
|
|
# Downloads NSFW AI models from CivitAI and creates symlinks to ComfyUI directories
|
2025-11-22 02:13:07 +01:00
|
|
|
|
#
|
2025-11-23 17:58:50 +01:00
|
|
|
|
# Usage: ./artifact_civitai_download.sh [COMMAND] [options]
|
feat: add ComfyUI symlink functionality and subcommands
Adds subcommand structure (download, link, both) to the ComfyUI downloader script, allowing users to download models from HuggingFace and/or create symlinks to ComfyUI model directories. Features include:
- New subcommands: download (download only), link (symlink only), both (default)
- ComfyUI directory configuration (--comfyui-dir, default: ~/ComfyUI/models)
- Smart symlink creation to appropriate ComfyUI subdirectories (checkpoints, vae, loras, controlnet, upscale_models, etc.)
- YAML configuration extended with 'type' and 'filename' fields for precise model organization
- Automatic ComfyUI subdirectory creation
- Graceful handling of existing symlinks and files
- HF_TOKEN validation only when needed (download/both commands)
- Example configuration file (comfyui_models.example.yaml) demonstrating proper setup
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 02:20:46 +01:00
|
|
|
|
#
|
|
|
|
|
|
# Commands: download, link, both (default)
|
2025-11-22 02:13:07 +01:00
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
2025-11-23 17:58:50 +01:00
|
|
|
|
# COLOR PALETTE - Beautiful Terminal Colors (Purple/Magenta Theme)
|
2025-11-22 02:13:07 +01:00
|
|
|
|
# ============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
# Reset
|
|
|
|
|
|
RESET='\033[0m'
|
|
|
|
|
|
|
|
|
|
|
|
# Foreground Colors
|
|
|
|
|
|
BLACK='\033[0;30m'
|
|
|
|
|
|
RED='\033[0;31m'
|
|
|
|
|
|
GREEN='\033[0;32m'
|
|
|
|
|
|
YELLOW='\033[0;33m'
|
|
|
|
|
|
BLUE='\033[0;34m'
|
|
|
|
|
|
MAGENTA='\033[0;35m'
|
|
|
|
|
|
CYAN='\033[0;36m'
|
|
|
|
|
|
WHITE='\033[0;37m'
|
|
|
|
|
|
|
|
|
|
|
|
# Bold
|
|
|
|
|
|
BOLD_BLACK='\033[1;30m'
|
|
|
|
|
|
BOLD_RED='\033[1;31m'
|
|
|
|
|
|
BOLD_GREEN='\033[1;32m'
|
|
|
|
|
|
BOLD_YELLOW='\033[1;33m'
|
|
|
|
|
|
BOLD_BLUE='\033[1;34m'
|
|
|
|
|
|
BOLD_MAGENTA='\033[1;35m'
|
|
|
|
|
|
BOLD_CYAN='\033[1;36m'
|
|
|
|
|
|
BOLD_WHITE='\033[1;37m'
|
|
|
|
|
|
|
|
|
|
|
|
# Background Colors
|
|
|
|
|
|
BG_BLACK='\033[40m'
|
|
|
|
|
|
BG_RED='\033[41m'
|
|
|
|
|
|
BG_GREEN='\033[42m'
|
|
|
|
|
|
BG_YELLOW='\033[43m'
|
|
|
|
|
|
BG_BLUE='\033[44m'
|
|
|
|
|
|
BG_MAGENTA='\033[45m'
|
|
|
|
|
|
BG_CYAN='\033[46m'
|
|
|
|
|
|
BG_WHITE='\033[47m'
|
|
|
|
|
|
|
|
|
|
|
|
# Styles
|
|
|
|
|
|
DIM='\033[2m'
|
|
|
|
|
|
ITALIC='\033[3m'
|
|
|
|
|
|
UNDERLINE='\033[4m'
|
|
|
|
|
|
BLINK='\033[5m'
|
|
|
|
|
|
REVERSE='\033[7m'
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# UNICODE CHARACTERS - Make it Pretty
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
|
2025-11-23 17:58:50 +01:00
|
|
|
|
CHECK_MARK=""
|
|
|
|
|
|
CROSS_MARK=""
|
|
|
|
|
|
ROCKET="=<3D>"
|
|
|
|
|
|
PACKAGE="=<3D>"
|
|
|
|
|
|
DOWNLOAD=""
|
|
|
|
|
|
SPARKLES="("
|
|
|
|
|
|
FIRE="=%"
|
|
|
|
|
|
CLOCK="<22>"
|
|
|
|
|
|
FOLDER="=<3D>"
|
|
|
|
|
|
LINK="="
|
|
|
|
|
|
STAR="P"
|
|
|
|
|
|
WARNING="<22>"
|
|
|
|
|
|
INFO="9"
|
|
|
|
|
|
ARROW_RIGHT="<22>"
|
|
|
|
|
|
DOUBLE_ARROW="<22>"
|
|
|
|
|
|
BOX_LIGHT=" |