This commit is contained in:
kijai 2024-07-28 21:05:45 +03:00
parent adb35ee233
commit 7ea33f68fc
2 changed files with 5 additions and 6 deletions

View File

@ -546,7 +546,6 @@ class AddLabel:
"caption": ("STRING", {"default": "", "forceInput": True}),
}
}
RETURN_TYPES = ("IMAGE",)
FUNCTION = "addlabel"
CATEGORY = "KJNodes/text"
@ -606,7 +605,7 @@ ComfyUI/custom_nodes/ComfyUI-KJNodes/fonts
if caption == "":
processed_images = [process_image(img, text) for img in image]
else:
assert len(caption) == batch_size, "Number of captions does not match number of images"
assert len(caption) == batch_size, f"Number of captions {(len(caption))} does not match number of images"
processed_images = [process_image(img, cap) for img, cap in zip(image, caption)]
processed_batch = torch.cat(processed_images, dim=0)

View File

@ -79,7 +79,7 @@ app.registerExtension({
case "GetMaskSizeAndCount":
const onGetMaskSizeConnectInput = nodeType.prototype.onConnectInput;
nodeType.prototype.onConnectInput = function (targetSlot, type, output, originNode, originSlot) {
const v = onGetMaskSizeConnectInput?.(this, arguments);
const v = onGetMaskSizeConnectInput? onGetMaskSizeConnectInput.apply(this, arguments): undefined
this.outputs[1]["name"] = "width"
this.outputs[2]["name"] = "height"
this.outputs[3]["name"] = "count"
@ -99,7 +99,7 @@ app.registerExtension({
case "GetImageSizeAndCount":
const onGetImageSizeConnectInput = nodeType.prototype.onConnectInput;
nodeType.prototype.onConnectInput = function (targetSlot, type, output, originNode, originSlot) {
const v = onGetImageSizeConnectInput?.(this, arguments);
const v = onGetImageSizeConnectInput? onGetImageSizeConnectInput.apply(this, arguments): undefined
this.outputs[1]["name"] = "width"
this.outputs[2]["name"] = "height"
this.outputs[3]["name"] = "count"
@ -119,7 +119,7 @@ app.registerExtension({
case "PreviewAnimation":
const onPreviewAnimationConnectInput = nodeType.prototype.onConnectInput;
nodeType.prototype.onConnectInput = function (targetSlot, type, output, originNode, originSlot) {
const v = onPreviewAnimationConnectInput?.(this, arguments);
const v = onPreviewAnimationConnectInput? onPreviewAnimationConnectInput.apply(this, arguments): undefined
this.title = "Preview Animation"
return v;
}
@ -135,7 +135,7 @@ app.registerExtension({
case "VRAM_Debug":
const onVRAM_DebugConnectInput = nodeType.prototype.onConnectInput;
nodeType.prototype.onConnectInput = function (targetSlot, type, output, originNode, originSlot) {
const v = onVRAM_DebugConnectInput?.(this, arguments);
const v = onVRAM_DebugConnectInput? onVRAM_DebugConnectInput.apply(this, arguments): undefined
this.outputs[3]["name"] = "freemem_before"
this.outputs[4]["name"] = "freemem_after"
return v;