mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-06 01:37:45 +08:00
fix: wrap register/unregister as explicit static methods
Define register_provider and unregister_provider as wrapper functions in the Caching class instead of re-importing. This locks the public API signature in comfy_api/ so internal changes can't accidentally break it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7c3c427639
commit
9586c79ad9
@ -137,11 +137,18 @@ class Caching:
|
||||
"""
|
||||
# Public types — defined in comfy_api.latest._caching (source of truth)
|
||||
from ._caching import CacheProvider, CacheContext, CacheValue
|
||||
# Registry functions — implementation in comfy_execution
|
||||
from comfy_execution.cache_provider import (
|
||||
register_cache_provider as register_provider,
|
||||
unregister_cache_provider as unregister_provider,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def register_provider(provider: "Caching.CacheProvider") -> None:
|
||||
"""Register an external cache provider."""
|
||||
from comfy_execution.cache_provider import register_cache_provider
|
||||
register_cache_provider(provider)
|
||||
|
||||
@staticmethod
|
||||
def unregister_provider(provider: "Caching.CacheProvider") -> None:
|
||||
"""Unregister an external cache provider."""
|
||||
from comfy_execution.cache_provider import unregister_cache_provider
|
||||
unregister_cache_provider(provider)
|
||||
|
||||
|
||||
ComfyAPI = ComfyAPI_latest
|
||||
|
||||
Loading…
Reference in New Issue
Block a user