From b212f0684b3e97c94c4866c7e94969ef1b5146ff Mon Sep 17 00:00:00 2001 From: Jedrzej Kosinski Date: Tue, 20 May 2025 22:24:12 -0700 Subject: [PATCH] Moved torch compile kwargs to be stored in model_options instead of attachments; attachments are more intended for things to be 'persisted', AKA not deepcopied --- comfy_api/torch_helpers/torch_compile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comfy_api/torch_helpers/torch_compile.py b/comfy_api/torch_helpers/torch_compile.py index c3a8b0646..ebf977367 100644 --- a/comfy_api/torch_helpers/torch_compile.py +++ b/comfy_api/torch_helpers/torch_compile.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: COMPILE_KEY = "torch.compile" -ATTACHMENT_TORCH_COMPILE_KWARGS = "torch_compile_kwargs" +TORCH_COMPILE_KWARGS = "torch_compile_kwargs" def apply_torch_compile_factory(compiled_module_dict: dict[str, Callable]) -> Callable: @@ -65,4 +65,4 @@ def set_torch_compile_wrapper(model: ModelPatcher, backend: str, options: Option compiled_module_dict=compiled_modules, ) model.add_wrapper_with_key(WrappersMP.APPLY_MODEL, COMPILE_KEY, wrapper_func) - model.set_attachments(ATTACHMENT_TORCH_COMPILE_KWARGS, compile_kwargs) + model.model_options[TORCH_COMPILE_KWARGS] = compile_kwargs