mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-07 23:07:09 +08:00
refactor: simplify UV setup script by removing environment variable settings and virtual environment checks
This commit is contained in:
parent
5c08b23fa3
commit
a176b07001
49
uv_setup.sh
49
uv_setup.sh
@ -1,45 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# ComfyUI UV Environment Setup Script
|
# ComfyUI UV Setup Script
|
||||||
# Created: May 2, 2025
|
|
||||||
|
|
||||||
# Set UV environment variables for better performance
|
# Check if Python is available
|
||||||
export UV_CACHE_DIR="${HOME}/.cache/uv"
|
if ! command -v python3 &> /dev/null; then
|
||||||
export UV_SYSTEM_PYTHON=false
|
echo "Python 3 is required but not found. Please install Python 3.9+ first."
|
||||||
export UV_DEFAULT_PYTHON=3.11
|
exit 1
|
||||||
export UV_THREADS=auto
|
|
||||||
export UV_VERBOSITY=1
|
|
||||||
|
|
||||||
# Create directory structure if needed
|
|
||||||
mkdir -p "${UV_CACHE_DIR}"
|
|
||||||
|
|
||||||
echo "UV environment variables set:"
|
|
||||||
echo " UV_CACHE_DIR: ${UV_CACHE_DIR}"
|
|
||||||
echo " UV_DEFAULT_PYTHON: ${UV_DEFAULT_PYTHON}"
|
|
||||||
echo " UV_THREADS: ${UV_THREADS}"
|
|
||||||
|
|
||||||
# Check if UV is installed
|
|
||||||
if ! command -v uv >/dev/null 2>&1; then
|
|
||||||
echo "UV not found. Installing..."
|
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
||||||
|
|
||||||
# Add to PATH for this session
|
|
||||||
source $HOME/.local/bin/env
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for ComfyUI virtual environment
|
# Make Python script executable
|
||||||
if [ ! -d ".venv" ]; then
|
chmod +x ./uv_setup.py
|
||||||
echo "Creating virtual environment..."
|
|
||||||
uv venv
|
|
||||||
echo "Virtual environment created at .venv"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo ""
|
# Run the Python setup script with passed arguments
|
||||||
echo "To activate the virtual environment, run:"
|
python3 ./uv_setup.py "$@"
|
||||||
echo " source .venv/bin/activate # On Linux/macOS"
|
|
||||||
echo " .venv\\Scripts\\activate.bat # On Windows"
|
|
||||||
echo ""
|
|
||||||
echo "To install/update dependencies:"
|
|
||||||
echo " ./update_dependencies_uv.py --advanced --cuda --lock"
|
|
||||||
echo ""
|
|
||||||
echo "To start ComfyUI:"
|
|
||||||
echo " python main.py"
|
|
||||||
Loading…
x
Reference in New Issue
Block a user