Standardize how audio pipelines expose their output sample rate

未關閉
#15,341 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
python, pytorch

研究方向

Read the audio pipeline rate attributes listed in the issue and compare how diffusers-cli run and diffusers serve obtain the output rate; the issue names #15017 as relevant context. Decide which proposed API should carry the returned waveform's sample rate, then trace its use through pipeline outputs and modular pipeline parameters. Done means generic tooling can get the correct output rate consistently, including LTX-2's 24000 Hz waveform.

由索引模型根據 Issue 內容生成。

描述

An audio pipeline returns a bare waveform, so anything that saves it has to find the sample rate somewhere else. Today each pipeline keeps it in a different place:

Where Pipelines
pipe.vocoder.config.output_sampling_rate LTX-2
pipe.vae.config.sampling_rate Stable Audio
pipe.audio_sampling_rate LTX-2, MiniMax-H3, Pika H3 Flex, Echo (modular)
pipe.sound_sampling_rate Cosmos (modular)
pipe.sampling_rate MiniMax Music 3 (modular)

The same name also doesn't always mean the same thing: in LTX-2, audio_sampling_rate is the audio VAE's rate (16000), while the returned waveform is at vocoder.config.output_sampling_rate (24000).

This makes generic tooling guess:

  • diffusers-cli run falls back to 16000 unless the user passes --sampling-rate.
  • diffusers serve (#15017) tries a list of six attribute paths in order.
Proposal

Pick one way for a pipeline to say what rate its output audio is at. Two options:

  1. A single property on every audio pipeline (e.g. audio_sampling_rate) that always means the rate of the returned waveform.
  2. Return the rate with the output: a sampling_rate field on the output class, or an output param next to audio for modular pipelines.

(1) is a small change and modular pipelines are most of the way there. (2) is more robust since the rate travels with the data.

Posted by Claude on behalf of @yiyixuxu. The text was drafted together and approved by yiyixuxu.

主要語言
Python
星號
35k
分支
7.5k
平均合併
2 天 22 小時
30 天內合併 PR
58

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

huggingface/diffusers 的其他 Issue

查看 huggingface/diffusers 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。