Diffusers documentation

BriaFiboTransformer2DModel

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

BriaFiboTransformer2DModel

Bria による修正版 flux Transformer モデル

BriaFiboTransformer2DModel

class diffusers.BriaFiboTransformer2DModel

< >

( patch_size: int = 1in_channels: int = 64num_layers: int = 19num_single_layers: int = 38attention_head_dim: int = 128num_attention_heads: int = 24joint_attention_dim: int = 4096pooled_projection_dim: int = Noneguidance_embeds: bool = Falseaxes_dims_rope: list[int] = [16, 56, 56]rope_theta = 10000time_theta = 10000text_encoder_dim: int = 2048 )

パラメータ

  • patch_size (int) — 入力データを小さなパッチに変換するためのパッチサイズ。
  • in_channels (int、任意、デフォルトは 16) — 入力におけるチャネル数。
  • num_layers (int、任意、デフォルトは 18) — 使用する MMDiT ブロックの層数。
  • num_single_layers (int, 任意、デフォルトは 18) — 使用する単一 DiT ブロックの層数。
  • attention_head_dim (int、任意、デフォルトは 64) — 各ヘッドのチャネル数。
  • num_attention_heads (int、任意、デフォルトは 18)— マルチヘッドアテンションに使用するヘッド数。
  • joint_attention_dim (int、任意) — 使用するencoder_hidden_statesの次元数。
  • pooled_projection_dim (int) — pooled_projections を射影する際に使用する次元数。
  • guidance_embeds (bool、デフォルトは False)— ガイダンス埋め込みを使用するかどうか。
  • … —

forward

< >

( hidden_states: Tensorencoder_hidden_states: Tensor = Nonetext_encoder_layers: list = Nonepooled_projections: Tensor = Nonetimestep: LongTensor = Noneimg_ids: Tensor = Nonetxt_ids: Tensor = Noneguidance: Tensor = Nonejoint_attention_kwargs: dict[str, typing.Any] | None = Nonereturn_dict: bool = True )

パラメータ

  • hidden_states (torch.FloatTensor、形状 (batch size, channel, height, width)) — 入力となる hidden_states。
  • encoder_hidden_states (torch.FloatTensor、shape (batch size, sequence_len, embed_dims)) — 使用する条件埋め込み(プロンプトなどの入力条件から計算される埋め込み)。
  • text_encoder_layers (list of torch.Tensor) — 各 Transformer ブロックに対応するテキストエンコーダーの隠れ状態。ブロックごとに 1 つのテンソルを保持します。
  • pooled_projections (torch.FloatTensor、shape (batch_size, projection_dim)) — 入力条件の埋め込みから投影された埋め込みです。
  • timestep ( torch.LongTensor) — デノイジングステップを示すために使用されます。
  • img_ids (torch.Tensor) — 回転位置埋め込みを計算するために使用される画像の位置 ID。
  • txt_ids (torch.Tensor) — 回転位置埋め込みを計算するために使用されるテキストの位置 ID。
  • guidance (torch.Tensor、任意) — モデルのガイダンス蒸留版で使用するガイダンススケール埋め込み。
  • joint_attention_kwargs (dict、省略可) — 指定された場合、diffusers.models.attention_processor で定義されている self.processor 配下の AttentionProcessor に渡される kwargs の辞書です。
  • return_dict (bool、任意、デフォルトは True) — プレーンなタプルではなく ~models.transformer_2d.Transformer2DModelOutput を返すかどうか。
Update on GitHub