| 項目 | stable-audio-open-small | stable-audio-open-1.0 |
|---|---|---|
| HF Repo | …/small | …/1.0 |
| 授權 | Stability AI Community License | Stability AI Community License |
| Gated(需接受條款) | 是 gated | 是 gated |
| 匿名下載 | 401 Unauthorized | 401 Unauthorized |
| 原生最大長度 | 11 秒 | 47 秒 |
| 少步數快速推理 | 支援 8-step | 未明示 |
| 取樣率 / 聲道 | 44.1 kHz stereo | 44.1 kHz stereo |
| 權重大小(safetensors) | ≈1.68 GB | ≈4.85 GB (+VAE 0.62 GB) |
| 推理框架 | stable-audio-tools(官方) | |
查證方法:WebFetch 讀取 HF model card + huggingface.co/api/models/<repo> 與 /tree/main 匿名查詢;下載可行性以對 resolve/main/model.safetensors 發 HTTP HEAD 驗證。架構:latent diffusion transformer(DiT),T5 文字條件;small 版採 ARC(adversarial relativistic-contrastive)蒸餾以支援極少步數。
⚠ 授權是逐 repo 各別接受,不是同一顆 token 通用:Howard 目前只在 stable-audio-open-small 頁面按過「Agree and access repository」;用同一顆 token 測 stable-audio-open-1.0 時收到的是 403 "you are not in the authorized list"(不是 401 無 token),代表這顆還沒被授權。要測 1.0(47秒版)需另外去 stable-audio-open-1.0 頁面再按一次接受條款。
~/stable-audio/venvGB10 為統一記憶體架構,nvidia-smi 的整體 Memory-Usage 欄位顯示 Not Supported,無法讀取傳統 dedicated VRAM 總量;但 Processes 表仍會列出每個進程的 GPU Memory 佔用(實測現有 vLLM/STT/TTS/Ollama 進程分別佔 16649 / 11950 / 4889+6025 / 11219 MiB)。因此若後續實測,記憶體影響將以「free -h 系統記憶體 before/after」為主指標,輔以 nvidia-smi 進程級 GPU Memory 佐證。
依鐵則在全新目錄 ~/stable-audio/ 建立獨立 venv,完全不觸碰既有 ComfyUI / stt-server / thumbnail-gen venv 與現有 vLLM/Ollama/gateway 服務。
python3 -m venv ~/stable-audio/venv
~/stable-audio/venv/bin/pip install torch torchaudio torchvision \
--index-url https://download.pytorch.org/whl/cu130 # ✓ cu130 aarch64 wheel 直接可用
~/stable-audio/venv/bin/pip install --no-deps stable-audio-tools
# 相依需放寬版本 pin 才裝得起來(見下方 gotcha)
✓ 環境就位 torch/torchaudio/torchvision cu130 三件套安裝成功,torch.cuda.is_available()=True,device 正確辨識為 NVIDIA GB10。stable-audio-tools 的官方推理入口 get_pretrained_model、generate_diffusion_cond 已可成功 import——一旦取得 token,可立即開跑實測。venv 佔磁碟約 5.4 GB。
官方 model card 建議的少步數推理方式(已實際執行):
output = generate_diffusion_cond(
model,
steps=8, # Howard 期望的 8 step
cfg_scale=1.0,
conditioning=[{"prompt": "...", "seconds_total": 11}],
sample_size=sample_size, # 來自 model_config
sampler_type="pingpong", # small 版少步數專用 sampler
device="cuda",
)
計時協定:第一次生成(含 warm-up / 首次載入權重)不計入;自第二次起連續跑 3–5 次,以 time.perf_counter() 量測「發送請求 → 音檔存檔完成」總耗時,取平均 / 最快 / 最慢;記錄實際輸出秒數、格式、取樣率,以及 free -h before/after。
| 指標 | 數值 |
|---|---|
| 模型載入時間(首次,不計入基準) | 42.00 秒 |
| 暖機生成(第 0 次,不計入基準) | 1.197 秒 |
| 樣本數 n(第 1–5 次) | 5 |
| 平均耗時 | 0.432 秒 |
| 最快 / 最慢 | 0.425 秒 / 0.439 秒 |
| 實際輸出長度 | 11.889 秒(5 次全部一致) |
| 輸出格式 / 取樣率 | WAV, PCM 16-bit, 44.1 kHz, stereo(實測輸出檔 2,097,196 bytes/檔) |
| 推理設定 | steps=8, cfg_scale=1.0, sampler_type="pingpong" |
方法:time.perf_counter() 量測「呼叫 generate_diffusion_cond → wav 寫檔完成」總耗時,6 次連續呼叫(同一 prompt「128 BPM tech house drum loop」),第 0 次為暖機不計入統計。速度快於原先預期,推測因 small 版採 ARC 蒸餾(8-step 專門優化)+ GB10 算力充足;stable-audio-open-1.0(47秒版)本輪未測,如需可另補。
| 時點 | total | used | available |
|---|---|---|---|
| Before(閒置基準) | 121 GiB | 46 GiB | 74 GiB |
| 推理進行中(第 5 次生成時) | 121 GiB | 51 GiB | 72 GiB |
| After(腳本結束,程序已退出) | 121 GiB | 43 GiB | 78 GiB |
系統記憶體影響很小(閒置↔推理中差約 5 GiB,腳本結束後完全釋放,無殘留進程)。GPU 記憶體(進程級,nvidia-smi --query-compute-apps):推理腳本本身佔 約 3.3–3.5 GiB(5 次生成間穩定,無洩漏累積);同時段其他常駐服務(stt-server 11.9 GiB、TTS 4.9+6.0 GiB 等)不受影響。磁碟 / 額外用量:venv 5.4 GB + 模型權重 4.7 GB(model.safetensors+model.ckpt+base 版本共存)。
| 項目 | Howard 期望 | 實際可行 | 落差原因 |
|---|---|---|---|
| 版本名稱 | Stable Audio 3 | 不存在 | 無此版本;開放線最新為 open-small / open-1.0 |
| 步數 | 8 step | ✓ small 支援 | small 版以 ARC 蒸餾原生支援 8-step pingpong |
| 長度 | 2 分鐘 (120s) | 最多 11s(small)/ 47s(1.0) | 模型訓練時的最大 latent 長度上限,架構原生限制,無法靠參數硬撐到 120s |
MODEL_LOAD_SECONDS 42.00
RUN 0 elapsed=1.197s duration=11.889s (暖機,不計入)
RUN 1 elapsed=0.438s duration=11.889s
RUN 2 elapsed=0.432s duration=11.889s
RUN 3 elapsed=0.425s duration=11.889s
RUN 4 elapsed=0.427s duration=11.889s
RUN 5 elapsed=0.439s duration=11.889s
WARM_N 5 · WARM_AVG 0.432 · WARM_MIN 0.425 · WARM_MAX 0.439
6 個輸出檔(output_small_run0.wav ~ run5.wav)保留在 190 ~/stable-audio/models/,皆為有效 WAV(file 指令驗證:RIFF, PCM 16-bit, stereo 44100 Hz);未觸碰任何既有 vLLM / Ollama / ComfyUI / STT / gateway 服務與其 venv。~/stable-audio/(含已下載模型權重)保留供後續正式工具沿用,不需重新下載。