feat(settings): separation quality (--shifts) setting - #308
Merged
Conversation
Adds a "Standard" / "Best (2x slower)" separation quality setting, following the demucs_device runtime-settings pattern exactly (app/core/settings.py get/set + env seed, app/main.py payload + POST handler with 422 on an invalid choice). "Best" appends --shifts 2 to the demucs invocation: separation runs twice on a randomly time-shifted copy of the input and averages the two passes -- measurably cleaner stems, ~2x the separation time. Applies on any device; a CPU user who opts in accepts the wait knowingly. Settings UI: new select next to Compute device on the General tab, wired the same way as the export sample rate / video height selects.
5 tasks
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.
Summary
PR-3D of Phase 3 (Performance) -- the
--shiftsroadmap item from #274.app/core/settings.py:get_separation_quality()/set_separation_quality(v), choices("standard", "best"), defaultstandard, env seedSTEMDECK_SEPARATION_QUALITY. Follows thedemucs_devicepattern exactly.app/main.py: added to_settings_payload()and thePOST /api/settingshandler (422 on an invalid choice).app/pipeline/separate.py:_demucs_cmdappends--shifts 2when quality is"best", read fresh per job (same asget_demucs_device()) so a Settings change applies to the next separation without a restart. Applies on any device.static/js/catalog.js): new "Separation quality" select on the General tab, next to Compute device --Standard/Best (2× slower), wired the same way as the export sample rate / video height selects.Test plan
tests/test_network_gate.py: settings round-trip via the API, env-var seeding, rejection of an unknown choice (nothing persisted on failure).tests/test_separate_fallback.py:_demucs_cmdincludes--shifts 2at "best", omits it at "standard"; existing fallback tests unaffected (they stub_demucs_cmddirectly).201 passed, 12 skippedruff check/ruff format --checkclean