Diffusers documentation

ConsistencyDecoderScheduler

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

and get access to the augmented documentation experience

to get started

ConsistencyDecoderScheduler

このスケジューラーはConsistencyDecoderPipelineの一部であり、DALL-E 3で導入されました。

元のコードベースはopenai/consistency_modelsで確認できます。

ConsistencyDecoderScheduler

class diffusers.schedulers.ConsistencyDecoderScheduler

< >

( num_train_timesteps: int = 1024sigma_data: float = 0.5 )

パラメータ

  • num_train_timesteps (int、任意、デフォルトは 1024) — モデルを学習するための拡散ステップ数。
  • sigma_data (float、任意、デフォルトは 0.5) — データ分布の標準偏差です。スキップおよび出力のスケーリング係数を計算するために使用されます。

Stable Diffusionのパイプラインで使用されるconsistency decoder用のスケジューラーです。

このスケジューラーは、潜在表現を画像にデコードするために、consistency modelsを用いた2段階のデノイジングプロセスを実装しています。

このモデルは SchedulerMixin および ConfigMixin を継承しています。読み込みや保存など、ライブラリがすべてのスケジューラに対して実装している汎用的なメソッドについては、スーパークラスのドキュメントを参照してください。

scale_model_input

< >

( sample: Tensortimestep: int | None = None ) → torch.Tensor

パラメータ

  • sample (torch.Tensor) — 入力サンプルです。
  • timestep (int, 任意) — 拡散チェーンにおける現在のタイムステップ。

戻り値

torch.Tensor

スケーリングされた入力サンプル。

現在のタイムステップに応じて、デノイジングモデルの入力をスケーリングする必要があるスケジューラーとの相互運用性を保証します。

ステップ

< >

( model_output: Tensortimestep: typing.Union[float, torch.Tensor]sample: Tensorgenerator: typing.Optional[torch.Generator] = Nonereturn_dict: bool = True ) → ConsistencyDecoderSchedulerOutput or tuple

パラメータ

  • model_output (torch.Tensor) — 学習済み拡散モデルからの直接の出力です。
  • timestep (float または torch.Tensor) — 拡散チェーンにおける現在のタイムステップ。
  • sample (torch.Tensor) — 拡散プロセスによって生成されたサンプルの現在のインスタンス。
  • generator (torch.Generator、任意) — 再現性を確保するための乱数生成器です。
  • return_dict (bool、任意、デフォルトは True) — ConsistencyDecoderSchedulerOutput を返すか、tuple を返すかを指定します。

戻り値

ConsistencyDecoderSchedulerOutput または tuple

return_dict が True の場合、ConsistencyDecoderSchedulerOutput が返され、それ以外の場合は、最初の要素がサンプルテンソルであるタプルが返されます。

前のタイムステップのサンプルを、SDEを逆方向に適用することで予測します。この関数は、学習済みモデルの出力(多くの場合、予測されたノイズ)から拡散過程を伝播させます。

Update on GitHub