Add a ScaleROPE node. Currently only works on WAN models. (#10559)

This commit is contained in:
comfyanonymous
2025-10-30 19:11:38 -07:00
committed by GitHub
parent 513b0c46fb
commit 614cf9805e
4 changed files with 77 additions and 4 deletions

View File

@@ -454,6 +454,19 @@ class ModelPatcher:
def set_model_post_input_patch(self, patch):
self.set_model_patch(patch, "post_input")
def set_model_rope_options(self, scale_x, shift_x, scale_y, shift_y, scale_t, shift_t, **kwargs):
rope_options = self.model_options["transformer_options"].get("rope_options", {})
rope_options["scale_x"] = scale_x
rope_options["scale_y"] = scale_y
rope_options["scale_t"] = scale_t
rope_options["shift_x"] = shift_x
rope_options["shift_y"] = shift_y
rope_options["shift_t"] = shift_t
self.model_options["transformer_options"]["rope_options"] = rope_options
def add_object_patch(self, name, obj):
self.object_patches[name] = obj