ACE-Step Custom
Deploy ACE-Step Custom Edition with bug fixes
a602628
"""
Setup script for ACE-Step Custom Edition
"""
import subprocess
import sys
from pathlib import Path
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def run_command(cmd, description):
"""Run a shell command and handle errors."""
logger.info(f"\n{'='*60}")
logger.info(f"{description}")
logger.info(f"{'='*60}")
try:
result = subprocess.run(
cmd,
shell=True,
check=True,
capture_output=True,
text=True
)
logger.info(result.stdout)
return True
except subprocess.CalledProcessError as e:
logger.error(f"โŒ Error: {e}")
logger.error(e.stderr)
return False
def create_directories():
"""Create necessary directories."""
dirs = [
"outputs",
"timelines",
"lora_training",
"lora_training/prepared_data",
"lora_training/models",
"logs",
"models"
]
logger.info("\n๐Ÿ“ Creating directories...")
for dir_path in dirs:
Path(dir_path).mkdir(parents=True, exist_ok=True)
logger.info(f" โœ… {dir_path}")
def check_python_version():
"""Check Python version."""
logger.info("\n๐Ÿ Checking Python version...")
version = sys.version_info
logger.info(f" Python {version.major}.{version.minor}.{version.micro}")
if version.major < 3 or (version.major == 3 and version.minor < 8):
logger.error(" โŒ Python 3.8+ required")
return False
logger.info(" โœ… Python version OK")
return True
def install_requirements():
"""Install Python requirements."""
logger.info("\n๐Ÿ“ฆ Installing requirements...")
cmd = f"{sys.executable} -m pip install -r requirements.txt"
return run_command(cmd, "Installing Python packages")
def check_gpu():
"""Check GPU availability."""
logger.info("\n๐ŸŽฎ Checking GPU...")
try:
import torch
if torch.cuda.is_available():
gpu_name = torch.cuda.get_device_name(0)
gpu_memory = torch.cuda.get_device_properties(0).total_memory / 1e9
logger.info(f" โœ… GPU: {gpu_name}")
logger.info(f" โœ… VRAM: {gpu_memory:.1f} GB")
if gpu_memory < 8:
logger.warning(" โš ๏ธ Low VRAM. Consider using optimizations.")
return True
else:
logger.warning(" โš ๏ธ No GPU detected. Will run on CPU (slower)")
return False
except ImportError:
logger.error(" โŒ PyTorch not installed")
return False
def main():
"""Main setup process."""
logger.info("""
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘ ACE-Step 1.5 Custom Edition Setup โ•‘
โ•‘ โ•‘
โ•‘ A comprehensive music generation system with: โ•‘
โ•‘ โ€ข Standard ACE-Step interface โ•‘
โ•‘ โ€ข Custom timeline-based workflow โ•‘
โ•‘ โ€ข LoRA training studio โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
""")
# Check Python version
if not check_python_version():
logger.error("\nโŒ Setup failed: Python version too old")
sys.exit(1)
# Create directories
create_directories()
# Install requirements
if not install_requirements():
logger.error("\nโŒ Setup failed: Could not install requirements")
sys.exit(1)
# Check GPU
check_gpu()
# Success message
logger.info("""
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘ โœ… Setup Complete! โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
Next steps:
1. Download the ACE-Step model:
python scripts/download_model.py
2. Run the application:
python app.py
3. Open your browser to:
http://localhost:7860
For HuggingFace Spaces deployment:
- Upload all files to your Space
- Set SDK to 'gradio'
- Set Python version to 3.10
- Enable GPU (A10G or better recommended)
For help and documentation:
- README.md
- docs/ directory
""")
if __name__ == "__main__":
main()