-
Notifications
You must be signed in to change notification settings - Fork 6.1k
[do not merge] HunyuanDIT refactor #8290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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. |
src/diffusers/models/attention.py
Outdated
|
||
from typing import Tuple, Union, Optional | ||
|
||
class HunyuanDiTAttentionPool(nn.Module): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to hunyuan_transformer_2d.py
|
||
A convolution based approach to patchifying a 2D image w/ embedding projection. | ||
class AdaLayerNormShift(nn.Module): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is refactored from default_modulation
: can you tell us more about it? Is it part of the AdaLayerNorm
family but without the scale? is there a reference? should we move to embeddings.py
with other normalization methods?
self.extra_in_dim = 256 * 6 + hidden_size | ||
|
||
# Text embedding for `add` | ||
self.pos_embed = PatchEmbed( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored this with our PatchEmbed
but we are not actually adding the position embedding here - does it make sense to call it pos_embed
still?
refactor rotary embedding + move dit block to dit model file
part of #8240
to-do:
HunyuanDiT2DModel
: removedHunyuanDiTPatchEmbed
,HunyuanDiTTimestepEmbedder
apply_rotary_emb
HunyuanDiTBlock
: keep it as a Hunyuan-specific block and move to the same file asHunyuanDiT2DModel