mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
prompt cache prevent clear on task change
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
+2
-2
@@ -1553,7 +1553,7 @@ def check_ui(ver):
|
||||
return
|
||||
t_start = time.time()
|
||||
if not same(ver):
|
||||
log.debug(f'Branch mismatch: {ver}')
|
||||
log.debug(f'Branch mismatch: module=ModernUI {ver}')
|
||||
try:
|
||||
if 'dev' in ver['branch']:
|
||||
target = 'dev'
|
||||
@@ -1580,7 +1580,7 @@ def check_kanvas(ver):
|
||||
return
|
||||
t_start = time.time()
|
||||
if not same(ver):
|
||||
log.debug(f'Branch mismatch: {ver}')
|
||||
log.debug(f'Branch mismatch: module=Kanvas {ver}')
|
||||
try:
|
||||
if 'dev' in ver['branch']:
|
||||
target = 'dev'
|
||||
|
||||
@@ -18,9 +18,10 @@ class PromptCache:
|
||||
return val
|
||||
|
||||
def get(self, prompt, negative_prompt=None, cfg_enabled=None):
|
||||
if self.id != id(shared.sd_model):
|
||||
current_id = id(shared.sd_model.sd_checkpoint_info) if hasattr(shared.sd_model, 'sd_checkpoint_info') else id(shared.sd_model)
|
||||
if self.id != current_id:
|
||||
self.cache.clear()
|
||||
self.id = id(shared.sd_model)
|
||||
self.id = current_id
|
||||
log.debug(f'Encode: prompt cache activate id={self.id} depth={len(self.cache)}')
|
||||
negative_prompt = self._hashable(negative_prompt)
|
||||
if (isinstance(prompt, list) and len(prompt) == 1 and isinstance(prompt[0], str)):
|
||||
|
||||
Reference in New Issue
Block a user