Diffusers documentation

SD3Transformer2D

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

SD3Transformer2D

このクラスは、SD3Transformer2DModelにのみ重みをロードする場合に便利です。テキストエンコーダー、またはテキストエンコーダーとSD3Transformer2DModelの両方に重みをロードする必要がある場合は、代わりにSD3LoraLoaderMixinクラスを確認してください。

SD3Transformer2DLoadersMixin クラスは現在、IP-Adapter の重みの読み込みのみに対応していますが、将来的には重みの保存と LoRA の読み込みにも使用される予定です。

LoRAの重みをロードする方法の詳細については、LoRAのロードガイドを参照してください。

SD3Transformer2DLoadersMixin

クラス diffusers.loaders.SD3Transformer2DLoadersMixin

< >

( )

[SD3Transformer2DModel]にIP-AdapterとLoRAレイヤーを読み込みます。

_load_ip_adapter_weights

< >

( state_dict: dictlow_cpu_mem_usage: bool = True )

パラメータ

  • state_dict (Dict) — キーに “ip_adapter”(attention processors のパラメータを含む)と “image_proj”(image projection net のパラメータを含む)を持つ state dict。
  • low_cpu_mem_usage (bool、任意、torch のバージョンが 1.9.0 以上の場合デフォルトは True、それ以外の場合は False) — 重みの初期化を行わず、事前学習済み重みのみを読み込むことで、モデルの読み込みを高速化します。また、モデルの読み込み中に CPU メモリ(ピークメモリを含む)をモデルサイズの 1 倍以下に抑えるよう試みます。PyTorch 1.9.0 以上でのみサポートされています。PyTorch の古いバージョンを使用している場合、この引数を True に設定するとエラーが発生します。

IP-Adapterのattentionプロセッサ、image projectionを設定し、state_dictを読み込みます。

Update on GitHub