Fix blocking bug

This commit is contained in:
CMonk
2024-05-13 12:46:47 +08:00
committed by zombieyang
parent 445905d06f
commit dade41f068
2 changed files with 12 additions and 10 deletions
+5 -2
View File
@@ -102,8 +102,11 @@ class PhotoshopInstance:
self.comfyui_last_value_tracker = {}
# for apis calls
def is_ps_history_changed(self):
current_id = self.get_active_history_state_id_from_remote()
async def is_ps_history_changed(self, sio):
result = await sio.call('get_active_history_state_id', data={}, to=self.sid)
if result is None:
return False
current_id = result.get('history_state_id', None)
return self.get_img_state_id != current_id and self.get_img_state_id < current_id
# for nodes calls
+7 -8
View File
@@ -97,14 +97,13 @@ class SDPPP:
}, to=sid)
@sio.event
def check_changes(sid):
# instance = self.get_ps_instance()
# if instance is None:
# return
# if not instance.is_ps_history_changed():
# return
# sio.emit('trigger_graph_change', to=sid)
pass
async def check_changes(sid):
instance = self.get_ps_instance()
if instance is None:
return
if not await instance.is_ps_history_changed(sio):
return
sio.emit('trigger_graph_change', to=sid)
@sio.event
def reset_changes(sid):