From e35ebedb565e2cb8dd0bc5480ca4bcf24e15d87e Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 20 Oct 2026 15:42:55 -0700 Subject: [PATCH] stemd: AUTO_SCAN=0 runs on request only (Stem Now) Co-Authored-By: Claude Sonnet 5.5 --- README.md | 1 + server/README.md | 1 + server/stemd.py | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 721e266..c3091d5 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ To update, copy the new files, rebuild, `docker rm -f` the container and run it | `MODEL` | `roformer_bs_sw` | Any id from [the model table](#separation-models) | | `DEVICE` | `cuda` | `cuda`, `cuda:N` or `cpu` | | `RESCAN_MIN` | `30` | Minutes between library scans once caught up | +| `AUTO_SCAN` | `1` | `0` to skip library scans and only separate Stem Now requests | | `FP16` | `1` | Half precision on the GPU (`0` for fp32) | | `OVERLAP`, `SEGMENT`, `SHIFTS` | `0.25`, `0`, `0` | Separation quality, same as the desktop app | diff --git a/server/README.md b/server/README.md index d87b0fe..d9472b2 100644 --- a/server/README.md +++ b/server/README.md @@ -129,6 +129,7 @@ the app would briefly see no stems. | `MODEL` | `roformer_bs_sw` | any id from `stemify/catalog.py` | | `DEVICE` | `cuda` | `cuda`, `cuda:N` or `cpu` | | `RESCAN_MIN` | `30` | minutes between scans once caught up | +| `AUTO_SCAN` | `1` | `0` = never scan the library, only do Stem Now requests | | `FP16` | `1` | half precision on the GPU (`0` for fp32) | | `OVERLAP`, `SEGMENT`, `SHIFTS` | `0.25`, `0`, `0` | as in the desktop app's settings | diff --git a/server/stemd.py b/server/stemd.py index 84abc90..b455a69 100644 --- a/server/stemd.py +++ b/server/stemd.py @@ -20,6 +20,7 @@ Settings (environment): MODEL roformer_bs_sw any id from stemify/catalog.py DEVICE cuda cuda, cuda:N or cpu RESCAN_MIN 30 minutes between scans once caught up + AUTO_SCAN 1 0 = never scan the library; only separate Stem Now requests FP16 1 half precision on the GPU OVERLAP / SEGMENT / SHIFTS as in the desktop app's settings """ @@ -47,6 +48,7 @@ MODELS_DIR = os.environ.get("MODELS_DIR", "/models") MODEL = os.environ.get("MODEL", "roformer_bs_sw") DEVICE = os.environ.get("DEVICE", "cuda") RESCAN_S = float(os.environ.get("RESCAN_MIN", "30")) * 60 +AUTO_SCAN = os.environ.get("AUTO_SCAN", "1") not in ("0", "false", "no", "") FP16 = os.environ.get("FP16", "1") not in ("0", "false", "no", "") OVERLAP = float(os.environ.get("OVERLAP", "0.25")) SEGMENT = float(os.environ.get("SEGMENT", "0")) @@ -349,8 +351,13 @@ def main(): migrate_markers() sep = Separator() failed = Failed() + if not AUTO_SCAN: + log("AUTO_SCAN off: only Stem Now requests will be separated") while not stop.is_set(): try: + if not AUTO_SCAN: + idle(sep, failed, RESCAN_S) + continue done, used = run_pass(sep, failed) if done: log(f"pass finished: {done:,} tracks separated")