mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-04-01 23:57:21 +08:00
12 lines
269 B
Python
12 lines
269 B
Python
# Copyright (c) OpenMMLab. All rights reserved.
|
|
from .hook import HOOKS, Hook
|
|
|
|
|
|
@HOOKS.register_module()
|
|
class ClosureHook(Hook):
|
|
|
|
def __init__(self, fn_name, fn):
|
|
assert hasattr(self, fn_name)
|
|
assert callable(fn)
|
|
setattr(self, fn_name, fn)
|