Skip to main content

music-generation-mcp

Local BGM and vocal theme-song generation for the webcomic/anime pipeline, via ComfyUI's native ACE-Step support. Hands back a lossless .flac and a Remotion-ready .mp3 from one generation pass.

This closes the last outsourced step in the video pipeline. The anime-production skill has always played an mp3 but never made one — the mp3 came from Suno, a paid cloud service, which is exactly the dependency this ecosystem exists to avoid (same category as Kling for video and meshy.ai for props). Everything here runs on your own GPU at zero per-call cost. See ARCHITECTURE.md §7a.

Scope guard: generation and beat analysis only. Mixing, mastering and stem separation are a different product.

Why ACE-Step

It is the only strong open local model that does songs with vocals. MusicGen and Stable Audio Open are instrumental-only — fine for BGM, useless for a theme song. No custom ComfyUI nodes are needed: ACE-Step 1.0 and 1.5 are both in ComfyUI core as of 0.25. (Contrast the LTX video install, which needed third-party GGUF loaders.)

Variants

Two generations of the model, both supported; pick with variant=.

1.5 (default) 1.0
Files 4 split files, 10.0 GB one all-in-one checkpoint, 7.7 GB
Controls tags, lyrics, language, bpm, key/scale, time signature, duration tags, lyrics, lyrics_strength
Voice steering ReferenceTimbreAudio (experimental) —
Loader UNETLoader + DualCLIPLoader(type="ace") + VAELoader CheckpointLoaderSimple
Speed turbo — few steps standard

1.5 is the default because of language. The first real target for this server is a Japanese vocal track, and 1.0 has no way to declare the language — it infers it from the lyric script. 1.5's explicit bpm also matters downstream: extract_beats detects tempo after the fact, but the video pipeline wants cuts pinned to downbeats, and specifying 150 BPM at generation beats measuring it afterward.

1.5 is the larger download, not the smaller one — it needs two text encoders (a 0.6b base/lyrics encoder that is always loaded, plus a larger Qwen that acts as a separate audio-code LLM). Keep 1.0 in mind as the fallback if 1.5's Japanese vocals disappoint on a small card.

memory_usage_factor in ComfyUI's supported_models.py reads 4.7 for 1.5 against 0.5 for 1.0, which looks alarming and is not. The factors multiply different latent shapes: for a 120-second track, 1.0's latent is [1,8,16,1292] → ~207 MB attention working set, and 1.5's is [1,64,3000] → ~282 MB. Comparable. Weight streaming under --lowvram, not attention, is the real constraint on 6 GB.

Models

Download into your ComfyUI tree, then restart ComfyUI — it caches some folder listings at startup, so a freshly-added model can stay invisible until it does. check_status reports what is missing.

ACE-Step 1.5 — from Comfy-Org/ace_step_1.5_ComfyUI_files:

File → ComfyUI/models/ Size
split_files/diffusion_models/acestep_v1.5_turbo.safetensors diffusion_models/ 4.79 GB
split_files/text_encoders/qwen_0.6b_ace15.safetensors text_encoders/ 1.19 GB
split_files/text_encoders/qwen_1.7b_ace15.safetensors text_encoders/ 3.71 GB
split_files/vae/ace_1.5_vae.safetensors vae/ 0.34 GB

ACE-Step 1.0 (optional fallback) — all_in_one/ace_step_v1_3.5b.safetensors from Comfy-Org/ACE-Step_ComfyUI_repackaged into checkpoints/, 7.7 GB.

Install

From PyPI (simplest)

With uv installed, there is nothing to clone:

claude mcp add -s user music-generation -- uvx music-generation-mcp

or pip install music-generation-mcp and register the music-generation-mcp command. The package is the server only. It does not include ComfyUI or the ACE-Step model files: ComfyUI 0.25+ and the files listed under "Models" above are still required, and COMFY_URL / WEBCOMIC_MUSIC_COMFY_DIR point the server at them. Installed this way, the track library goes to ~/music-generation-mcp/output.

extend_track also needs a small ComfyUI add-on. The package carries it; copy it into ComfyUI with

music-generation-install-nodes "C:/path/to/ComfyUI_windows_portable"

(the folder that holds ComfyUI/; it defaults to WEBCOMIC_MUSIC_COMFY_DIR), then restart ComfyUI. Everything else works without the add-on.

From the repo

cd servers/music-generation-mcp
python -m venv .venv
.venv/Scripts/python.exe -m pip install -r requirements.txt
.venv/Scripts/python.exe test_graph.py     # offline, no GPU needed

Register with your harness (stdio):

{
  "mcpServers": {
    "music-generator": {
      "command": "C:/Users/<you>/webcomic-toolkit/servers/music-generation-mcp/.venv/Scripts/python.exe",
      "args": ["C:/Users/<you>/webcomic-toolkit/servers/music-generation-mcp/server.py"]
    }
  }
}

Tools

Tool What it does
generate_track One track. Blocking, minutes on a 6 GB card.
generate_variations Re-run a track's recipe under new seeds — the audition loop.
extend_track A longer version of an existing track: keep its opening, ACE-Step writes on from there (needs the add-on below).
list_tracks Terse listing (id, title, duration, mp3 path).
get_track One track's full recipe and file paths.
approve_track Lock a take as canon and publish it as FINAL_<slug>.*.
forget_track Delete a take. Refuses the approved one.
extract_beats Beat grid + energy envelope, so video cuts land on downbeats.
check_status ComfyUI reachable? VRAM? Which model files are missing?

Extending a track

Asking for a longer duration does not lengthen a song: ACE-Step plans the whole piece for the length it is given, so a 240 s request is a different song. extend_track uses ACE-Step 1.5's own repaint inputs instead (the source as src_latents, a mask over the new section), so the model writes the new part with the old one in view: same key, tempo, voice and sound. Pass the whole song's lyrics (the original lines first, then the new sections), a total duration up to 240 s, and optionally keep_seconds; cutting before the old ending lets the song carry on from its body instead of after a fade-out. The kept stretch is the original recording, spliced back in with a 0.25 s crossfade (through the VAE alone it measured 0.979 correlation, not exact).

ComfyUI's ACE-Step port has those inputs but never connects them, so this needs a small add-on, installed once:

.venv/Scripts/python.exe tools/install_comfy_nodes.py     # copies comfy_nodes/ace_extend into ComfyUI

Restart ComfyUI afterward; check_status reports extend_addon_loaded. The add-on replaces ComfyUI's ACE-Step 1.5 forward with a copy that accepts the two inputs, and refuses to load if a ComfyUI update has changed that function. Tested on the turbo model: the kept stretch matched the source exactly after splicing, and the new stretch played at full level (judge the music by ear). tools/test_extend_live.py <track_id> reruns that check.

Approving a take

Track ids carry a timestamp, so auditioning cannot overwrite a good take — but that makes them a poor handle for downstream tools, which should not need to know that full_bminor_107s_20260807_004333 is "the theme song". approve_track publishes the winner under a stable name at the project root:

output/<project>/FINAL_theme.mp3          <- point Remotion here
output/<project>/FINAL_theme.flac
output/<project>/FINAL_theme_beats.json

The FINAL_ prefix is the same convention the panel pipeline uses, and this repo's standing rule is that generated attempts under output/ may be bulk-deleted freely while an approved FINAL_ never is — so the existing protection applies without anyone having to remember. forget_track enforces it in code as well, refusing to delete an approved take.

Output layout

output/
  tracks.json                     the library manifest
  <project>/<track_id>/
    <track_id>.flac               lossless keep
    <track_id>.mp3                Remotion drop-in
    <track_id>.json               the recipe — every parameter, reproducible
    beats.json                    written by extract_beats

Track ids carry a timestamp. Auditioning produces many takes of one title, and a good take being silently overwritten by a worse one is the expensive failure.

Working notes

  • ComfyUI runs prompts serially. Submit one generation at a time; a stacked job just burns its timeout waiting in the queue.
  • Songs need auditioning — one take is never enough. Generate, listen, then generate_variations on whichever came closest. Iteration costs GPU-minutes (free, local), not tokens: the reviewer is your ears, and the model never has to "listen back".
  • Hunt directions at short durations. 20-30 s settles whether a tags string is going anywhere. Commit to 120 s once it is.
  • Sampling defaults are starting points, not verified settings. steps, cfg, sampler and scheduler in ace_workflow.VARIANTS have not been swept on this hardware. tools/ace_run.py is the sweep harness — the same role ltx_run.py played when it found LTX's real settings. Write what you learn into the repo's AGENTS.md.
  • Judge by ear. There is no motion-metric equivalent here, and no spectral statistic tells you whether you like the vocal — which is the whole reason this server exists.

extract_beats — pure Python, no Node and no ffmpeg

tools/beats.py is a port of the anime-production skill's extract-beats.mjs onto the same numpy + soundfile path analyze_reference.py uses. Same algorithm, same output schema, so the JSON stays a drop-in for Remotion.

The port exists because the .mjs decodes via ffmpeg, which this machine does not have and which the author declined to install. soundfile bundles libsndfile and reads MP3/FLAC/WAV/OGG directly, so this needs nothing that was not already required. The skill keeps its own .mjs — it finds ffmpeg inside Remotion's bundled compositor package — so the video pipeline is unaffected. Two implementations of one algorithm: fix a bug in one, port it to the other.

Pass bpm when you know it. For tracks this server generated, tempo was an input, so extract_beats reads it from the recipe instead of detecting it — exact by construction. Detection is for reference tracks and outside audio.

Environment

Variable Default Meaning
COMFY_URL http://127.0.0.1:8188 ComfyUI endpoint (shared with the sibling servers by convention).
WEBCOMIC_MUSIC_COMFY_DIR C:\AI\ComfyUI_windows_portable For auto-launch.
WEBCOMIC_MUSIC_COMFY_LAUNCH run_nvidia_gpu.bat Launcher script.
WEBCOMIC_MUSIC_AUTOLAUNCH 1 Set 0 to require ComfyUI already running.
WEBCOMIC_MUSIC_TIMEOUT 1800 Seconds to wait for one generation.
WEBCOMIC_MUSIC_OUTPUT ./output Track library root (~/music-generation-mcp/output when installed from PyPI).

There is no ffmpeg setting. extract_beats reads audio through soundfile, so there is no binary to point at.

Integration

Fills the empty "video": { "music": "" } field in a project manifest (ARCHITECTURE.md §6), and pairs with the anime-production skill's beat-sync — the existing teaser already lands cuts on downbeats at 0.0 ms error against a 150 BPM track.

Metadata

Release files for music-generation-mcp 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for music-generation-mcp 0.4.0
File Size Uploaded Provenance Actions
music_generation_mcp-0.4.0.tar.gz 47.4 kB With provenance Details for music_generation_mcp-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for music-generation-mcp 0.4.0
File Interpreter ABI Platform Actions
music_generation_mcp-0.4.0-py3-none-any.whl Python 3 none any Details for music_generation_mcp-0.4.0-py3-none-any.whl

Total release size: 98.2 kB

Release files / music_generation_mcp-0.4.0.tar.gz

Download URL music_generation_mcp-0.4.0.tar.gz
Size 47.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9c18d74df4d4324114402d994761506a6d054df044869a0644c2232b4c78148a
BLAKE2b-256 checksum
How to use checksums
d4a6aa0a3ab912836604873bb9791c276bc2114a165db6aef4832782e4abd760
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / music_generation_mcp-0.4.0-py3-none-any.whl

Download URL music_generation_mcp-0.4.0-py3-none-any.whl
Size 50.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9bdd0050da48e1bd2ea9271fab15a9d881acd88ae9042eee7814c514f5beffe
BLAKE2b-256 checksum
How to use checksums
1928e6f0b6d60668741da0eb858cc73fa999b86d2a23cb36eead14ab8c4727bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for music-generation-mcp 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for music_generation_mcp-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page