Skip to content

Move lego mode from --lego <track> CLI flag to "lego" JSON request field#21

Merged
lmangani merged 2 commits intolego-modefrom
copilot/update-readme-for-lego-mode
Mar 10, 2026
Merged

Move lego mode from --lego <track> CLI flag to "lego" JSON request field#21
lmangani merged 2 commits intolego-modefrom
copilot/update-readme-for-lego-mode

Conversation

Copy link

Copilot AI commented Mar 10, 2026

Lego mode was configured via a CLI-only --lego <track> flag, inconsistent with all other generation parameters which live in the request JSON. This PR moves the track name into the request JSON as "lego": "<track>", enabling batch processing, persistent configs, and parity with repainting_start/repainting_end.

Request struct (src/request.h, src/request.cpp)

  • Added std::string lego field (default "") to AceRequest
  • Parse/write/dump support added alongside existing fields
  • "lego" is omitted from written JSON when empty (consistent with optional fields)

CLI (tools/dit-vae.cpp)

  • Removed --lego <track> option, lego_track variable, and CLI-level validation
  • Validation moved to per-request scope: requires --src-audio, base model, valid track name
  • audio_cover_strength forced to 1.0 automatically when "lego" is set
  • Empty caption now allowed when "lego" is non-empty

Examples

  • examples/lego.json: added "lego": "guitar", "lyrics": "[Instrumental]", removed manual audio_cover_strength
  • examples/lego.sh: removed --lego guitar CLI flag

README

  • Updated lego section to reflect JSON-based usage
  • Added "lego": "" to the JSON reference block
  • Added field documentation with valid track names and recommended settings

Usage:

{
    "caption": "electric guitar riff, funk, house music, instrumental",
    "lyrics": "[Instrumental]",
    "lego": "guitar",
    "inference_steps": 50,
    "guidance_scale": 7.0,
    "shift": 1.0
}
./build/dit-vae \
    --src-audio backing-track.wav \
    --request 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 \
    --wav

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: lmangani <1423657+lmangani@users.noreply.github.com>
Copilot AI changed the title [WIP] Update README with lego mode details Move lego mode from --lego <track> CLI flag to "lego" JSON request field Mar 10, 2026
@lmangani lmangani marked this pull request as ready for review March 10, 2026 20:39
@lmangani lmangani merged commit aaaa027 into lego-mode Mar 10, 2026
2 of 3 checks passed
lmangani added a commit that referenced this pull request Mar 10, 2026
* Add LEGO mode: generate instrumental stems over references (#19)

* Add LEGO mode: --lego <track> flag for dit-vae, example files, README docs

* Remove base model check from lego.sh

Removed the echo statement for ensuring the base model.

* Refactor lego.sh by removing echo statements

Removed echo statements for steps in the script.

* Implement error check for --lego with DiT model

Add error handling for --lego option requiring base DiT model

* Move lego mode from `--lego <track>` CLI flag to `"lego"` JSON request field (#21)

* apply requested changes

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
@lmangani lmangani deleted the copilot/update-readme-for-lego-mode branch March 13, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants