Merge 6717a58837544c64a7966818466e368c31ca1483 into 06a60ac3fec854909f35aba20aa5be39ff59a6e3

This commit is contained in:
Makki Shizu 2025-12-02 01:30:55 +08:00 committed by GitHub
commit 300721ea68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -785,8 +785,8 @@ class GetImageSizeAndCount:
"image": ("IMAGE",), "image": ("IMAGE",),
}} }}
RETURN_TYPES = ("IMAGE","INT", "INT", "INT",) RETURN_TYPES = ("IMAGE","INT", "INT", "INT", "INT",)
RETURN_NAMES = ("image", "width", "height", "count",) RETURN_NAMES = ("image", "width", "height", "count", "channels",)
FUNCTION = "getsize" FUNCTION = "getsize"
CATEGORY = "KJNodes/image" CATEGORY = "KJNodes/image"
DESCRIPTION = """ DESCRIPTION = """
@ -799,9 +799,10 @@ and passes it through unchanged.
width = image.shape[2] width = image.shape[2]
height = image.shape[1] height = image.shape[1]
count = image.shape[0] count = image.shape[0]
channels = image.shape[3]
return {"ui": { return {"ui": {
"text": [f"{count}x{width}x{height}"]}, "text": [f"{count}x{width}x{height}x{channels}"]},
"result": (image, width, height, count) "result": (image, width, height, count, channels)
} }
class GetLatentSizeAndCount: class GetLatentSizeAndCount:

View File

@ -175,6 +175,7 @@ app.registerExtension({
this.outputs[1]["label"] = "width" this.outputs[1]["label"] = "width"
this.outputs[2]["label"] = "height" this.outputs[2]["label"] = "height"
this.outputs[3]["label"] = "count" this.outputs[3]["label"] = "count"
this.outputs[4]["label"] = "channels"
return v; return v;
} }
//const onGetImageSizeExecuted = nodeType.prototype.onExecuted; //const onGetImageSizeExecuted = nodeType.prototype.onExecuted;
@ -187,6 +188,7 @@ app.registerExtension({
this.outputs[1]["label"] = values[1] + " width" this.outputs[1]["label"] = values[1] + " width"
this.outputs[2]["label"] = values[2] + " height" this.outputs[2]["label"] = values[2] + " height"
this.outputs[3]["label"] = values[0] + " count" this.outputs[3]["label"] = values[0] + " count"
this.outputs[4]["label"] = values[3] + " channels"
return r return r
} }
break; break;