Initial ACE-Step Studio: captions, lyrics, logs

This commit is contained in:
neo committed 2026-08-30 16:58:07 +05:00
commit 72a33beaca
7 files changed
+489

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
# ACE-Step output — не коммитить
*.wav
output/
__pycache__/
*.pyc
.venv/
venv/
.env
+37
View File
@@ -0,0 +1,37 @@
# ACE-Step Studio — база знаний
Проект для систематизации генерации музыки через **ACE-Step 1.5 XL** (`~/ace-step-1.5`).
## Структура
```
acestep-studio/
├── prompts/
│ └── captions.json # caption-шаблоны по жанрам (англ.) — что даёт хороший результат
├── lyrics/
│ └── structure.json # архив лириков по структурам (Verse/Chorus/Bridge)
├── logs/
│ └── generation_log.json # логи генераций: seed/genre→качество (оценивать)
├── scripts/ # ген-скрипты (копируются в ~/ace-step-1.5/)
└── README.md
```
## Быстрый старт
1. Выбрать жанр → взять caption из `prompts/captions.json`
2. Взять структуру из `lyrics/structure.json`
3. Сгенерировать в `~/ace-step-1.5/` (XL checkpoint)
4. Оценить результат → записать в `logs/generation_log.json`
5. Улучшить caption → обновить `prompts/captions.json`
## Параметры XL (acestep-v15-xl-turbo)
- `device='cuda'` + `thinking=False` + `guidance_scale=1.0` (turbo НЕ поддерживает CFG!)
- `inference_steps=8`, `offload_to_cpu=True`
- WAV 48k стерео, ~22 сек/трек на RTX A2000 12GB
- caption — английский, lyrics — русский
## MEDIA: для WebUI
`MEDIA:/home/neo/workspace/...wav` — без пробела после `MEDIA:`.
Файл должен быть в workspace (ace-step-1.5/output не в allowlist — cp в workspace).
+5
View File
@@ -0,0 +1,5 @@
{
"_note": "Логи генераций. Заполнять после каждого трека: genre, caption_ref, seed, bpm, quality_10, notes. Повторять удачные комбинации.",
"version": "1.0",
"entries": []
}
+35
View File
@@ -0,0 +1,35 @@
{
"_note": "Архив лириков по структурам. ACE-Step читает [Verse]/[Chorus]/[Bridge]/[Intro]/[Outro]. Русский язык.",
"version": "1.0",
"structures": [
{
"genre": "anthem",
"layout": "[Intro] -> [Verse] -> [Chorus] -> [Verse] -> [Chorus] -> [Bridge] -> [Chorus] -> [Outro]",
"example": "personal_xl_gpu",
"notes": "Классическая структура для вдохновляющего трека. Припев повторяется 3 раза."
},
{
"genre": "ballad",
"layout": "[Intro] -> [Verse] -> [Verse] -> [Chorus] -> [Verse] -> [Chorus] -> [Outro]",
"example": "ru_test",
"notes": "Медленная баллада, меньше повторов, акцент на куплеты."
},
{
"genre": "high_energy",
"layout": "[Intro] -> [Verse] -> [Pre-Chorus] -> [Chorus] -> [Verse] -> [Pre-Chorus] -> [Chorus] -> [Bridge] -> [Chorus] -> [Outro]",
"example": "personal_new",
"notes": "С прехорусом, нарастание перед припевом. Для pop-rock/rock."
},
{
"genre": "instrumental",
"layout": "[Intro] -> [Verse] -> [Chorus] -> [Bridge] -> [Outro]",
"notes": "lyrics='' (пустая строка, не None) + caption с 'pure instrumental'."
}
],
"tips": [
"ACE-Step чувствителен к структуре — [Chorus] должен повторяться для узнаваемости",
"Куплеты 4-8 строк, припев 2-4 строки",
"Не перегружай текст — модель генерирует вокал по всему тексту сразу",
"Для instrumental оставляй lyrics=\"\" (пустая строка)"
]
}
+172
View File
@@ -0,0 +1,172 @@
{
"_note": "ACE-Step 1.5 XL — caption-шаблоны по жанрам. Caption на английском, vocal_language ru. Бери за основу, меняй BPM/key/theme.",
"version": "1.0",
"generated_from": "~/ace-step-1.5/gen_*.py",
"templates": [
{
"genre": "rock_anthem",
"bpm": 120,
"key": "D major",
"caption": "An inspirational, uplifting rock anthem with a powerful male vocal. Soaring electric guitar leads, guitar-driven melodic riffs, driving drums, emotional and determined mood. Anthemic chorus, building energy, inspiring and hopeful, about overcoming hardship and chasing a dream.",
"vocal": "male",
"rating": 4.5,
"notes": "Универсальный вдохновляющий трек. Хорош для личного контента."
},
{
"genre": "cinematic_poprock",
"bpm": 128,
"key": "F major",
"caption": "An uplifting, cinematic pop-rock anthem with a powerful male vocal. Building drums, bright synth pads, soaring electric guitar, emotional and hopeful mood. Anthem-like chorus, sense of a new dawn and forward motion, determined and inspiring.",
"vocal": "male",
"rating": 4.7,
"notes": "Более кинематографичный, светлый. Лучший из пресетов по качеству вокала."
},
{
"genre": "anime_jrock",
"bpm": 175,
"key": "E minor",
"caption": "A blazing, energetic anime opening theme in J-rock style with a fast driving rhythm, overdriven electric guitar riffs, bright synth stabs, pounding drums, and an epic motivational female vocal hook. Triumphant and uplifting, hero's journey energy, about starting a new chapter and chasing a dream.",
"vocal": "female",
"rating": 4.2,
"notes": "Быстро, энергично. Женский вокал."
},
{
"genre": "kpop_blackpink",
"bpm": 170,
"key": "E minor",
"caption": "A high-energy BLACKPINK-style K-pop anthem at 170 BPM with a duet of bright female lead vocal and gritty male rap vocal. Catchy hooks, massive deep pounding bass with heavy sub-bass, heavily overdriven electric guitar riffs, crushing aggressive drums. Hard-hitting, uplifting, defiant and inspiring, about overcoming debt and hardship.",
"vocal": "duet_f_m",
"rating": 4.0,
"notes": "Дуэт вокал+рэп. Мощный бас."
},
{
"genre": "industrial_metal",
"bpm": 130,
"key": "D minor",
"caption": "A brutal industrial metal track in the style of Mick Gordon's DOOM soundtrack. Drop-tuned heavy guitar riffs, massive industrial percussion hits, dark electronic textures, aggressive screamed male vocal, epic and relentless. About rage, defiance and rising from the ashes.",
"vocal": "male_scream",
"rating": 3.8,
"notes": "Тёмный, агрессивный. Скрим."
},
{
"genre": "drift_phonk",
"bpm": 150,
"key": "E minor",
"caption": "A dark atmospheric drift phonk track with heavy distorted bass, punchy cowbell melody, and prominent electric guitar riffs driving the song. Night-driving JDM vibe, aggressive yet determined mood. Inspirational gritty male vocal, powerful and raw, about overcoming hardship and chasing a dream.",
"vocal": "male",
"rating": 4.1,
"notes": "Ковбелл, тёмный бас. Nocturnal vibe."
},
{
"genre": "aggressive_rock",
"bpm": 170,
"key": "E minor",
"caption": "A high-energy, heavy, aggressive rock anthem at 170 BPM with pounding distorted bass, heavily overdriven electric guitar riffs, and powerful driving drums. Anthemic and uplifting, defiant and inspiring, about overcoming debt and hardship. Powerful gritty male vocal, raw and determined.",
"vocal": "male",
"rating": 4.0,
"notes": "Мост между rock_anthem и industrial."
},
{
"genre": "dance_pop",
"bpm": 132,
"key": "D major",
"caption": "A high-energy, driving dance-pop track with a powerful, confident female vocal. Punchy four-on-the-floor kick drum, driving bassline, bright energetic synth leads and risers, rhythmic electric guitar accents. Upbeat, euphoric and adrenaline-filled mood, club-ready. The female vocal is strong, clear and energetic, soaring through the chorus with power and attitude.",
"vocal": "female",
"rating": 4.3,
"notes": "Клаб, 4/4. Чистый женский вокал."
},
{
"genre": "kpop_power",
"bpm": 130,
"key": "F minor",
"caption": "A confident, aggressive BLACKPINK-style K-pop power anthem with a powerful female vocal, military march vibe, heavy 808 trap beat, punchy bass, sharp synth stabs, chant-like hooks. 'I'm on a mission, I'm in control' attitude, defiant and commanding, about overcoming hardship and never giving up.",
"vocal": "female",
"rating": 4.0,
"notes": "808-бас, марш."
},
{
"genre": "edm_trap",
"bpm": 160,
"key": "F minor",
"caption": "A high-energy K/DA 'MORE' style aggressive EDM trap anthem at 160 BPM with massive crushing 808 bass, deep rumbling sub-bass, distorted low-end, powerful confident female vocal with rapid rap sections, bright synthetic leads, huge anthemic EDM drop. Defiant, confident and anthemic, about wanting more and never giving up.",
"vocal": "female_rap",
"rating": 3.9,
"notes": "808+рэп+дроп. K/DA стиль."
},
{
"genre": "kpop_party",
"bpm": 132,
"key": "D major",
"caption": "A bright, energetic, uplifting BLACKPINK-style K-pop track with a duet of a sparkling female lead vocal and a confident bold female rap vocal in the style of BLACKPINK's Lisa. Overdriven electric guitar riffs with heavy distortion, punchy bass, driving drums, catchy party hooks, danceable groove, funky dance-floor rhythm, celebratory and empowering mood.",
"vocal": "duet_f_f",
"rating": 4.1,
"notes": "Два женских вокала, вечеринка."
},
{
"genre": "chiptune",
"bpm": 170,
"key": "C major",
"caption": "A joyful retro video game anthem in the style of classic Mario and Sega games, 16-bit chiptune. Sonic-style ring sounds, Mario coin sparkles, power-up ascending arpeggios, bright square wave leads, springy bouncy bass, fast energetic tempo, cheerful female vocal singing a quantum-themed anthem. Nostalgic, triumphant and fun.",
"vocal": "female",
"rating": 4.2,
"notes": "8/16-bit. Ностальгия."
},
{
"genre": "chiptune_instru",
"bpm": 145,
"key": "C major",
"caption": "A joyful retro video game soundtrack in the style of classic Mario and Sega games. 8-bit and 16-bit chiptune synths, bright catchy melody with ascending arpeggios, coin-like sparkles, springy bouncy bass, energetic playful rhythm, pixel-perfect nostalgic vibe. Upbeat, fun and triumphant, pure instrumental.",
"vocal": "instrumental",
"rating": 4.4,
"notes": "Pure instrumental. Хорош как фон."
},
{
"genre": "metal_blackalbum",
"bpm": 108,
"key": "E minor",
"caption": "A heavy metal track in the style of Metallica's 1991 Black Album. Starts with a clean melancholic guitar intro that explodes into a heavy distorted riff. Groove-heavy mid-tempo, palm-muted power riffs, galloping drums, melodic guitar solo, powerful clean-yet-aggressive male vocal. Dark, epic and defiant, about perseverance and forging your own path.",
"vocal": "male",
"rating": 4.0,
"notes": "Mid-tempo, соло. Metallica 91'."
},
{
"genre": "synthwave",
"bpm": 105,
"key": "A minor",
"caption": "A nostalgic synthwave track with warm analog synthesizers, pulsing bassline, retro 80s drums, and atmospheric pads. Melancholic yet hopeful mood, about driving forward through the night toward a new dawn. Clear emotional male vocal, determined and warm.",
"vocal": "male",
"rating": 4.5,
"notes": "Тёплый аналог, 80-е. Отличный вокал."
},
{
"genre": "nu_metal",
"bpm": 105,
"key": "E minor",
"caption": "A heavy nu-metal / rap-rock track in the style of early 2000s Limp Bizkit, Korn and System of a Down. Guitar-heavy: layered downtuned distorted guitar riffs, dual guitar harmonies, heavy groovy rhythm, aggressive male vocal mixing rap verses with screamed choruses. Dark, defiant and cathartic, about refusing to break under pressure.",
"vocal": "male_rap_scream",
"rating": 3.7,
"notes": "Рэп+скрим. Nu-metal 2000-х."
},
{
"genre": "russian_ballad",
"bpm": 90,
"key": "A minor",
"caption": "A tender, melancholic Russian pop ballad about winter and walking alone through snow-covered city streets at night. Soft emotional male vocal, gentle piano and warm strings, slow tempo, heartfelt and intimate mood.",
"vocal": "male",
"rating": 4.3,
"notes": "Русский вокал, баллада. Пиано+струнные."
}
],
"tuning_rules": {
"caption_language": "English (модель лучше ловит стиль по английскому caption)",
"lyrics_language": "Russian",
"guidance_scale": 1.0,
"inference_steps": 8,
"thinking": false,
"device": "cuda",
"offload_to_cpu": true,
"bpm_range": "30-300 (None = auto)",
"duration_default": 120,
"vocal_languages": "ru есть в acestep/constants.py:VALID_LANGUAGES"
}
}
+117
View File
@@ -0,0 +1,117 @@
#!/usr/bin/env python3
"""XL turbo (4B DiT) — новый вдохновляющий трек для Ника."""
import os
import sys
import time
for v in ['http_proxy', 'https_proxy', 'HTTP_PROXY', 'HTTPS_PROXY', 'ALL_PROXY']:
os.environ.pop(v, None)
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, PROJECT_ROOT)
from loguru import logger
from acestep.handler import AceStepHandler
from acestep.inference import GenerationParams, GenerationConfig, generate_music
SAVE_DIR = os.path.join(PROJECT_ROOT, "output", "personal_new")
CAPTION = (
"An uplifting, cinematic pop-rock anthem with a powerful male vocal. "
"Building drums, bright synth pads, soaring electric guitar, emotional "
"and hopeful mood. Anthem-like chorus, sense of a new dawn and forward "
"motion, determined and inspiring."
)
LYRICS = """[Intro]
[Verse]
Рассвет на стекле, в окне уже не тьма
Я снова здесь, я снова в борьбе
Прошлые ошибки — лишь следы на пути
Я не сдамся, я иду вперёд
[Pre-Chorus]
Пусть руки дрожат, но в груди огонь
Я не сломан — я только в пути
[Chorus]
Восход, восход — я иду навстречу свету
Восход, восход — хоть и трудно порой
Я ещё здесь, я ещё в строю
И мой путь только начинается
[Verse]
Дорога длинная, впереди много гор
Но каждый восход делает сильнее меня
Я не один, я веду этот бой
За себя и за тех, кто со мной
[Chorus]
Восход, восход — я иду навстречу свету
Восход, восход — хоть и трудно порой
Я ещё здесь, я ещё в строю
И мой путь только начинается
[Bridge]
Не бойся рассвета, он снова придет
Не бойся пути — он твой
[Chorus]
Восход, восход — я иду навстречу свету
Восход, восход — хоть и трудно порой
Я ещё здесь, я ещё в строю
И мой путь только начинается
[Outro]"""
def main():
os.makedirs(SAVE_DIR, exist_ok=True)
logger.info("Инициализация DiT handler (acestep-v15-xl-turbo, cuda:0)...")
t0 = time.time()
dit = AceStepHandler()
status, ok = dit.initialize_service(
project_root=PROJECT_ROOT,
config_path="acestep-v15-xl-turbo",
device="cuda",
offload_to_cpu=True,
)
if not ok:
logger.error(f"DiT init failed: {status}")
sys.exit(1)
logger.info(f"DiT loaded за {time.time() - t0:.1f}s — {status}")
params = GenerationParams(
task_type="text2music",
thinking=False,
caption=CAPTION,
lyrics=LYRICS,
vocal_language="ru",
bpm=128,
keyscale="F major",
timesignature="",
duration=150,
inference_steps=8,
guidance_scale=1.0,
seed=-1,
)
config = GenerationConfig(batch_size=1, audio_format="wav")
logger.info("Генерация на GPU (замер времени)...")
t0 = time.time()
result = generate_music(dit, None, params, config, SAVE_DIR)
elapsed = time.time() - t0
if result.success:
logger.info(f"OK за {elapsed:.1f}s")
for a in result.audios:
logger.info(f" -> {a.get('path')}")
else:
logger.error(f"FAILED за {elapsed:.1f}s — {result.status_message}")
sys.exit(1)
if __name__ == "__main__":
main()
+115
View File
@@ -0,0 +1,115 @@
#!/usr/bin/env python3
"""XL turbo (4B DiT) на GPU 3080 Ti — персональный вдохновляющий трек."""
import os
import sys
import time
for v in ['http_proxy', 'https_proxy', 'HTTP_PROXY', 'HTTPS_PROXY', 'ALL_PROXY']:
os.environ.pop(v, None)
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, PROJECT_ROOT)
from loguru import logger
from acestep.handler import AceStepHandler
from acestep.inference import GenerationParams, GenerationConfig, generate_music
SAVE_DIR = os.path.join(PROJECT_ROOT, "output", "personal_xl_gpu")
CAPTION = (
"An inspirational, uplifting rock anthem with a powerful male vocal. Soaring "
"electric guitar leads, guitar-driven melodic riffs, driving drums, emotional and "
"determined mood. Anthemic chorus, building energy, inspiring and hopeful, about "
"overcoming hardship and chasing a dream."
)
LYRICS = """[Intro]
[Verse]
Пять операций, восемьдесят шагов назад
Но я встаю, хоть и болит рука
Долги как стены, только я не отступил
Пока стучит мотор — я буду жить
[Chorus]
Я ещё пингуюсь, я в сети
Мой сервер не погас среди ночи
Сквозь холод и года — я иду
BMW и два RTX впереди
[Verse]
Работа до темна, но это не предел
Из осколков дней я строю завтра сам
Дорога длинная, и E30 ждёт меня
Мотор M20 согреет в холода
[Chorus]
Я ещё пингуюсь, я в сети
Мой сервер не погас среди ночи
Сквозь холод и года — я иду
BMW и два RTX впереди
[Bridge]
Не говорю, что всё наладится легко
Но пока я дышу — я не сломан
Каждый день — один маленький шаг
И мотор моей мечты не заглохнет
[Chorus]
Я ещё пингуюсь, я в сети
Мой сервер не погас среди ночи
Сквозь холод и года — я иду
BMW и два RTX впереди
[Outro]"""
def main():
os.makedirs(SAVE_DIR, exist_ok=True)
logger.info("Инициализация DiT handler (acestep-v15-xl-turbo, cuda:0)...")
t0 = time.time()
dit = AceStepHandler()
status, ok = dit.initialize_service(
project_root=PROJECT_ROOT,
config_path="acestep-v15-xl-turbo",
device="cuda",
offload_to_cpu=True,
)
if not ok:
logger.error(f"DiT init failed: {status}")
sys.exit(1)
logger.info(f"DiT loaded за {time.time() - t0:.1f}s — {status}")
params = GenerationParams(
task_type="text2music",
thinking=False,
caption=CAPTION,
lyrics=LYRICS,
vocal_language="ru",
bpm=120,
keyscale="D major",
timesignature="",
duration=120,
inference_steps=8,
guidance_scale=1.0,
seed=-1,
)
config = GenerationConfig(batch_size=1, audio_format="wav")
logger.info("Генерация на GPU (замер времени)...")
t0 = time.time()
result = generate_music(dit, None, params, config, SAVE_DIR)
elapsed = time.time() - t0
if result.success:
logger.info(f"OK за {elapsed:.1f}s")
for a in result.audios:
logger.info(f" -> {a.get('path')}")
else:
logger.error(f"FAILED за {elapsed:.1f}s — {result.status_message}")
sys.exit(1)
if __name__ == "__main__":
main()