Skip to content

Commit

Permalink
1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieyang committed Dec 6, 2024
1 parent 66bea02 commit d5038d6
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 27 deletions.
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [1.5.3] - 2024-12-06
1. optimize: favorited workflow will be at the top of the list.
2. fix: move tool would not trigger live paint & cache update.
3. fix: cache for GetSelection Node.
4. fix: the `[optional]` label will cause error in GetImageFromPS node.
5. fix: init failure in forge.
6. fix: cannot select layer if GetLayer node is connect to GetDocument node via a reroute.

## [1.5.2] - 2024-12-02
1. optimize: provide queueX3 and queueX10 button in Edit panel.
2. optimize: new icon button for workflow save and comfy edit.
Expand Down
Binary file modified javascript/plugins/sd-ppp_PS.ccx
Binary file not shown.
2 changes: 1 addition & 1 deletion javascript/sdppp-a1111.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion javascript/sdppp-comfy.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sdppp",
"version": "1.5.2",
"version": "1.5.3",
"scripts": {
"watch": "nodemon -w typescripts/src -e mjs,js,jsx,mts,ts,tsx,json,css,html -x node typescripts/src/build.mjs",
"build": "NODE_ENV=production node typescripts/src/build.mjs && bash plugins/package.sh"
Expand Down
2 changes: 1 addition & 1 deletion plugins/photoshop/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugins/photoshop/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "sd-ppp",
"name": "SD-PPP",
"version": "1.5.2",
"version": "1.5.3",
"main": "index.html",
"manifestVersion": 5,
"host": {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "sd-ppp"
description = "getting/sending picture from/to Photoshop with a simple connection. Make Photoshop become the workspace of your ComfyUI."
version = "1.5.2"
version = "1.5.3"
license = { file = "LICENSE" }

[project.urls]
Expand Down
8 changes: 4 additions & 4 deletions scripts/a1111_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def sdppp_get_forge(elem):
all_galleries[elem.elem_id] = elem
if inForge and isinstance(elem, LogicalImage) and elem.label == 'background':
all_forge_input[elem.elem_id] = elem
with blocks:
with gr.Box(elem_id=f"sdppp_dialog", elem_classes="popup-dialog") as sdppp_dialog:
with gr.Row():
pass
# with blocks:
# with gr.Box(elem_id=f"sdppp_dialog", elem_classes="popup-dialog") as sdppp_dialog:
# with gr.Row():
# pass

script_callbacks.on_app_started(on_app_started)
# shared.options_templates.update(
Expand Down
43 changes: 30 additions & 13 deletions sdppp_python/comfy/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def sdppp_get_prompt_item_from_list(l, index):
else:
return l[index]

def define_comfyui_nodes(sdppp):
def define_comfyui_nodes(sdpppServer):
def validate_sdppp():
if not sdppp.has_ps_instance():
if not sdpppServer.has_ps_instance():
return 'Photoshop is not connected'
return True

Expand All @@ -50,7 +50,7 @@ def call_async_func_in_server_thread(coro, dontwait = False):
'result': None,
'error': None
}
loop = sdppp.loop
loop = sdpppServer.loop
async def do_call():
try:
handle['result'] = await coro
Expand All @@ -76,6 +76,10 @@ class ParseLayerInfoNode:
FUNCTION = "action"
CATEGORY = "SD-PPP"

@classmethod
def IS_CHANGED(self, **kwargs):
return np.random.rand()

@classmethod
def INPUT_TYPES(cls):
return {
Expand Down Expand Up @@ -113,7 +117,7 @@ class GetLayerNode:

@classmethod
def IS_CHANGED(self, **kwargs):
print('getlayer is_changed')
return np.random.rand()

@classmethod
def INPUT_TYPES(cls):
Expand All @@ -132,7 +136,7 @@ def action(self, document, layer_or_group, **kwargs):
raise ValueError('Photoshop is not connected')
result = call_async_func_in_server_thread(
ProtocolPhotoshop.get_layer_info(
sdppp.backend_instances[document['instance_id']],
sdpppServer.backend_instances[document['instance_id']],
document['identify'],
layer_identify=layer_or_group
)
Expand Down Expand Up @@ -176,7 +180,7 @@ def action(self, layer_or_group, select, **kwargs):

result = call_async_func_in_server_thread(
ProtocolPhotoshop.get_layers_in_group(
backend_instance=sdppp.backend_instances[document['instance_id']],
backend_instance=sdpppServer.backend_instances[document['instance_id']],
document_identify=document['identify'],
select=select[0],
layer_identifies=layer_identifies
Expand Down Expand Up @@ -221,7 +225,7 @@ def action(self, layer_or_group, select, **kwargs):

result = call_async_func_in_server_thread(
ProtocolPhotoshop.get_linked_layers(
backend_instance=sdppp.backend_instances[document['instance_id']],
backend_instance=sdpppServer.backend_instances[document['instance_id']],
document_identify=document['identify'],
select=select[0],
layer_identifies=layer_identifies
Expand All @@ -241,17 +245,30 @@ class GetSelectionNode:
CATEGORY = "SD-PPP"

@classmethod
def IS_CHANGED(self, **kwargs):
return np.random.rand()
def VALIDATE_INPUTS(s):
return validate_sdppp()

@classmethod
def IS_CHANGED(self, sdppp, **kwargs):
document = json.loads(json.loads(sdppp)['document'])
if ('instance_id' not in document) or (document['instance_id'] not in sdpppServer.backend_instances):
return np.random.rand()

return sdpppServer.backend_instances[document['instance_id']].store.data['selectionStateID']

@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"document": ("DOCUMENT", {"default": None, "sdppp_type": "DOCUMENT"}),
},
"optional": {
"optional": SDPPPOptional({
"bound": ('BOUND', {"default": None}),
"sdppp": ("STRING", {"default": ""}),
}),
"hidden": {
"unique_id": "UNIQUE_ID",
"prompt": "PROMPT",
}
}

Expand All @@ -261,7 +278,7 @@ def action(self, document, bound="", **kwargs):

result = call_async_func_in_server_thread(
ProtocolPhotoshop.get_selection(
backend_instance=sdppp.backend_instances[document['instance_id']],
backend_instance=sdpppServer.backend_instances[document['instance_id']],
document_identify=document['identify'],
bound_identify=bound,
)
Expand Down Expand Up @@ -337,7 +354,7 @@ def action(self, layer_or_group, unique_id, prompt, document = None, **kwargs):
else:
document = layer_or_group[0]['document']

if document['instance_id'] not in sdppp.backend_instances:
if document['instance_id'] not in sdpppServer.backend_instances:
raise ValueError(f'Photoshop instance {document["instance_id"]} not found')

res_text = []
Expand All @@ -347,7 +364,7 @@ def action(self, layer_or_group, unique_id, prompt, document = None, **kwargs):

text = call_async_func_in_server_thread(
ProtocolPhotoshop.get_text(
backend_instance=sdppp.backend_instances[document['instance_id']],
backend_instance=sdpppServer.backend_instances[document['instance_id']],
document_identify=document['identify'],
layer_identify=item_layer
)
Expand Down
2 changes: 1 addition & 1 deletion sdppp_python/comfy/nodes_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def VALIDATE_INPUTS(s):
return validate_sdppp()

@classmethod
def IS_CHANGED(self):
def IS_CHANGED(self, **kwargs):
return np.random.rand()

@classmethod
Expand Down
8 changes: 5 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: var(--body-background-fill);
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
z-index: 1000; /* 确保对话框在遮罩层之上 */
}
#sdppp_dialog form {
background-color: white;
}

#sdppp_dialog::after {
content: '';
Expand Down Expand Up @@ -90,7 +92,7 @@
border: 1px solid #ccc;
border-radius: 4px;
font-size: 14px;
background-color: var(--input-background-fill);
background-color: white;
}

#sdppp_dialog button {
Expand All @@ -100,7 +102,7 @@
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s;
color: var(--body-text-color);
color: white;
}

.sdppp-confirm-button {
Expand Down

0 comments on commit d5038d6

Please sign in to comment.