mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-07 18:27:40 +08:00
28 lines
679 B
Python
28 lines
679 B
Python
import comfy.model_management as mm
|
|
from pyisolate import ProxiedSingleton
|
|
|
|
|
|
class ModelManagementProxy(ProxiedSingleton):
|
|
"""
|
|
Dynamic proxy for comfy.model_management.
|
|
Uses __getattr__ to forward all calls to the underlying module,
|
|
reducing maintenance burden.
|
|
"""
|
|
|
|
# Explicitly expose Enums/Classes as properties
|
|
@property
|
|
def VRAMState(self):
|
|
return mm.VRAMState
|
|
|
|
@property
|
|
def CPUState(self):
|
|
return mm.CPUState
|
|
|
|
@property
|
|
def OOM_EXCEPTION(self):
|
|
return mm.OOM_EXCEPTION
|
|
|
|
def __getattr__(self, name):
|
|
"""Forward all other attribute access to the module."""
|
|
return getattr(mm, name)
|