mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-06 11:32:31 +08:00
Removed unused method
This commit is contained in:
parent
4683136740
commit
1107f4322b
@ -53,9 +53,6 @@ class CacheKeySet(ABC):
|
|||||||
def is_key_updated(self, node_id) -> bool:
|
def is_key_updated(self, node_id) -> bool:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def is_key_updatable(self, node_id) -> bool:
|
|
||||||
return False
|
|
||||||
|
|
||||||
class Unhashable:
|
class Unhashable:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.value = float("NaN")
|
self.value = float("NaN")
|
||||||
@ -128,12 +125,6 @@ class CacheKeySetUpdatableInputSignature(CacheKeySet):
|
|||||||
def is_key_updated(self, node_id):
|
def is_key_updated(self, node_id):
|
||||||
return node_id in self.updated_node_ids
|
return node_id in self.updated_node_ids
|
||||||
|
|
||||||
def is_key_updatable(self, node_id):
|
|
||||||
_, missing_keys, _ = self.is_changed.get_input_data(node_id)
|
|
||||||
if missing_keys:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
async def add_keys(self, node_ids):
|
async def add_keys(self, node_ids):
|
||||||
"""Initialize keys."""
|
"""Initialize keys."""
|
||||||
for node_id in node_ids:
|
for node_id in node_ids:
|
||||||
@ -302,10 +293,6 @@ class BasicCache:
|
|||||||
"""False if the cache key set is an updatable type and it hasn't been updated yet."""
|
"""False if the cache key set is an updatable type and it hasn't been updated yet."""
|
||||||
return self.cache_key_set.is_key_updated(node_id)
|
return self.cache_key_set.is_key_updated(node_id)
|
||||||
|
|
||||||
def _is_key_updatable_immediate(self, node_id):
|
|
||||||
"""True if the cache key set is an updatable type and it can be updated properly."""
|
|
||||||
return self.cache_key_set.is_key_updatable(node_id)
|
|
||||||
|
|
||||||
def _set_immediate(self, node_id, value):
|
def _set_immediate(self, node_id, value):
|
||||||
assert self.initialized
|
assert self.initialized
|
||||||
cache_key = self.cache_key_set.get_data_key(node_id)
|
cache_key = self.cache_key_set.get_data_key(node_id)
|
||||||
@ -394,11 +381,6 @@ class HierarchicalCache(BasicCache):
|
|||||||
assert cache is not None
|
assert cache is not None
|
||||||
return cache._is_key_updated_immediate(node_id)
|
return cache._is_key_updated_immediate(node_id)
|
||||||
|
|
||||||
def is_key_updatable(self, node_id):
|
|
||||||
cache = self._get_cache_for(node_id)
|
|
||||||
assert cache is not None
|
|
||||||
return cache._is_key_updatable_immediate(node_id)
|
|
||||||
|
|
||||||
class NullCache:
|
class NullCache:
|
||||||
async def set_prompt(self, dynprompt, node_ids, is_changed):
|
async def set_prompt(self, dynprompt, node_ids, is_changed):
|
||||||
pass
|
pass
|
||||||
@ -427,9 +409,6 @@ class NullCache:
|
|||||||
def is_key_updated(self, node_id):
|
def is_key_updated(self, node_id):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def is_key_updatable(self, node_id):
|
|
||||||
return False
|
|
||||||
|
|
||||||
class LRUCache(BasicCache):
|
class LRUCache(BasicCache):
|
||||||
def __init__(self, key_class, max_size=100):
|
def __init__(self, key_class, max_size=100):
|
||||||
super().__init__(key_class)
|
super().__init__(key_class)
|
||||||
@ -490,10 +469,6 @@ class LRUCache(BasicCache):
|
|||||||
self._mark_used(node_id)
|
self._mark_used(node_id)
|
||||||
return self._is_key_updated_immediate(node_id)
|
return self._is_key_updated_immediate(node_id)
|
||||||
|
|
||||||
def is_key_updatable(self, node_id):
|
|
||||||
self._mark_used(node_id)
|
|
||||||
return self._is_key_updatable_immediate(node_id)
|
|
||||||
|
|
||||||
|
|
||||||
#Iterating the cache for usage analysis might be expensive, so if we trigger make sure
|
#Iterating the cache for usage analysis might be expensive, so if we trigger make sure
|
||||||
#to take a chunk out to give breathing space on high-node / low-ram-per-node flows.
|
#to take a chunk out to give breathing space on high-node / low-ram-per-node flows.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user