Add LEGO mode: generate instrument stems over a backing track#20
Closed
Add LEGO mode: generate instrument stems over a backing track#20
Conversation
Copilot
AI
changed the title
[WIP] Add LEGO mode support to project
Add LEGO mode: generate instrument stems over a backing track
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
--lego <track>todit-vae, enabling ACE-Step's LEGO pipeline: given a source audio file (--src-audio), generate a new instrument stem conditioned on it. Requires the base model (acestep-v15-base); turbo/SFT don't support it.Changes
tools/dit-vae.cpp—--lego <track>flag; constructs a"Generate the {track} track based on the audio context:"instruction injected into the DiT alongside--src-audio. Validates that--src-audiois present when--legois used.tools/ace-qwen3.cpp— simplify phase-2 batch generation: replace dynamic compaction with a fixed N-batch forward (cond + uncond as2*N), full CFG over allV_efflogits, mask the 24-token gap between EOS and audio codes with-1e9.examples/lego.json— preset (audio_cover_strength=1.0,inference_steps=50,guidance_scale=7.0).examples/lego.sh— self-contained 3-step pipeline: download base model → generate source track → apply lego.README.md— usage docs and available track name reference..github/workflows/ci-build.yml— exclude./mp3and./vendorfrom clang-format scan.Usage
./build/dit-vae \ --src-audio backing-track.wav \ --lego guitar \ --request examples/lego.json \ --text-encoder models/Qwen3-Embedding-0.6B-Q8_0.gguf \ --dit models/acestep-v15-base-Q8_0.gguf \ --vae models/vae-BF16.gguf \ --wavAvailable tracks:
vocals,backing_vocals,drums,bass,guitar,keyboard,percussion,strings,synth,fx,brass,woodwinds🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.