From ac0eebb1eef3510a0f89c1d7e5cf0721217246d3 Mon Sep 17 00:00:00 2001 From: zombieyang Date: Tue, 8 Apr 2025 19:13:09 +0800 Subject: [PATCH] send text to layer bugfix --- sdppp_python/comfy/nodes.py | 1 + sdppp_python/comfy/nodes_legacy.py | 2 +- typescripts/src/common/zh-cn.mts | 2 ++ typescripts/src/sdsystem/comfy/comfy-nodes/nodes.mts | 3 ++- typescripts/src/sdsystem/comfy/litegraph/fe-widgets.mts | 1 - 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sdppp_python/comfy/nodes.py b/sdppp_python/comfy/nodes.py index 1bb9c93..f497b99 100644 --- a/sdppp_python/comfy/nodes.py +++ b/sdppp_python/comfy/nodes.py @@ -437,6 +437,7 @@ def define_comfyui_nodes(sdpppServer): class SendTextToLayerNode: RETURN_TYPES = ("DOCUMENT",) + OUTPUT_NODE = True FUNCTION = "action" CATEGORY = "SD-PPP" diff --git a/sdppp_python/comfy/nodes_legacy.py b/sdppp_python/comfy/nodes_legacy.py index 8ee42ad..9848de9 100644 --- a/sdppp_python/comfy/nodes_legacy.py +++ b/sdppp_python/comfy/nodes_legacy.py @@ -138,10 +138,10 @@ def define_comfyui_nodes_legacy(sdppp): class SendImageToPhotoshopLayerNode: RETURN_TYPES = ("DOCUMENT",) + OUTPUT_NODE = True INPUT_IS_LIST = True FUNCTION = "send_image" CATEGORY = "SD-PPP" - OUTPUT_NODE = True @classmethod def IS_CHANGED(self, **kwargs): diff --git a/typescripts/src/common/zh-cn.mts b/typescripts/src/common/zh-cn.mts index 8e690b6..a31f63a 100644 --- a/typescripts/src/common/zh-cn.mts +++ b/typescripts/src/common/zh-cn.mts @@ -49,6 +49,7 @@ export default { 'bound linked': '范围参数已链接', 'document': '文档', 'Document': '文档', + 'DOCUMENT': '文档', 'document_name': '文档名字id', 'layer_nameid': '图层名字id', 'layer_name': '图层名字', @@ -60,6 +61,7 @@ export default { 'center_x': '中心点x', 'center_y': '中心点y', 'opacity': '透明度', + 'layer': '图层', 'layer_or_group': '图层(或组)', 'Layer_or_group': '图层(或组)', 'bound': '范围', diff --git a/typescripts/src/sdsystem/comfy/comfy-nodes/nodes.mts b/typescripts/src/sdsystem/comfy/comfy-nodes/nodes.mts index a8a7a71..be2ad08 100644 --- a/typescripts/src/sdsystem/comfy/comfy-nodes/nodes.mts +++ b/typescripts/src/sdsystem/comfy/comfy-nodes/nodes.mts @@ -56,7 +56,8 @@ export class SendTextToLayerNode extends SDPPPDownloadableNode { protected async update() { super.update(); this.node.inputs[0].label = i18n(this.node.inputs[0].name) - this.node.outputs[0].label = i18n(this.node.outputs[0].name) + this.node.inputs[1].label = i18n(this.node.inputs[1].name) + this.node.outputs[0] && (this.node.outputs[0].label = i18n(this.node.outputs[0].name)) } } export class GetTextFromLayerNode extends SDPPPDownloadableNode { diff --git a/typescripts/src/sdsystem/comfy/litegraph/fe-widgets.mts b/typescripts/src/sdsystem/comfy/litegraph/fe-widgets.mts index 91f9d47..5d603ef 100644 --- a/typescripts/src/sdsystem/comfy/litegraph/fe-widgets.mts +++ b/typescripts/src/sdsystem/comfy/litegraph/fe-widgets.mts @@ -58,7 +58,6 @@ export class DocumentWidget extends SDPPPComboWidget { const documentWidget = node.addWidget('combo', name, options[0] || '', () => { }, { forceInput: true, values: makeDocumentDataOptions }) documentWidget.serializeValue = async () => { const data = parseDocumentOption(documentWidget.value); - console.log('documentWidgetData: ', data); if (!data) return ''; return JSON.stringify({ instance_id: data.instance_id,