mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-14 09:38:05 +00:00
refactor: expose CacheProvider API via comfy_api.latest.Caching
- Add Caching class to comfy_api/latest/__init__.py that re-exports
from comfy_execution.cache_provider (source of truth)
- Fix docstring: "Skip large values" instead of "Skip small values"
(small compute-heavy values are good cache targets)
- Maintain backward compatibility: comfy_execution.cache_provider
imports still work
Usage:
from comfy_api.latest import Caching
class MyProvider(Caching.CacheProvider):
def on_lookup(self, context): ...
def on_store(self, context, value): ...
Caching.register_provider(MyProvider())
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,9 @@ External Cache Provider API for distributed caching.
|
||||
This module provides a public API for external cache providers, enabling
|
||||
distributed caching across multiple ComfyUI instances (e.g., Kubernetes pods).
|
||||
|
||||
Public API is also available via:
|
||||
from comfy_api.latest import Caching
|
||||
|
||||
Example usage:
|
||||
from comfy_execution.cache_provider import (
|
||||
CacheProvider, CacheContext, CacheValue, register_cache_provider
|
||||
@@ -120,7 +123,7 @@ class CacheProvider(ABC):
|
||||
|
||||
Common filters:
|
||||
- By class_type: Only expensive nodes (KSampler, VAEDecode)
|
||||
- By size: Skip small values (< 1MB)
|
||||
- By size: Skip large values to reduce network overhead
|
||||
|
||||
Default: Returns True (cache everything).
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user