Diffusers documentation

PiflowScheduler

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.42.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

PiflowScheduler

PiflowScheduler は、蒸留済みの Kandinsky 6 チェックポイント(テキスト/画像から動画と音声への変換モデルおよび動画スーパーリゾリューションモデル)と、蒸留済みの Kandinsky S2V 1.0 チェックポイントで用いられる、ステップ数が少ないスケジューラーです。π-Flow を実装しており、トランスフォーマーが少数のグリッドポイントにおいて、潜在チャネルごとにn_grid 個のノイズ除去推定値を予測し、スケジューラーがそれらの間でネットワークを必要としないポリシーを積分します。

参照実装はLakonik/LakonLabで確認できます。

PiflowScheduler

クラス diffusers.PiflowScheduler

< >

( num_train_timesteps: int = 1000shift: float = 5.0n_grid: int = 10eps: float = 1e-06final_step_size_scale: float = 0.5num_policy_substeps: int = 128 )

パラメータ

  • num_train_timesteps (int、任意、デフォルト値は 1000)— 学習用の拡散ステップ数。
  • shift (float、任意、デフォルト値は 5.0) — Flow-matching のタイムステップシフト。
  • n_grid (int、任意、デフォルトは 10)— 拡張されたモデル出力に含まれる予測の数。
  • eps (float、任意、デフォルト値は 1e-6) — 最小タイムステップおよびポリシーの分母。
  • final_step_size_scale (float、任意、デフォルトは 0.5) — 最終的な生タイムステップ区間の相対的なサイズ。
  • num_policy_substeps (int、任意、デフォルトは 128) — 1 つの raw-timestep 単位あたりの最大 policy 統合サブステップ数。

出力幅を広げた拡散トランスフォーマー向けの、ステップ数が少ないPiFlowスケジューラー。

PiFlowは、少数のグリッドポイントでデノイジングモデルを評価し、それらの評価の間にネットワークフリーのポリシーを積分します。このスケジューラは、蒸留済みのKandinsky 6チェックポイント(メインの動画/音声モデルおよび動画スーパーリゾリューションモデルを含む)用に設計されています。これらのモデルの出力には、サンプルチャネルごとにn_grid個の予測が含まれます。

このスケジューラは SchedulerMixin と ConfigMixin を継承しています。すべてのスケジューラに実装されている汎用的なメソッド(読み込み、保存など)については、スーパークラスのドキュメントを参照してください。

set_timesteps

< >

( num_inference_steps: int | None = Nonedevice: typing.Union[str, torch.device, NoneType] = Nonesigmas: list[float] | None = Nonemu: float | None = Nonetimesteps: list[float] | None = None )

パラメータ

  • num_inference_steps (int) — モデルの評価回数。
  • device (str または torch.device、省略可) — スケジュールに使用するデバイス。
  • sigmas (list[float]、任意) — 非対応のカスタム sigma スケジュール。
  • mu (float, 任意) — 未サポートの dynamic-shift パラメータ。
  • timesteps (list[float]、任意) — 非対応のカスタムタイムステップスケジュール。

蒸留済み PiFlow のタイムステップスケジュールを設定します。

ステップ

< >

( model_output: FloatTensortimestep: typing.Union[float, torch.FloatTensor]sample: FloatTensorreturn_dict: bool = True ) → [PiflowSchedulerOutput] or tuple

パラメータ

  • model_output (torch.FloatTensor) — サンプルの各チャネルに対してn_grid個の予測を含む、幅広のモデル出力。
  • timestep (float または torch.FloatTensor) — 現在のスケジューラのタイムステップ。
  • sample (torch.FloatTensor) — 現在のノイズ付きサンプル。
  • return_dict (bool、optional、デフォルトは True) — [PiflowSchedulerOutput] を返すかどうか。

戻り値

[PiflowSchedulerOutput] または tuple

更新されたサンプル。

PiFlow ポリシーを統合して、1ステップ進めます。

PiflowSchedulerOutput

クラス diffusers.schedulers.scheduling_piflow.PiflowSchedulerOutput

< >

( prev_sample: Tensor )

パラメータ

  • prev_sample (torch.Tensor) — 次の PiFlow グリッドポイントで計算されたサンプル。次のノイズ除去の入力として使用する必要があります。

スケジューラーのstep関数の出力用のクラス。

Update on GitHub