Buckets:
SD3 Transformer Model
The Transformer model introduced in Stable Diffusion 3. Its novelty lies in the MMDiT transformer block.
SD3Transformer2DModel[[diffusers.SD3Transformer2DModel]]
- sample_size (
int, defaults to128) -- The width/height of the latents. This is fixed during training since it is used to learn a number of position embeddings. - patch_size (
int, defaults to2) -- Patch size to turn the input data into small patches. - in_channels (
int, defaults to16) -- The number of latent channels in the input. - num_layers (
int, defaults to18) -- The number of layers of transformer blocks to use. - attention_head_dim (
int, defaults to64) -- The number of channels in each head. - num_attention_heads (
int, defaults to18) -- The number of heads to use for multi-head attention. - joint_attention_dim (
int, defaults to4096) -- The embedding dimension to use for joint text-image attention. - caption_projection_dim (
int, defaults to1152) -- The embedding dimension of caption embeddings. - pooled_projection_dim (
int, defaults to2048) -- The embedding dimension of pooled text projections. - out_channels (
int, defaults to16) -- The number of latent channels in the output. - pos_embed_max_size (
int, defaults to96) -- The maximum latent height/width of positional embeddings. - dual_attention_layers (
tuple[int, ...], defaults to()) -- The number of dual-stream transformer blocks to use. - qk_norm (
str, optional, defaults toNone) -- The normalization to use for query and key in the attention layer. IfNone, no normalization is used.
The Transformer model introduced in Stable Diffusion 3.
- chunk_size (
int, optional) -- The chunk size of the feed-forward layers. If not specified, will run feed-forward layer individually over each tensor of dim=dim. - dim (
int, optional, defaults to0) -- The dimension over which the feed-forward computation should be chunked. Choose between dim=0 (batch) or dim=1 (sequence length).
Sets the attention processor to use feed forward chunking.
- hidden_states (
torch.Tensorof shape(batch size, channel, height, width)) -- Inputhidden_states. - encoder_hidden_states (
torch.Tensorof shape(batch size, sequence_len, embed_dims)) -- Conditional embeddings (embeddings computed from the input conditions such as prompts) to use. - pooled_projections (
torch.Tensorof shape(batch_size, projection_dim)) -- Embeddings projected from the embeddings of input conditions. - timestep (
torch.LongTensor) -- Used to indicate denoising step. - block_controlnet_hidden_states (
listoftorch.Tensor) -- A list of tensors that if specified are added to the residuals of transformer blocks. - joint_attention_kwargs (
dict, optional) -- A kwargs dictionary that if specified is passed along to theAttentionProcessoras defined underself.processorin diffusers.models.attention_processor. - return_dict (
bool, optional, defaults toTrue) -- Whether or not to return a~models.transformer_2d.Transformer2DModelOutputinstead of a plain tuple. - skip_layers (
listofint, optional) -- A list of layer indices to skip during the forward pass.Ifreturn_dictis True, an~models.transformer_2d.Transformer2DModelOutputis returned, otherwise atuplewhere the first element is the sample tensor.
The SD3Transformer2DModel forward method.
Enables fused QKV projections. For self-attention modules, all projection matrices (i.e., query, key, value) are fused. For cross-attention modules, key and value projection matrices are fused.
> This API is 🧪 experimental.
Disables the fused QKV projection if enabled.
> This API is 🧪 experimental.
Xet Storage Details
- Size:
- 4.24 kB
- Xet hash:
- 01d7832c37872be9f1e6e75632bbd7c78637e9684ab60d03548f5b8569599cac
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.