mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-01-24 00:14:37 +08:00
fix
This commit is contained in:
parent
28ff3676b6
commit
811baef799
@ -40,6 +40,7 @@ NODE_CONFIG = {
|
||||
#images
|
||||
"ColorMatch": {"class": ColorMatch, "name": "Color Match"},
|
||||
"AddLabel": {"class": AddLabel, "name": "Add Label"},
|
||||
"ImageAndMaskPreview": {"class": ImageAndMaskPreview},
|
||||
"ImageBatchMulti": {"class": ImageBatchMulti, "name": "Image Batch Multi"},
|
||||
"ImageBatchTestPattern": {"class": ImageBatchTestPattern, "name": "Image Batch Test Pattern"},
|
||||
"ImageConcanate": {"class": ImageConcanate, "name": "Image Concanate"},
|
||||
|
||||
@ -830,8 +830,8 @@ class GetMaskSize:
|
||||
"mask": ("MASK",),
|
||||
}}
|
||||
|
||||
RETURN_TYPES = ("MASK","INT", "INT", )
|
||||
RETURN_NAMES = ("mask", "width", "height",)
|
||||
RETURN_TYPES = ("MASK","INT", "INT", "INT",)
|
||||
RETURN_NAMES = ("mask", "width", "height", "count",)
|
||||
FUNCTION = "getsize"
|
||||
CATEGORY = "KJNodes/masking"
|
||||
DESCRIPTION = """
|
||||
@ -843,9 +843,10 @@ and passes through the mask unchanged.
|
||||
def getsize(self, mask):
|
||||
width = mask.shape[2]
|
||||
height = mask.shape[1]
|
||||
count = mask.shape[0]
|
||||
return {"ui": {
|
||||
"text": [f"{width}x{height}"]},
|
||||
"result": (mask, width, height)
|
||||
"text": [f"{count}x{width}x{height}"]},
|
||||
"result": (mask, width, height, count)
|
||||
}
|
||||
|
||||
class GrowMaskWithBlur:
|
||||
|
||||
@ -73,6 +73,27 @@ app.registerExtension({
|
||||
});
|
||||
}
|
||||
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":
|
||||
nodeType.prototype.onNodeCreated = function () {
|
||||
this._type = "STRING"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user