lastopenworkflow

This commit is contained in:
zombieyang
2025-04-27 21:56:19 +08:00
parent 5b9a2cd4a7
commit cb7aa3dfa6
7 changed files with 35 additions and 14 deletions
+2 -3
View File
@@ -508,12 +508,11 @@ def define_comfyui_nodes(sdpppServer):
def action(self, layer_or_group, unique_id, prompt, document = None, **kwargs):
sdpppServer.has_ps_instance(throw_error=True)
document = json.loads(document)
document = layer_or_group[0]['document']
res_text = []
for i, item_layer in enumerate(layer_or_group):
if linked_style:
item_layer = item_layer['layer_identify']
item_layer = item_layer['layer_identify']
text = call_async_func_in_server_thread(
ProtocolPhotoshop.get_text(
+4 -1
View File
@@ -170,6 +170,8 @@ def define_comfyui_nodes_legacy(sdppp):
sdppp.has_ps_instance(throw_error=True)
linked_style, document = parse_params(unique_id, prompt, layer_or_group, document)
sdppp_arg = kwargs['sdppp']
sdppp_arg_item = json.loads(sdppp_get_prompt_item_from_list(sdppp_arg, 0))
# dont check here, some python cannot read the data in this thread.
# if document['instance_id'] not in sdppp.ppp_instances:
@@ -211,7 +213,8 @@ def define_comfyui_nodes_legacy(sdppp):
document_identify=document['identify'],
image_blobs=[p['image_blob'] for p in params],
layer_identifies=[p['layer_identify'] for p in params],
boundaries=[p['boundary'] for p in params]
boundaries=[p['boundary'] for p in params],
new_layer_name=sdppp_arg_item['lastOpenedWorkflow']
), True)
return (document,)
+3 -2
View File
@@ -31,7 +31,7 @@ class ProtocolPhotoshop:
return result
@classmethod
async def send_images(cls, instance_id, document_identify, layer_identifies, boundaries, image_urls=[], image_blobs=[]):
async def send_images(cls, instance_id, document_identify, layer_identifies, boundaries, image_urls=[], image_blobs=[], new_layer_name=""):
ppp_instance = cls.sdpppServer.ppp_instances[instance_id]
result = await protocol_call(ppp_instance, 'B_photoshop', data={
'action': 'sendImages',
@@ -40,7 +40,8 @@ class ProtocolPhotoshop:
'layer_identifies': layer_identifies,
'boundaries': boundaries,
'image_urls': image_urls,
'image_blobs': image_blobs
'image_blobs': image_blobs,
'new_layer_name': new_layer_name
}
})
return result