diff --git a/comfy/nodes.py b/comfy/nodes.py index 43fc3ba..c398ba1 100644 --- a/comfy/nodes.py +++ b/comfy/nodes.py @@ -21,7 +21,7 @@ def define_comfyui_nodes(sdppp): else: photoshopInstance = sdppp.get_ps_instance() id, bounds_id = self.LAYER_BOUNDS_NAME_TO_ID(layer, use_layer_bounds) - is_changed, history_state_id = asyncio.run(photoshopInstance.check_layer_bounds_combo_changed(id, bounds_id)) + is_changed, history_state_id = photoshopInstance.check_layer_bounds_combo_changed(id, bounds_id) if is_changed and history_state_id is None: return np.random.rand() photoshopInstance.update_comfyui_last_value(id, bounds_id, history_state_id) diff --git a/comfy/photoshop_instance.py b/comfy/photoshop_instance.py index 5dd1981..b130e7b 100644 --- a/comfy/photoshop_instance.py +++ b/comfy/photoshop_instance.py @@ -23,8 +23,8 @@ class PhotoshopInstance: layer_strs.insert(0, '### Use canvas ###') bounds_strs = list(layer_strs) - bounds_strs.insert(0, '### Use selection ###') - bounds_strs.insert(0, '### Same as layer ###') + bounds_strs.insert(1, '### Use selection ###') + bounds_strs.insert(1, '### Same as layer ###') return layer_strs, bounds_strs diff --git a/comfy/sdppp.py b/comfy/sdppp.py index 42d1091..996a321 100644 --- a/comfy/sdppp.py +++ b/comfy/sdppp.py @@ -63,11 +63,16 @@ class SDPPP: await asyncio.sleep(0.5) self.loop.create_task(selfEventLoop()) + # only emit by photoshop instance @sio.event def disconnect(sid): self.state[sid] = False - self.photoshop_instances.pop(sid, None) + if sid in self.photoshop_instances: + self.photoshop_instances.pop(sid, None) + elif sid in self.comfyui_instances: + self.comfyui_instances.pop(sid, None) + # only emit by photoshop instance @sio.event async def sync_layers(sid, data): instance = self.get_ps_instance(sid)