stemd: AUTO_SCAN=0 runs on request only (Stem Now)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
cdnutterandClaude Sonnet 5.5 committed 2026-10-20 15:42:55 -07:00
1 parent d69c44eff9
commit e35ebedb56
3 files changed
+9

No files matched your search

+1
View File
@@ -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) | | `MODEL` | `roformer_bs_sw` | Any id from [the model table](#separation-models) |
| `DEVICE` | `cuda` | `cuda`, `cuda:N` or `cpu` | | `DEVICE` | `cuda` | `cuda`, `cuda:N` or `cpu` |
| `RESCAN_MIN` | `30` | Minutes between library scans once caught up | | `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) | | `FP16` | `1` | Half precision on the GPU (`0` for fp32) |
| `OVERLAP`, `SEGMENT`, `SHIFTS` | `0.25`, `0`, `0` | Separation quality, same as the desktop app | | `OVERLAP`, `SEGMENT`, `SHIFTS` | `0.25`, `0`, `0` | Separation quality, same as the desktop app |
+1
View File
@@ -129,6 +129,7 @@ the app would briefly see no stems.
| `MODEL` | `roformer_bs_sw` | any id from `stemify/catalog.py` | | `MODEL` | `roformer_bs_sw` | any id from `stemify/catalog.py` |
| `DEVICE` | `cuda` | `cuda`, `cuda:N` or `cpu` | | `DEVICE` | `cuda` | `cuda`, `cuda:N` or `cpu` |
| `RESCAN_MIN` | `30` | minutes between scans once caught up | | `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) | | `FP16` | `1` | half precision on the GPU (`0` for fp32) |
| `OVERLAP`, `SEGMENT`, `SHIFTS` | `0.25`, `0`, `0` | as in the desktop app's settings | | `OVERLAP`, `SEGMENT`, `SHIFTS` | `0.25`, `0`, `0` | as in the desktop app's settings |
+7
View File
@@ -20,6 +20,7 @@ Settings (environment):
MODEL roformer_bs_sw any id from stemify/catalog.py MODEL roformer_bs_sw any id from stemify/catalog.py
DEVICE cuda cuda, cuda:N or cpu DEVICE cuda cuda, cuda:N or cpu
RESCAN_MIN 30 minutes between scans once caught up 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 FP16 1 half precision on the GPU
OVERLAP / SEGMENT / SHIFTS as in the desktop app's settings 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") MODEL = os.environ.get("MODEL", "roformer_bs_sw")
DEVICE = os.environ.get("DEVICE", "cuda") DEVICE = os.environ.get("DEVICE", "cuda")
RESCAN_S = float(os.environ.get("RESCAN_MIN", "30")) * 60 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", "") FP16 = os.environ.get("FP16", "1") not in ("0", "false", "no", "")
OVERLAP = float(os.environ.get("OVERLAP", "0.25")) OVERLAP = float(os.environ.get("OVERLAP", "0.25"))
SEGMENT = float(os.environ.get("SEGMENT", "0")) SEGMENT = float(os.environ.get("SEGMENT", "0"))
@@ -349,8 +351,13 @@ def main():
migrate_markers() migrate_markers()
sep = Separator() sep = Separator()
failed = Failed() failed = Failed()
if not AUTO_SCAN:
log("AUTO_SCAN off: only Stem Now requests will be separated")
while not stop.is_set(): while not stop.is_set():
try: try:
if not AUTO_SCAN:
idle(sep, failed, RESCAN_S)
continue
done, used = run_pass(sep, failed) done, used = run_pass(sep, failed)
if done: if done:
log(f"pass finished: {done:,} tracks separated") log(f"pass finished: {done:,} tracks separated")