mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-05-09 05:31:20 +08:00
fix
This commit is contained in:
parent
28ff3676b6
commit
811baef799
@ -40,6 +40,7 @@ NODE_CONFIG = {
|
|||||||
#images
|
#images
|
||||||
"ColorMatch": {"class": ColorMatch, "name": "Color Match"},
|
"ColorMatch": {"class": ColorMatch, "name": "Color Match"},
|
||||||
"AddLabel": {"class": AddLabel, "name": "Add Label"},
|
"AddLabel": {"class": AddLabel, "name": "Add Label"},
|
||||||
|
"ImageAndMaskPreview": {"class": ImageAndMaskPreview},
|
||||||
"ImageBatchMulti": {"class": ImageBatchMulti, "name": "Image Batch Multi"},
|
"ImageBatchMulti": {"class": ImageBatchMulti, "name": "Image Batch Multi"},
|
||||||
"ImageBatchTestPattern": {"class": ImageBatchTestPattern, "name": "Image Batch Test Pattern"},
|
"ImageBatchTestPattern": {"class": ImageBatchTestPattern, "name": "Image Batch Test Pattern"},
|
||||||
"ImageConcanate": {"class": ImageConcanate, "name": "Image Concanate"},
|
"ImageConcanate": {"class": ImageConcanate, "name": "Image Concanate"},
|
||||||
|
|||||||
@ -830,8 +830,8 @@ class GetMaskSize:
|
|||||||
"mask": ("MASK",),
|
"mask": ("MASK",),
|
||||||
}}
|
}}
|
||||||
|
|
||||||
RETURN_TYPES = ("MASK","INT", "INT", )
|
RETURN_TYPES = ("MASK","INT", "INT", "INT",)
|
||||||
RETURN_NAMES = ("mask", "width", "height",)
|
RETURN_NAMES = ("mask", "width", "height", "count",)
|
||||||
FUNCTION = "getsize"
|
FUNCTION = "getsize"
|
||||||
CATEGORY = "KJNodes/masking"
|
CATEGORY = "KJNodes/masking"
|
||||||
DESCRIPTION = """
|
DESCRIPTION = """
|
||||||
@ -843,9 +843,10 @@ and passes through the mask unchanged.
|
|||||||
def getsize(self, mask):
|
def getsize(self, mask):
|
||||||
width = mask.shape[2]
|
width = mask.shape[2]
|
||||||
height = mask.shape[1]
|
height = mask.shape[1]
|
||||||
|
count = mask.shape[0]
|
||||||
return {"ui": {
|
return {"ui": {
|
||||||
"text": [f"{width}x{height}"]},
|
"text": [f"{count}x{width}x{height}"]},
|
||||||
"result": (mask, width, height)
|
"result": (mask, width, height, count)
|
||||||
}
|
}
|
||||||
|
|
||||||
class GrowMaskWithBlur:
|
class GrowMaskWithBlur:
|
||||||
|
|||||||
@ -73,6 +73,27 @@ app.registerExtension({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "GetMaskSize":
|
||||||
|
const onConnectInput = nodeType.prototype.onConnectInput;
|
||||||
|
nodeType.prototype.onConnectInput = function (targetSlot, type, output, originNode, originSlot) {
|
||||||
|
const v = onConnectInput?.(this, arguments);
|
||||||
|
targetSlot.outputs[1]["name"] = "width"
|
||||||
|
targetSlot.outputs[2]["name"] = "height"
|
||||||
|
targetSlot.outputs[3]["name"] = "count"
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
const onExecuted = nodeType.prototype.onExecuted;
|
||||||
|
nodeType.prototype.onExecuted = function(message) {
|
||||||
|
const r = onExecuted? onExecuted.apply(this,arguments): undefined
|
||||||
|
let values = message["text"].toString().split('x').map(Number);
|
||||||
|
this.outputs[1]["name"] = values[1] + " width"
|
||||||
|
this.outputs[2]["name"] = values[2] + " height"
|
||||||
|
this.outputs[3]["name"] = values[0] + " count"
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case "JoinStringMulti":
|
case "JoinStringMulti":
|
||||||
nodeType.prototype.onNodeCreated = function () {
|
nodeType.prototype.onNodeCreated = function () {
|
||||||
this._type = "STRING"
|
this._type = "STRING"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user