bugfix and optimize

This commit is contained in:
zombieyang
2024-05-13 12:46:47 +08:00
parent f1d8e8beb1
commit 2a2c2f96e5
3 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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
+6 -1
View File
@@ -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)