Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse filesFiles changed (3)
- README.md+33-8
- app.pyAdded+225
- requirements.txtAdded+4
12345678910111213---title: Audio Studioemoji: πcolorFrom: graycolorTo: indigosdk: gradiosdk_version: 6.20.0python_version: '3.13'app_file: app.pypinned: false---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference1234567891011121314151617181920212223242526272829303132333435363738---title: audio-studioemoji: π΅colorFrom: purplecolorTo: bluesdk: gradiosdk_version: 6.15.1app_file: app.pyshort_description: Local music generation studio wrapping ACE-Step 1.5python_version: "3.12"---# audio-studioLocal music generation studio wrapping **ACE-Step 1.5**. Text-to-music, reference-audio melody borrowing, and reference-audio cover generation, with configurable artist/album/track/genre texture hints.## Features- Text-to-music generation- Melody borrowing from reference audio- Cover mode (full sound/texture conditioning)- Configurable texture hints (artist, album, track, genre)- Two backends: `mlx-serve` (default) and `ace-step`## Quick Start```bashgit clone https://github.com/sm3222/audio-studio.gitcd audio-studiouv syncmlx-serve serve --port 8082 --model-dir ~/.mlx-serve/modelsuv run audio-studio "a calm piano piece" --output out.wav```## Links- [GitHub Repository](https://github.com/sm3222/audio-studio)- [ACE-Step 1.5 Paper](https://arxiv.org/abs/2503.02057)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225import gradio as gr
DESCRIPTION = """# audio-studio
Local music generation studio wrapping **ACE-Step 1.5**.
Text-to-music, reference-audio melody borrowing, and reference-audio cover generation,with configurable artist/album/track/genre texture hints.
## Features
- **Text-to-music**: Describe what you want, get a WAV file- **Melody borrowing**: Provide a reference audio to borrow its BPM, key, and duration- **Cover mode**: Full sound/texture conditioning from a reference (requires ace-step backend)- **Texture hints**: Artist, album, track, and genre hints appended to prompts- **Two backends**: `mlx-serve` (default, ~2.9GB) or `ace-step` (~17.8GB, for cover mode)
## Quick Start
```bash# Clone and setupgit clone https://github.com/sm3222/audio-studio.gitcd audio-studiouv sync
# Start the backend ( mlx-serve by default)mlx-serve serve --port 8082 --model-dir ~/.mlx-serve/models
# Generate musicuv run audio-studio "a calm piano piece" --artist "Bob Marley" --output out.wav```
## Links
- [GitHub Repository](https://github.com/sm3222/audio-studio)- [ACE-Step 1.5 Paper](https://arxiv.org/abs/2503.02057)- [mlx-serve](https://github.com/lucasnewman/mlx-serve)"""
EXAMPLE_PROMPTS = [ "a calm piano piece with soft strings", "upbeat electronic dance music with synth leads", "acoustic folk guitar with gentle vocals", "heavy rock drums with distorted guitar riffs", "ambient atmospheric soundscape with pads",]
def build_command(prompt, artists, albums, tracks, genres, live, instrumental, backend, reference, cover): """Build the CLI command from user inputs.""" parts = ["uv run audio-studio"]
if prompt: parts.append(f'"{prompt}"')
for artist in artists.split(","): artist = artist.strip() if artist: parts.append(f'--artist "{artist}"')
for album in albums.split(","): album = album.strip() if album: parts.append(f'--album "{album}"')
for track in tracks.split(","): track = track.strip() if track: parts.append(f'--track "{track}"')
for genre in genres.split(","): genre = genre.strip() if genre: parts.append(f'--genre "{genre}"')
if live: parts.append("--live")
if not instrumental: parts.append("--no-instrumental")
if backend != "mlx-serve": parts.append(f"--backend {backend}")
if reference: parts.append(f'--reference "{reference}"')
if cover: parts.append("--cover")
parts.append("--output out.wav") return " \\\n ".join(parts)
with gr.Blocks( title="audio-studio", theme=gr.themes.Soft(),) as demo: gr.Markdown(DESCRIPTION)
with gr.Tab("Command Builder"): with gr.Row(): with gr.Column(): prompt = gr.Textbox( label="Prompt", placeholder="Describe the music you want to generate...", lines=3, ) artists = gr.Textbox( label="Artists (comma-separated)", placeholder="e.g., Bob Marley, Lee Perry", ) albums = gr.Textbox(label="Albums (comma-separated)") tracks = gr.Textbox(label="Tracks (comma-separated)") genres = gr.Textbox(label="Genres (comma-separated)")
with gr.Column(): live = gr.Checkbox(label="Live performance texture", value=False) instrumental = gr.Checkbox(label="Instrumental (no vocals)", value=True) backend = gr.Radio( choices=["mlx-serve", "ace-step"], value="mlx-serve", label="Backend", ) reference = gr.Textbox( label="Reference audio path (optional)", placeholder="/path/to/reference.wav", ) cover = gr.Checkbox( label="Cover mode (requires ace-step backend)", value=False, )
build_btn = gr.Button("Build Command", variant="primary") command_output = gr.Code(label="Generated Command", language="bash")
build_btn.click( fn=build_command, inputs=[prompt, artists, albums, tracks, genres, live, instrumental, backend, reference, cover], outputs=command_output, )
gr.Examples( examples=[[p] for p in EXAMPLE_PROMPTS], inputs=prompt, label="Example Prompts", )
with gr.Tab("Examples"): gr.Markdown("""## Example Generations
```bash# Simple text-to-musicuv run audio-studio "a calm piano piece" --output out.wav
# With artist hintsuv run audio-studio "heavy drums and bass" --artist "Bob Marley" --output out.wav
# With reference audio (melody only)uv run audio-studio "electronic remix" --reference original.wav --output out.wav
# Full cover mode (requires ace-step backend)uv run audio-studio "jazz cover" --reference original.wav --cover --backend ace-step --output out.wav
# Multiple hintsuv run audio-studio "ambient soundscape" \\ --artist "Lee Perry" \\ --genre "ambient" \\ --live \\ --output out.wav```
## Texture Hints
Edit `config/hints.json` to add your own artist/album/track/genre hints:
```json{ "artist": { "bob marley": "heavy acoustic drums, analog tape echo", "lee perry": "heavy acoustic drums, analog tape echo" }, "genre": { "ambient": "atmospheric pads, reverb-heavy, slow evolution" }}```""")
with gr.Tab("Architecture"): gr.Markdown("""## Architecture
```audio-studio/βββ src/audio_studio/β βββ cli.py # CLI entrypointβ βββ prompt.py # Prompt construction with hintsβ βββ analysis.py # Reference audio analysis (librosa)β βββ loop.py # Generation loop (submit β poll β download)β βββ acestep_client.py # ACE-Step API clientβ βββ mlx_serve_client.py # mlx-serve API clientβββ config/hints.json # Texture hint definitionsβββ output/ # Generated WAV files```
## Backends
| Backend | Memory | Cover Mode | Notes ||---------|--------|------------|-------|| `mlx-serve` | ~2.9GB | No | Default, MLX-native, fast || `ace-step` | ~17.8GB | Yes | Original PyTorch/MPS, heavy |
## Dependencies
- Python 3.12+- librosa (audio analysis)- mlx-serve or ace-step API server running- See `pyproject.toml` for full list""")
if __name__ == "__main__": demo.launch(mcp_server=True)1234librosa>=0.10requests>=2.31numpy>=1.26soundfile>=0.12README.md+33-8
app.pyAdded+225
requirements.txtAdded+4