diff --git a/comfy/photoshop_instance.py b/comfy/photoshop_instance.py index 10831d3..17a960c 100644 --- a/comfy/photoshop_instance.py +++ b/comfy/photoshop_instance.py @@ -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 diff --git a/comfy/sdppp.py b/comfy/sdppp.py index a447629..4362f24 100644 --- a/comfy/sdppp.py +++ b/comfy/sdppp.py @@ -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):