You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: nunchaku/models/transformers/transformer_zimage.py
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,9 @@
27
27
28
28
29
29
classNunchakuZImageRopeHook:
30
+
"""
31
+
Hook class for caching and substition of packed `freqs_cis` tensor.
32
+
"""
30
33
31
34
def__init__(self):
32
35
self.packed_cache= {}
@@ -255,6 +258,11 @@ def forward(
255
258
f_patch_size=1,
256
259
return_dict: bool=True,
257
260
):
261
+
"""
262
+
Adapted from diffusers.models.transformers.transformer_z_image.ZImageTransformer2DModel#forward
263
+
264
+
Register pre-forward hooks for caching and substitution of packed `freqs_cis` tensor for all attention submodules and unregister after forwarding is done.
0 commit comments