ace-step: patch upstream infer-api + missing runtime deps + cache mount

Three upstream gaps surfaced once /generate was actually exercised:

  1. infer-api.py builds an 18-arg positional tuple but the pipeline
     expects 24 — first missing arg is `format`, so audio_duration
     shifts into format's slot and the pipeline calls len() on an
     int. Ship a patched copy of infer-api.py and COPY over upstream's
     in the Dockerfile. Also handle empty lora_name_or_path -> "none"
     (empty string trips HF Hub's repo-id validator).
  2. torchcodec + ffmpeg are required by the WAV save path but neither
     is in upstream requirements.txt. Without them every /generate
     runs to completion and then 500s at write-time.
  3. ACE-Step caches checkpoints at /root/.cache/ace-step/checkpoints
     (HARDCODED, not honored by HF_HOME). Mount our persistent dir
     there so the ~7 GB model survives container recreates.

Bench on A6000 (cached model, lo-fi hip hop, 60-step euler/apg):
  10s @ 27 steps -> 9.4s  (0.94x)
  30s @ 60 steps -> 11.2s (0.37x, ~2.7x realtime)
  60s @ 60 steps -> 14.8s (0.24x, ~4x realtime)
This commit is contained in:
vh
2026-04-28 09:42:07 -07:00
parent 4a4c09177f
commit d2ed7671d7
4 changed files with 166 additions and 2 deletions
+5 -1
View File
@@ -42,7 +42,11 @@ services:
# ~5-10 GB checkpoint download survives container recreates.
- HF_HOME=/app/hf_cache
volumes:
- ${ACE_STEP_CHECKPOINTS_DIR}:/app/checkpoints
# ACE-Step has a HARDCODED checkpoint cache at
# /root/.cache/ace-step/checkpoints — not honored by HF_HOME.
# Mount our persistent dir there so model re-pull doesn't
# happen on every container recreate.
- ${ACE_STEP_CHECKPOINTS_DIR}:/root/.cache/ace-step/checkpoints
- ${ACE_STEP_OUTPUTS_DIR}:/app/outputs
- ${ACE_STEP_LOGS_DIR}:/app/logs
- ${ACE_STEP_CACHE_DIR}:/app/hf_cache