This commit is contained in:
zombieyang
2024-12-02 21:11:00 +08:00
parent dbb61e0a16
commit 5aa06e75ed
11 changed files with 48 additions and 28 deletions
+6 -2
View File
@@ -107,10 +107,14 @@ def define_comfyui_nodes(sdppp):
class GetLayerNode:
RETURN_TYPES = ("LAYER", "BOUND", "LAYER_INFO")
RETURN_NAMES = ("layer_or_group", "layer_bound", "layer_info")
RETURN_NAMES = ("layer_or_group", "layer boundary", "layer_info")
FUNCTION = "action"
CATEGORY = "SD-PPP"
@classmethod
def IS_CHANGED(self, **kwargs):
print('getlayer is_changed')
@classmethod
def INPUT_TYPES(cls):
return {
@@ -247,7 +251,7 @@ def define_comfyui_nodes(sdppp):
"document": ("DOCUMENT", {"default": None, "sdppp_type": "DOCUMENT"}),
},
"optional": {
"bound": ('BOUND', {"default": None}),
"bounds [optional]": ('BOUND', {"default": None}),
}
}
+9 -4
View File
@@ -65,12 +65,17 @@ def define_comfyui_nodes_legacy(sdppp):
@classmethod
def IS_CHANGED(self, unique_id, prompt, layer_or_group, bound="", document=""):
linked_style, document = parse_params(unique_id, prompt, layer_or_group, document)
# 'prompt' is not valid in IS_CHANGED
# so we cant figure out if this node is using linked style or not
# just consider to support linked style here.
if not isinstance(document, list) or len(document) == 0 or not isinstance(document[0], str):
return np.random.rand()
document = json.loads(document[0])
if ('instance_id' not in document) or (document['instance_id'] not in sdppp.backend_instances):
return np.random.rand()
return sdppp.backend_instances[document['instance_id']].data['canvasStateID']
return sdppp.backend_instances[document['instance_id']].store.data['canvasStateID']
@classmethod
def INPUT_TYPES(cls):
@@ -81,7 +86,7 @@ def define_comfyui_nodes_legacy(sdppp):
"optional": {
# compat combo selection type
"document": ("STRING", {"default": "", "sdppp_type": "DOCUMENT_nameid"}),
"bound": ('BOUND', {"default": None}),
"bounds [optional]": ('BOUND', {"default": None}),
},
"hidden": {
"unique_id": "UNIQUE_ID",
@@ -201,7 +206,7 @@ def define_comfyui_nodes_legacy(sdppp):
"optional": {
# compat combo selection type
"document": ("STRING", {"default": "", "sdppp_type": "DOCUMENT_nameid"}),
"bound": ('BOUND', {"default": None}),
"bounds [optional]": ('BOUND', {"default": None}),
},
"hidden": {
"unique_id": "UNIQUE_ID",