Download hook_breaker_ac10a0.py from V0pr0S/ComfyUI-Reactor-Fast-Face-Swap-CPU: direct link, hf CLI and curl.
- Browser
- Download file 366 Bytes
-
https://huggingface.co/spaces/V0pr0S/ComfyUI-Reactor-Fast-Face-Swap-CPU/resolve/main/hook_breaker_ac10a0.py
- Command line
-
hf download hf://spaces/V0pr0S/ComfyUI-Reactor-Fast-Face-Swap-CPU/hook_breaker_ac10a0.py
-
curl -L -o hook_breaker_ac10a0.py https://huggingface.co/spaces/V0pr0S/ComfyUI-Reactor-Fast-Face-Swap-CPU/resolve/main/hook_breaker_ac10a0.py
366 Bytes
| # Prevent custom nodes from hooking anything important | |
| import comfy.model_management | |
| HOOK_BREAK = [(comfy.model_management, "cast_to")] | |
| SAVED_FUNCTIONS = [] | |
| def save_functions(): | |
| for f in HOOK_BREAK: | |
| SAVED_FUNCTIONS.append((f[0], f[1], getattr(f[0], f[1]))) | |
| def restore_functions(): | |
| for f in SAVED_FUNCTIONS: | |
| setattr(f[0], f[1], f[2]) | |