Skip to content

Commit

Permalink
1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieyang committed Dec 27, 2024
1 parent 98f3d25 commit df24e8a
Show file tree
Hide file tree
Showing 17 changed files with 151 additions and 43 deletions.
2 changes: 2 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def run_script(cmd, cwd='.'):
if (args.multi_user):
sdppp.extra_server_info['multi_user'] = True

from .sdppp_python.protocols.photoshop import ProtocolPhotoshop
ProtocolPhotoshop.set_sdppp_server(sdppp)

from .sdppp_python.comfy.nodes import define_comfyui_nodes
from .sdppp_python.comfy.nodes_legacy import define_comfyui_nodes_legacy
Expand Down
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [1.6.1] - 2024-12-27
1. feature: show workflows by folder.
2. feature: refresh button in workflow panel
3. optimize: new LivePainting icon again..
4. bugfix: the latest preview logic is not work in webview execution
5. bugfix: workflow did not refresh after secondary opening.
6. bugfix: uncorrect caching when active document is changed.
7. bugfix: some version of python will always throw PS missing error in sending.

## [1.6.0] - 2024-12-25
0. NO LONGER SUPPORT A1111 WEBUI SINCE THIS VERSION. (It may reborn in other style maybe.)
1. feature: Workflow Panel: support rgthree's nodes.
Expand Down
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.6.0",
"version": "1.6.1",
"scripts": {
"watch": "nodemon -w typescripts/src -e mjs,js,jsx,mts,ts,tsx,json,css,html -x node typescripts/src/build/index.build.mjs",
"build": "NODE_ENV=production node typescripts/src/build/index.build.mjs && bash typescripts/src/build/package.sh"
Expand Down
2 changes: 1 addition & 1 deletion plugins/photoshop/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions 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.6.0",
"version": "1.6.1",
"main": "index.html",
"manifestVersion": 5,
"host": {
Expand Down Expand Up @@ -37,7 +37,7 @@
"type": "panel",
"id": "sdppp-connect",
"label": {
"default": "Connect WebUI or ComfyUI"
"default": "SD-PPP 1.6.1"
},
"minimumSize": {
"width": 300,
Expand Down
83 changes: 79 additions & 4 deletions plugins/photoshop/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
color: lightyellow;
}

.status-bar.disconnected {
.status-bar.disconnected,
.status-error {
color: lightcoral;
}

Expand Down Expand Up @@ -78,12 +79,19 @@
width: 400%;
display: flex;
flex-direction: row;
overflow-y: scroll;
}

.editor-card {
width: 25%;
margin-right: 8.333%;
height: 100%;
}
.editor-card.webview-container {
display: flex;
flex-direction: column;
}
.workflow-edit-wrap {
display: flex;
flex-direction: column;
}
Expand All @@ -94,23 +102,27 @@
flex: 1;
padding: 0 5px;
}

.workflow-edit-field {
display: flex;
flex-direction: column;
margin-bottom: 10px;
}

.workflow-edit-field-widgets {
display: flex;
flex-direction: row;
}

.workflow-edit-field-widgets sp-slider.sdppp-slider {
position: relative;
}

.workflow-edit-field-widgets sp-slider.sdppp-slider sp-textfield {
position: absolute;
right: 0;
top: -25px;
width: 70px;
width: 70px;
height: 20px;
text-align: right;
}
Expand All @@ -120,6 +132,7 @@
display: flex;
flex-direction: column;
}

.workflow-edit-button {
display: flex;
flex-direction: row;
Expand All @@ -136,22 +149,32 @@
margin-top: -5px;
}

.client-list-title {
min-height: 15px;
}
.client-list-title-container {
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 48px;
}

.client-list-title-container sp-picker {
width: 80px;
height: 20px;
}

.client-list-item {
min-height: 15px;
display: flex;
justify-content: space-between;
align-items: baseline;
position: relative;
cursor: pointer;
}

.client-list-item:hover {
background-color: rgba(127, 127, 127, .1);
}

.client-list-item .client-list-item-left {
Expand All @@ -161,9 +184,15 @@
align-items: center;
height: 20px;
}

.client-list-item .client-list-item-left>div, .client-list-item .client-list-item-left>span {
margin-left: 5px;
}

.client-list-item .client-list-item-left svg {
cursor: pointer;
}

.client-list-item .client-list-item-left-active {
color: white;
}
Expand All @@ -181,19 +210,36 @@

.client-list-item .client-list-item-right {
white-space: nowrap;
color: #bbb;
display: flex;
flex-direction: row;
align-items: center;
justify-content: end;
cursor: default;
}

.client-list-item:hover .client-list-item-right .tips-icon {
display: inline-flex;
}

.client-list-item .client-list-item-right .tips-icon {
cursor: pointer;
display: none;
}

.client-list-item .client-list-item-right sp-label {
justify-content: flex-end;
cursor: pointer;
height: 20px;
}

.client-list-item .client-list-item-right sp-label.active {
color: white;
}

.client-list-item .client-list-item-right sp-action-button {
.client-list-item .client-list-item-right .action-button {
height: 20px;
width: 16px;
width: 30px;
margin-left: 5px;
}

Expand All @@ -210,4 +256,33 @@
.autorun-desc {
font-size: 10px;
display: block;
}

.action-button {
cursor: pointer;
background-color: #333;
border: 1px solid rgba(255, 255, 255, .2);
padding: 2px 4px;
border-radius: 4px;
display: inline-flex;
align-items: center;
justify-content: center;
}

.action-button:hover {
background-color: #444;
}

.panel-foot {
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
padding: 5px 0;
font-size: 12px;
background-color: rgba(127, 127, 127, .2);
}
.panel-foot a {
color: white;
text-decoration: underline;
}
Binary file modified plugins/sd-ppp_PS.ccx
Binary file not shown.
2 changes: 1 addition & 1 deletion plugins/web/comfy.js

Large diffs are not rendered by default.

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.6.0"
version = "1.6.1"
license = { file = "LICENSE" }

[project.urls]
Expand Down
8 changes: 2 additions & 6 deletions sdppp_python/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ async def c_get_image(sid, payload={}):
return
document = payload['document']

backendInstance = sdppp.backend_instances[document['instance_id']]

return await ProtocolPhotoshop.get_image(backendInstance,
return await ProtocolPhotoshop.get_image(document['instance_id'],
document_identify=document['identify'],
layer_identify=payload['layer_identify'],
boundaries=payload['boundaries'],
Expand All @@ -89,10 +87,8 @@ async def c_send_image(sid, payload={}):
if not sdppp.has_ps_instance():
return
document = payload['document']
print(sdppp.backend_instances.keys())
backendInstance = sdppp.backend_instances[document['instance_id']]

await ProtocolPhotoshop.send_images(backendInstance,
await ProtocolPhotoshop.send_images(document['instance_id'],
document_identify=document['identify'],
layer_identifies=payload['layer_identifies'],
boundaries=payload['boundaries'],
Expand Down
21 changes: 13 additions & 8 deletions sdppp_python/comfy/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ class GetDocumentNode:
FUNCTION = "action"
CATEGORY = "SD-PPP"

@classmethod
def IS_CHANGED(self, **kwargs):
sdppp_arg = kwargs['sdppp']
return sdppp_is_changed(sdppp, sdppp_arg, '')

@classmethod
def INPUT_TYPES(cls):
return {
Expand All @@ -172,8 +177,8 @@ def action(self, document_name, **kwargs):
document = json.loads(document_name)
result = call_async_func_in_server_thread(
ProtocolPhotoshop.get_document_info(
sdpppServer.backend_instances[document['instance_id']],
document['identify']
instance_id=document['instance_id'],
document_identify=document['identify']
)
)

Expand Down Expand Up @@ -212,8 +217,8 @@ def action(self, document, layer_or_group, **kwargs):

result = call_async_func_in_server_thread(
ProtocolPhotoshop.get_layer_info(
sdpppServer.backend_instances[document['instance_id']],
document['identify'],
instance_id=document['instance_id'],
document_identify=document['identify'],
layer_identify=layer_or_group
)
)
Expand Down Expand Up @@ -257,7 +262,7 @@ def action(self, layer_or_group, select, **kwargs):

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

result = call_async_func_in_server_thread(
ProtocolPhotoshop.get_linked_layers(
backend_instance=sdpppServer.backend_instances[document['instance_id']],
instance_id=document['instance_id'],
document_identify=document['identify'],
select=select[0],
layer_identifies=layer_identifies
Expand Down Expand Up @@ -349,7 +354,7 @@ def action(self, document, bound="", **kwargs):

result = call_async_func_in_server_thread(
ProtocolPhotoshop.get_selection(
backend_instance=sdpppServer.backend_instances[document['instance_id']],
instance_id=document['instance_id'],
document_identify=document['identify'],
boundary=convert_mask_to_boundary(bound),
)
Expand Down Expand Up @@ -437,7 +442,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=sdpppServer.backend_instances[document['instance_id']],
instance_id=document['instance_id'],
document_identify=document['identify'],
layer_identify=item_layer
)
Expand Down
4 changes: 2 additions & 2 deletions sdppp_python/comfy/nodes_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get_image(self, unique_id, prompt, layer_or_group, bound="", document="", **
start = time.time()
result = call_async_func_in_server_thread(
ProtocolPhotoshop.get_image(
backend_instance=sdppp.backend_instances[document['instance_id']],
instance_id=document['instance_id'],
document_identify=document['identify'],
layer_identify=item_layer,
boundary=convert_mask_to_boundary(item_bound)
Expand Down Expand Up @@ -231,7 +231,7 @@ def send_image(self, unique_id, prompt, images, layer_or_group, bound="", docume
})

call_async_func_in_server_thread(ProtocolPhotoshop.send_images(
backend_instance=sdppp.backend_instances[document['instance_id']],
instance_id=document['instance_id'],
document_identify=document['identify'],
image_blobs=[p['image_blob'] for p in params],
layer_identifies=[p['layer_identify'] for p in params],
Expand Down
Loading

0 comments on commit df24e8a

Please sign in to comment.