Fix rope scaling. (#10560)

This commit is contained in:
comfyanonymous 2025-10-30 19:51:58 -07:00 committed by GitHub
parent 614cf9805e
commit 27d1bd8829
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -605,9 +605,9 @@ class WanModel(torch.nn.Module):
w_start = 0
rope_options = transformer_options.get("rope_options", None)
if rope_options is not None:
t_len = t_len * rope_options.get("scale_t", 1.0)
h_len = h_len * rope_options.get("scale_y", 1.0)
w_len = w_len * rope_options.get("scale_x", 1.0)
t_len = (t_len - 1.0) * rope_options.get("scale_t", 1.0) + 1.0
h_len = (h_len - 1.0) * rope_options.get("scale_y", 1.0) + 1.0
w_len = (w_len - 1.0) * rope_options.get("scale_x", 1.0) + 1.0
t_start += rope_options.get("shift_t", 0.0)
h_start += rope_options.get("shift_y", 0.0)