Skip to content

Conversation

@a-r-r-o-w
Copy link
Contributor

Refactors SD3:

  • Removes F.scaled_dot_product_attention check which is already done in the processor (see here)
  • Accesses parameters directly instead of via self.config for init methods
  • Updates docs
  • Updates type hints from FloatTensor -> Tensor since the former is deprecated

@a-r-r-o-w a-r-r-o-w requested a review from yiyixuxu February 23, 2025 22:16
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!


@maybe_allow_in_graph
class SD3SingleTransformerBlock(nn.Module):
r"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, yes! All the latest integrations don't document the internal blocks. This is because of two reasons:

  • the parameters are already documented for main transformer, so copying for each internal block is redundant and almost always has introduced mismatched explanations (from doing the refactoring, i sometimes see parameters that don't exist are documented, and sometimes the explanations are just wrong)
  • The internal blocks are not user-facing API or linked in main diffusers documentation, so they will not show up there anyway

@a-r-r-o-w a-r-r-o-w merged commit 13f20c7 into main Feb 24, 2025
7 checks passed
@a-r-r-o-w a-r-r-o-w deleted the refactor/sd3-docs-and-remove-additional-code branch February 24, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants