File size: 8,655 Bytes
f9202ba
5ec93f2
 
 
 
 
 
 
e9269a8
f9202ba
 
 
 
 
 
 
96b7763
5ec93f2
96b7763
90387e7
 
90dc6aa
90387e7
5ec93f2
96b7763
5ec93f2
 
 
 
96b7763
5ec93f2
96b7763
5ec93f2
96b7763
6e11387
 
 
5ec93f2
96b7763
5ec93f2
 
 
 
 
 
 
 
 
 
 
 
96b7763
5ec93f2
96b7763
5ec93f2
0abf683
5ec93f2
1c06d72
0abf683
 
5ec93f2
4bc8fbd
5ec93f2
 
 
 
4bc8fbd
5ec93f2
572b8f5
5ec93f2
572b8f5
5ec93f2
572b8f5
2779750
572b8f5
5ec93f2
 
 
572b8f5
5ec93f2
572b8f5
5ec93f2
572b8f5
144716b
b64f686
5ec93f2
12b5ef8
 
5ec93f2
86c2845
1b053c8
86c2845
5ec93f2
 
 
 
 
 
 
 
 
 
b21a336
1b053c8
86c2845
1b053c8
86c2845
1b053c8
 
 
 
 
 
 
5ec93f2
aa27650
1b053c8
 
 
 
 
5ec93f2
86c2845
 
1b053c8
5ec93f2
1b053c8
f9202ba
5ec93f2
 
 
 
 
 
 
 
f9202ba
 
 
5ec93f2
f9202ba
5ec93f2
f9202ba
5ec93f2
f9202ba
 
5ec93f2
f9202ba
 
5ec93f2
f9202ba
5ec93f2
f9202ba
5ec93f2
 
f9202ba
5ec93f2
f9202ba
5ec93f2
f5a9926
5ec93f2
 
 
f5a9926
6cfc3d6
 
 
 
 
7e03795
48aac14
f494e52
daf878c
f494e52
7e03795
6cfc3d6
 
 
 
7e03795
 
6cfc3d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
---
title: GhostAI Music Generator
emoji: 🎵
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: true
license: mit
language:
- en
tags:
- python
- ai
---

<div align="center">


*PUBLIC API BUILD
https://huggingface.co/ghostai1/GHOSTSONAFB/tree/main/public

# 🎵 GhostAI Music Generator 🎸

[![Python](https://img.shields.io/badge/Python-3.10-blue.svg)](https://www.python.org/downloads/)
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Hugging Face](https://img.shields.io/badge/Hugging%20Face-ghostai1%2FGHOSTSONAFB-yellow.svg)](https://huggingface.co/ghostai1/GHOSTSONAFB)
[![CUDA](https://img.shields.io/badge/CUDA-12.1%20%7C%2011.8-brightgreen.svg)](https://developer.nvidia.com/cuda-downloads)

**FULL API build [beta build] Optimized to handle full 30/60/180 second renders**

Generate high-quality instrumental tracks with Meta AI's MusicGen models!

EXAMPLE PRODUCTION
https://www.youtube.com/watch?v=O3yA6Q2oUkE

</div>

<div align="center">
  <table>
    <tr>
      <td align="center"><img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/-P3uQK1P_qP9F1GjzhgCm.png" width="200" height="200" alt="Interface 1" /></td>
      <td align="center"><img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/8oGZ0g0ZmKuYDp2tbwkf4.png" width="200" height="200" alt="Interface 2" /></td>
    </tr>
    <tr>
      <td align="center"><audio controls src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/RifW0nT3T-Y5Q3kawuHu2.mpga"></audio></td>
      <td align="center"><audio controls src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/eDd-f8QJiY4GeMJ8PG_22.mpga"></audio></td>
    </tr>
  </table>
</div>

🚀 **Updated Repo Alert! MUSIC GEN LARGE FULL API [BETA]🚀**

PYTHON/JS/BASH/CURL • No MCP AGENTIC YET, CLIENT APP UTILIZES AGENTIC MCP

![Interface 3](https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/60dwmLyHVadwom8v3DEzY.png)

https://huggingface.co/facebook/musicgen-large

**Massive SM80 build optimized for CUDA 12.1 & cuDNN 9!** 🛠️ 🎉 No dependencies, raw file update dropped in repo! 📂

🚫 **No MCP AGENTIC RAG AI API**—built for 3000 series GPUs with 12GB+ VRAM only. Don’t try 40xx/50xx, it’s a no-go! 😿  
🎵 **New SM80 build crafted for large music gen**—grab it from the repo! 🔗  
🐍 **Python 3.10 is the vibe**, 3.9 works but might be buggy 🐛  
🔥 **Get the update here**: https://huggingface.co/ghostai1/GHOSTSONAFB

⏭️ **Next update**: Higher link threading, supports up to 8 GTS, no Gen 4 yet. 50xx support? Maybe later!

**UPDATE FOUND HERE**: https://huggingface.co/ghostai1/GHOSTSONAFB/blob/main/STABLE12gb3060.py

**Scripts**: https://huggingface.co/ghostai1/GHOSTSONAFB/blob/main/stable12gblg30sec.py

<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/xdLE5yosDG_MtnzkyG4_L.mpga"></audio>

https://huggingface.co/facebook/musicgen-medium

![Waveform](https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/bVhLFORVf1p1A8VrXWZeB.png)

![Settings](https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/SbL9DMWRzEf47CqOJsq3i.png)

# Use huggingface-cli to sync

# 🎵 GhostAI Music Generator 🎸 & VOCAL UPDATE* barks.py 1.5B Optimized to run on 8GB Will release a Large model 12-24 GB soon UPDATE* Stable float16/32 working on INT8

https://huggingface.co/ghostai1/GHOSTSONAFB/blob/main/start_bash.sh  
# SH auto downloader dir etc get FB music perms from HF first

**FLOAT16/32 CUDA 11.8 & 12.1** 4bit for lower end 8 bit full

Welcome to the GhostAI Music Generator! This web-based tool utilizes Meta AI's `musicgen-medium` model to craft high-quality instrumental tracks across genres such as Rock, Techno, Jazz, Classical, and Hip-Hop. The application structures compositions with sections like intros, verses, and choruses, all accessible through an intuitive Gradio interface. Outputs are high-quality MP3 files at 320 kbps, complete with embedded metadata. To enhance audio quality, we've integrated processing features including equalization (EQ), a chorus effect, and peak limiting for a polished sound.

<div align="center">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/5PCpX_7Yuhs8S9BEDck_5.png" width="45%" alt="UI Preview">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/R-UxaeGKbM_tK6B7lCGIE.png" width="45%" alt="Output">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/LZkcrdpN5PQXOF4pj33bu.png" width="45%" alt="Controls">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/sIIjdL3it8MSw9w5XBz0q.png" width="45%" alt="Processing">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/HcBK7X9373CVYO5zyo4YL.png" width="45%" alt="Results">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/MoQb9arla6rXGepgFugNp.png" width="45%" alt="Analytics">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/b78antJwwWAx-jFfXoYHk.png" width="45%" alt="Performance">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/fzyGz3Ondrr_snqH8yHiG.png" width="45%" alt="CUDA Update">
</div>

## Project Evolution and Optimization

Initially, the project faced VRAM limitations on an NVIDIA RTX 3060 Ti with 7.69 GiB. To address this, we divided 30-second tracks into manageable chunks—first into three 10-second segments, then into two 15-second segments—to optimize memory usage. The Bark model was removed to focus solely on instrumental generation, and we standardized the output format to MP3 for broader compatibility. To achieve a more natural song flow, we varied prompts for each chunk. For instance, the first chunk might use "dynamic intro and expressive verse," while the second employs "powerful chorus and energetic outro," providing a realistic song structure.

Audio enhancements include:
- **EQ**: Low-pass filter at 6000 Hz and high-pass filter at 100 Hz.
- **Chorus Effect**: 20ms delay with a -4 dB gain.
- **Peak Limiting**: Strict limiting at -8.0 dB to control peaks.
- **Gain Adjustment**: +2 dB boost before crossfading to address amplitude dips.
- **Compression**: Removed to preserve dynamic range.

## 🖥️ System Requirements

- **Operating System**: Ubuntu (Note: Windows/macOS are untested).
- **GPU**: CUDA-capable GPU with at least 8 GB VRAM.
- **Python**: Version 3.10.
- **ffmpeg**: Installed for audio processing.

## ⚙️ Installation and Setup

1. **Clone the Repository**:
   ```bash
   git clone https://huggingface.co/ghostai1/ghostai-music-generator
   cd ghostai-music-generator


## ⚙️ Installation and Setup

1. Clone the Repository:
   git clone https://huggingface.co/ghostai1/ghostai-music-generator
   cd ghostai-music-generator

2. Set Up a Virtual Environment:
   python3 -m venv venv
   source venv/bin/activate

3. Install PyTorch (CUDA 12.1):
   pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu121
   For other CUDA versions, refer to https://pytorch.org/get-started/locally/.

4. Install Other Dependencies:
   pip install -r requirements.txt

5. Install ffmpeg:
   sudo apt-get install ffmpeg

6. Authenticate with Hugging Face:
   huggingface-cli login
   Retrieve token from https://huggingface.co/settings/tokens

7. Request Access to the Model:
   Visit https://huggingface.co/facebook/musicgen-medium and request access.

8. Download and Place Model Weights:
   mkdir -p /home/ubuntu/ghostai_music_generator/models/musicgen-medium
   Place the model weights in the directory above. Update local_model_path in app.py if stored elsewhere.

9. Run Setup Script:
   chmod +x start_bash.sh
   ./start_bash.sh



PRODUCTION EXAMPLE

![2025-10-24 01_16_02-PhantomTunes AI Music Creator — Mozilla Firefox](https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/m8LeCWkrZdlalF2-Dd89s.jpeg)
<div align="center">
 <h3> AI AGENTIC WIP </h3>

  ![cover_1761286626](https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/D-FyfW55Pp0rEYt2xkaM6.png)

</div>


<audio controls src="https://cdn-uploads.huggingface.co/production/uploads/6421b1c68adc8881b974a89d/c4PTKjFhjigwrCQR7TnHU.mpga"></audio>

https://www.mixcloud.com/ghostai/nightmarish-riffs/