mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-09-05 12:07:04 +08:00
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
This commit is contained in:
parent
5789068a82
commit
b212f0684b
@ -10,7 +10,7 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
|
|
||||||
COMPILE_KEY = "torch.compile"
|
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:
|
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,
|
compiled_module_dict=compiled_modules,
|
||||||
)
|
)
|
||||||
model.add_wrapper_with_key(WrappersMP.APPLY_MODEL, COMPILE_KEY, wrapper_func)
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user