diff --git a/comfy_execution/cache_provider.py b/comfy_execution/cache_provider.py index 2a7e877c0..a00e8cb15 100644 --- a/comfy_execution/cache_provider.py +++ b/comfy_execution/cache_provider.py @@ -56,10 +56,11 @@ class CacheValue: """ Value stored/retrieved from external cache. - Note: UI data is intentionally excluded - it contains pod-local - file paths that aren't portable across instances. + The ui field is optional - implementations may choose to skip it + (e.g., if it contains non-portable data like local file paths). """ outputs: list # The tensor/value outputs + ui: dict = None # Optional UI data (may be skipped by implementations) # ============================================================ diff --git a/comfy_execution/caching.py b/comfy_execution/caching.py index e3386d459..05b7871f2 100644 --- a/comfy_execution/caching.py +++ b/comfy_execution/caching.py @@ -250,7 +250,7 @@ class BasicCache: cache_key=cache_key, cache_key_bytes=serialize_cache_key(cache_key) ) - cache_value = CacheValue(outputs=value.outputs) + cache_value = CacheValue(outputs=value.outputs, ui=value.ui) for provider in get_cache_providers(): try: @@ -296,7 +296,7 @@ class BasicCache: continue # Import CacheEntry here to avoid circular import at module level from execution import CacheEntry - return CacheEntry(ui={}, outputs=list(result.outputs)) + return CacheEntry(ui=result.ui or {}, outputs=list(result.outputs)) except Exception as e: logger.warning(f"Cache provider {provider.__class__.__name__} error on lookup: {e}")