Merge branch 'comfyanonymous:master' into master

This commit is contained in:
patientx 2024-09-27 10:24:40 +03:00 committed by GitHub
commit 6075653f8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ class TorchCompileModel:
@classmethod
def INPUT_TYPES(s):
return {"required": { "model": ("MODEL",),
"backend": (["inductor", "cudagraphs"],),
}}
RETURN_TYPES = ("MODEL",)
FUNCTION = "patch"
@ -11,9 +12,9 @@ class TorchCompileModel:
CATEGORY = "_for_testing"
EXPERIMENTAL = True
def patch(self, model):
def patch(self, model, backend):
m = model.clone()
m.add_object_patch("diffusion_model", torch.compile(model=m.get_model_object("diffusion_model")))
m.add_object_patch("diffusion_model", torch.compile(model=m.get_model_object("diffusion_model"), backend=backend))
return (m, )
NODE_CLASS_MAPPINGS = {