Spaces:
Running
on
Zero
Running
on
Zero
ACE-Step Custom
commited on
Commit
·
ee19acb
1
Parent(s):
55a1124
Use official ACE-Step model downloader for automatic model downloads
Browse files- README.md +33 -1
- README_HF.md +33 -1
- app.py +2 -0
- src/ace_step_engine.py +18 -40
README.md
CHANGED
|
@@ -13,7 +13,9 @@ python_version: 3.11
|
|
| 13 |
|
| 14 |
# ACE-Step 1.5 Custom Edition
|
| 15 |
|
| 16 |
-
A comprehensive music generation system built on ACE-Step 1.5, featuring
|
|
|
|
|
|
|
| 17 |
|
| 18 |
## 🌟 Features
|
| 19 |
|
|
@@ -42,6 +44,36 @@ Complete training interface for custom models:
|
|
| 42 |
|
| 43 |
## 🚀 Quick Start
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
1. **Standard Generation**: Use Tab 1 for traditional text-to-music
|
| 46 |
2. **Timeline Creation**: Use Tab 2 to build longer songs with consistent style
|
| 47 |
3. **Custom Training**: Use Tab 3 to create specialized models
|
|
|
|
| 13 |
|
| 14 |
# ACE-Step 1.5 Custom Edition
|
| 15 |
|
| 16 |
+
A comprehensive music generation system built on ACE-Step 1.5, featuring three specialized interfaces.
|
| 17 |
+
|
| 18 |
+
**Models will download automatically on first run (~7GB)** from the official ACE-Step repository.
|
| 19 |
|
| 20 |
## 🌟 Features
|
| 21 |
|
|
|
|
| 44 |
|
| 45 |
## 🚀 Quick Start
|
| 46 |
|
| 47 |
+
1. **First Launch**: Models download automatically from `ACE-Step/Ace-Step1.5`
|
| 48 |
+
2. **Standard Generation**: Use Tab 1 for traditional text-to-music
|
| 49 |
+
3. **Timeline Creation**: Use Tab 2 to build longer songs with consistent style
|
| 50 |
+
4. **Custom Training**: Use Tab 3 to create specialized models
|
| 51 |
+
|
| 52 |
+
## 📚 About
|
| 53 |
+
Full-featured standard ACE-Step 1.5 GUI with all original capabilities including:
|
| 54 |
+
- Text-to-music generation with style control
|
| 55 |
+
- Variation generation
|
| 56 |
+
- Section repainting
|
| 57 |
+
- Lyric editing
|
| 58 |
+
|
| 59 |
+
### 2. Custom Timeline Workflow
|
| 60 |
+
Advanced timeline-based generation system:
|
| 61 |
+
- Generate 32-second clips with seamless blending
|
| 62 |
+
- Adjustable context length (0-120 seconds) for style consistency
|
| 63 |
+
- Master timeline with visual representation
|
| 64 |
+
- Extend, inpaint, and remix capabilities
|
| 65 |
+
- Automatic crossfading between clips
|
| 66 |
+
|
| 67 |
+
### 3. LoRA Training Studio
|
| 68 |
+
Complete training interface for custom models:
|
| 69 |
+
- Upload and preprocess audio files
|
| 70 |
+
- Configure training parameters
|
| 71 |
+
- Train specialized models for voices, instruments, or styles
|
| 72 |
+
- Download and reuse trained models
|
| 73 |
+
- Continue training from existing LoRAs
|
| 74 |
+
|
| 75 |
+
## 🚀 Quick Start
|
| 76 |
+
|
| 77 |
1. **Standard Generation**: Use Tab 1 for traditional text-to-music
|
| 78 |
2. **Timeline Creation**: Use Tab 2 to build longer songs with consistent style
|
| 79 |
3. **Custom Training**: Use Tab 3 to create specialized models
|
README_HF.md
CHANGED
|
@@ -13,7 +13,9 @@ python_version: 3.11
|
|
| 13 |
|
| 14 |
# ACE-Step 1.5 Custom Edition
|
| 15 |
|
| 16 |
-
A comprehensive music generation system built on ACE-Step 1.5, featuring
|
|
|
|
|
|
|
| 17 |
|
| 18 |
## 🌟 Features
|
| 19 |
|
|
@@ -42,6 +44,36 @@ Complete training interface for custom models:
|
|
| 42 |
|
| 43 |
## 🚀 Quick Start
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
1. **Standard Generation**: Use Tab 1 for traditional text-to-music
|
| 46 |
2. **Timeline Creation**: Use Tab 2 to build longer songs with consistent style
|
| 47 |
3. **Custom Training**: Use Tab 3 to create specialized models
|
|
|
|
| 13 |
|
| 14 |
# ACE-Step 1.5 Custom Edition
|
| 15 |
|
| 16 |
+
A comprehensive music generation system built on ACE-Step 1.5, featuring three specialized interfaces.
|
| 17 |
+
|
| 18 |
+
**Models will download automatically on first run (~7GB)** from the official ACE-Step repository.
|
| 19 |
|
| 20 |
## 🌟 Features
|
| 21 |
|
|
|
|
| 44 |
|
| 45 |
## 🚀 Quick Start
|
| 46 |
|
| 47 |
+
1. **First Launch**: Models download automatically from `ACE-Step/Ace-Step1.5`
|
| 48 |
+
2. **Standard Generation**: Use Tab 1 for traditional text-to-music
|
| 49 |
+
3. **Timeline Creation**: Use Tab 2 to build longer songs with consistent style
|
| 50 |
+
4. **Custom Training**: Use Tab 3 to create specialized models
|
| 51 |
+
|
| 52 |
+
## 📚 About
|
| 53 |
+
Full-featured standard ACE-Step 1.5 GUI with all original capabilities including:
|
| 54 |
+
- Text-to-music generation with style control
|
| 55 |
+
- Variation generation
|
| 56 |
+
- Section repainting
|
| 57 |
+
- Lyric editing
|
| 58 |
+
|
| 59 |
+
### 2. Custom Timeline Workflow
|
| 60 |
+
Advanced timeline-based generation system:
|
| 61 |
+
- Generate 32-second clips with seamless blending
|
| 62 |
+
- Adjustable context length (0-120 seconds) for style consistency
|
| 63 |
+
- Master timeline with visual representation
|
| 64 |
+
- Extend, inpaint, and remix capabilities
|
| 65 |
+
- Automatic crossfading between clips
|
| 66 |
+
|
| 67 |
+
### 3. LoRA Training Studio
|
| 68 |
+
Complete training interface for custom models:
|
| 69 |
+
- Upload and preprocess audio files
|
| 70 |
+
- Configure training parameters
|
| 71 |
+
- Train specialized models for voices, instruments, or styles
|
| 72 |
+
- Download and reuse trained models
|
| 73 |
+
- Continue training from existing LoRAs
|
| 74 |
+
|
| 75 |
+
## 🚀 Quick Start
|
| 76 |
+
|
| 77 |
1. **Standard Generation**: Use Tab 1 for traditional text-to-music
|
| 78 |
2. **Timeline Creation**: Use Tab 2 to build longer songs with consistent style
|
| 79 |
3. **Custom Training**: Use Tab 3 to create specialized models
|
app.py
CHANGED
|
@@ -348,6 +348,8 @@ def create_ui():
|
|
| 348 |
# 🎵 ACE-Step 1.5 Custom Edition
|
| 349 |
|
| 350 |
**Three powerful interfaces for music generation and training**
|
|
|
|
|
|
|
| 351 |
""")
|
| 352 |
|
| 353 |
with gr.Tabs():
|
|
|
|
| 348 |
# 🎵 ACE-Step 1.5 Custom Edition
|
| 349 |
|
| 350 |
**Three powerful interfaces for music generation and training**
|
| 351 |
+
|
| 352 |
+
Models will download automatically on first use (~7GB from HuggingFace)
|
| 353 |
""")
|
| 354 |
|
| 355 |
with gr.Tabs():
|
src/ace_step_engine.py
CHANGED
|
@@ -8,7 +8,6 @@ from pathlib import Path
|
|
| 8 |
import logging
|
| 9 |
from typing import Optional, Dict, Any, Tuple
|
| 10 |
import os
|
| 11 |
-
from huggingface_hub import snapshot_download
|
| 12 |
|
| 13 |
logger = logging.getLogger(__name__)
|
| 14 |
|
|
@@ -17,6 +16,7 @@ try:
|
|
| 17 |
from acestep.handler import AceStepHandler
|
| 18 |
from acestep.llm_inference import LLMHandler
|
| 19 |
from acestep.inference import GenerationParams, GenerationConfig, generate_music
|
|
|
|
| 20 |
ACE_STEP_AVAILABLE = True
|
| 21 |
except ImportError as e:
|
| 22 |
logger.warning(f"ACE-Step 1.5 modules not available: {e}")
|
|
@@ -64,57 +64,35 @@ class ACEStepEngine:
|
|
| 64 |
|
| 65 |
def _download_checkpoints(self):
|
| 66 |
"""Download model checkpoints from HuggingFace if not present."""
|
| 67 |
-
|
| 68 |
|
| 69 |
-
if
|
| 70 |
-
|
|
|
|
| 71 |
return
|
| 72 |
|
| 73 |
-
logger.info("Downloading ACE-Step 1.5
|
|
|
|
| 74 |
|
| 75 |
try:
|
| 76 |
-
#
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
local_dir=os.path.join(checkpoint_dir, dit_model),
|
| 81 |
-
repo_type="model"
|
| 82 |
)
|
| 83 |
-
logger.info(f" Downloaded DiT model: {dit_model}")
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
repo_id="ACE-Step/vae",
|
| 88 |
-
local_dir=os.path.join(checkpoint_dir, "vae"),
|
| 89 |
-
repo_type="model"
|
| 90 |
-
)
|
| 91 |
-
logger.info(" Downloaded VAE")
|
| 92 |
-
|
| 93 |
-
# Download text encoder
|
| 94 |
-
snapshot_download(
|
| 95 |
-
repo_id="Qwen/Qwen3-Embedding-0.6B",
|
| 96 |
-
local_dir=os.path.join(checkpoint_dir, "Qwen3-Embedding-0.6B"),
|
| 97 |
-
repo_type="model"
|
| 98 |
-
)
|
| 99 |
-
logger.info(" Downloaded text encoder")
|
| 100 |
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
snapshot_download(
|
| 104 |
-
repo_id=f"ACE-Step/{lm_model}",
|
| 105 |
-
local_dir=os.path.join(checkpoint_dir, lm_model),
|
| 106 |
-
repo_type="model"
|
| 107 |
-
)
|
| 108 |
-
logger.info(f" Downloaded LLM: {lm_model}")
|
| 109 |
-
|
| 110 |
-
logger.info(f" All checkpoints downloaded to {checkpoint_dir}")
|
| 111 |
|
| 112 |
except Exception as e:
|
| 113 |
logger.error(f"Failed to download checkpoints: {e}")
|
| 114 |
raise
|
| 115 |
|
| 116 |
def _load_models(self):
|
| 117 |
-
"""Initialize
|
| 118 |
try:
|
| 119 |
if not ACE_STEP_AVAILABLE:
|
| 120 |
raise RuntimeError("ACE-Step 1.5 not available")
|
|
@@ -126,7 +104,7 @@ class ACEStepEngine:
|
|
| 126 |
# Get project root
|
| 127 |
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
| 128 |
|
| 129 |
-
logger.info(f"
|
| 130 |
|
| 131 |
# Initialize DiT handler (handles main diffusion model, VAE, text encoder)
|
| 132 |
status_dit, success_dit = self.dit_handler.initialize_service(
|
|
@@ -142,7 +120,7 @@ class ACEStepEngine:
|
|
| 142 |
raise RuntimeError(f"Failed to initialize DiT: {status_dit}")
|
| 143 |
|
| 144 |
logger.info(f" DiT initialized: {status_dit}")
|
| 145 |
-
|
| 146 |
# Initialize LLM handler (handles 5Hz Language Model)
|
| 147 |
logger.info(f"Initializing LLM handler with model: {lm_model_path}")
|
| 148 |
|
|
|
|
| 8 |
import logging
|
| 9 |
from typing import Optional, Dict, Any, Tuple
|
| 10 |
import os
|
|
|
|
| 11 |
|
| 12 |
logger = logging.getLogger(__name__)
|
| 13 |
|
|
|
|
| 16 |
from acestep.handler import AceStepHandler
|
| 17 |
from acestep.llm_inference import LLMHandler
|
| 18 |
from acestep.inference import GenerationParams, GenerationConfig, generate_music
|
| 19 |
+
from acestep.model_downloader import ensure_main_model, get_checkpoints_dir, check_main_model_exists
|
| 20 |
ACE_STEP_AVAILABLE = True
|
| 21 |
except ImportError as e:
|
| 22 |
logger.warning(f"ACE-Step 1.5 modules not available: {e}")
|
|
|
|
| 64 |
|
| 65 |
def _download_checkpoints(self):
|
| 66 |
"""Download model checkpoints from HuggingFace if not present."""
|
| 67 |
+
checkpoints_dir = get_checkpoints_dir(self.config.get("checkpoint_dir"))
|
| 68 |
|
| 69 |
+
# Check if main model already exists
|
| 70 |
+
if check_main_model_exists(checkpoints_dir):
|
| 71 |
+
logger.info(f"✓ ACE-Step 1.5 models already exist at {checkpoints_dir}")
|
| 72 |
return
|
| 73 |
|
| 74 |
+
logger.info("Downloading ACE-Step 1.5 models from HuggingFace...")
|
| 75 |
+
logger.info("This may take several minutes (models are ~7GB total)...")
|
| 76 |
|
| 77 |
try:
|
| 78 |
+
# Use the built-in model downloader
|
| 79 |
+
success, message = ensure_main_model(
|
| 80 |
+
checkpoints_dir=str(checkpoints_dir),
|
| 81 |
+
prefer_source="huggingface" # Use HuggingFace for Spaces
|
|
|
|
|
|
|
| 82 |
)
|
|
|
|
| 83 |
|
| 84 |
+
if not success:
|
| 85 |
+
raise RuntimeError(f"Failed to download models: {message}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
+
logger.info(f"✓ {message}")
|
| 88 |
+
logger.info("✓ All ACE-Step 1.5 models downloaded successfully")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
except Exception as e:
|
| 91 |
logger.error(f"Failed to download checkpoints: {e}")
|
| 92 |
raise
|
| 93 |
|
| 94 |
def _load_models(self):
|
| 95 |
+
"""Initialize s_dir = get_checkpoints_dir(self.config.get("checkpoint_dir")
|
| 96 |
try:
|
| 97 |
if not ACE_STEP_AVAILABLE:
|
| 98 |
raise RuntimeError("ACE-Step 1.5 not available")
|
|
|
|
| 104 |
# Get project root
|
| 105 |
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
| 106 |
|
| 107 |
+
logger.info(f"Instr(checkpoints_dir / dit_model_path) handler with model: {dit_model_path}")
|
| 108 |
|
| 109 |
# Initialize DiT handler (handles main diffusion model, VAE, text encoder)
|
| 110 |
status_dit, success_dit = self.dit_handler.initialize_service(
|
|
|
|
| 120 |
raise RuntimeError(f"Failed to initialize DiT: {status_dit}")
|
| 121 |
|
| 122 |
logger.info(f" DiT initialized: {status_dit}")
|
| 123 |
+
str(checkpoints_dir)
|
| 124 |
# Initialize LLM handler (handles 5Hz Language Model)
|
| 125 |
logger.info(f"Initializing LLM handler with model: {lm_model_path}")
|
| 126 |
|