{"record":{"id":"909cd85fbeba06c4","repo":"Comfy-Org/ComfyUI","slug":"hooks-not-implemented-in-modelpatcherdynamic-plea","errorCode":null,"errorMessage":"Hooks not implemented in ModelPatcherDynamic. Please remove --fast arguments form ComfyUI startup","messagePattern":"Hooks not implemented in ModelPatcherDynamic\\. Please remove --fast arguments form ComfyUI startup","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"comfy/model_patcher.py","lineNumber":2167,"sourceCode":"            try:\n                self.load(device_to, dirty=dirty)\n            except Exception as e:\n                self.detach()\n                raise e\n            #ModelPatcher::partially_load returns a number on what got loaded but\n            #nothing in core uses this and we have no data in the Dynamic world. Hit\n            #the custom node devs with a None rather than a 0 that would mislead any\n            #logic they might have.\n            return None\n\n    def patch_cached_hook_weights(self, cached_weights: dict, key: str, memory_counter: MemoryCounter):\n        assert False #Should be unreachable - we dont ever cache in the new implementation\n\n    def patch_hook_weight_to_device(self, hooks: comfy.hooks.HookGroup, combined_patches: dict, key: str, original_weights: dict, memory_counter: MemoryCounter):\n        if key not in combined_patches:\n            return\n\n        raise RuntimeError(\"Hooks not implemented in ModelPatcherDynamic. Please remove --fast arguments form ComfyUI startup\")\n\n    def unpatch_hooks(self, whitelist_keys_set: set[str]=None) -> None:\n        pass\n\n    def get_non_dynamic_delegate(self):\n        model_patcher = self.clone(disable_dynamic=True, model_override=self.non_dynamic_delegate_model)\n        self.non_dynamic_delegate_model = model_patcher.get_clone_model_override()\n        return model_patcher\n\n\nCoreModelPatcher = ModelPatcher\n","sourceCodeStart":2149,"sourceCodeEnd":2179,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy/model_patcher.py#L2149-L2179","documentation":"ModelPatcherDynamic (enabled by --fast startup flags) does not implement hook weight patching; if a code path tries to attach hook weights to a key (patch_hook_weight_to_device with a key present in combined_patches), it raises RuntimeError telling the user to remove --fast arguments. This is a deliberate unsupported-combination guard, not an internal bug.","triggerScenarios":"Starting ComfyUI with --fast flags and then using hooks (e.g. some IP-Adapter/LoRA-hook workflows or custom nodes that call set/add hooks on the model) that route through patch_hook_weight_to_device on a dynamic patcher.","commonSituations":"Combining --fast performance flags with hook-based custom nodes or workflows; version transitions where hooks were added after the dynamic patcher.","solutions":["Remove --fast arguments from the ComfyUI startup command and restart.","Update the custom node — newer versions may avoid patch_hook_weight_to_device on dynamic patchers.","If you need both hooks and dynamic speedups, check upstream for hook support in ModelPatcherDynamic."],"exampleFix":"# before (startup)\npython main.py --fast\n# after\npython main.py","handlingStrategy":"fallback","validationCode":"try:\n    patcher.patch_hook_weight_to_device(hooks, combined_patches, key, originals, counter)\nexcept RuntimeError as e:\n    if \"Hooks not implemented in ModelPatcherDynamic\" in str(e):\n        raise RuntimeError(\"This workflow needs hooks; restart ComfyUI without --fast\") from e\n    raise","typeGuard":"def is_dynamic_patcher(patcher) -> bool:\n    return isinstance(patcher, comfy.model_patcher.ModelPatcherDynamic)","tryCatchPattern":"try:\n    apply_hooks(model)\nexcept RuntimeError as e:\n    if \"ModelPatcherDynamic\" in str(e) and \"--fast\" in str(e):\n        logging.error(\"Hooks + --fast unsupported: remove --fast from startup args and restart\")\n    raise","preventionTips":["Do not enable --fast when workflows use hook-based nodes.","Update custom nodes to check for ModelPatcherDynamic before attaching hooks."],"tags":["model-patcher","hooks","fast","unsupported-combination"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}