This commit is contained in:
Chris
2025-03-30 11:25:16 +11:00
parent 6cbb3da75c
commit f76c17aae7
7 changed files with 26 additions and 7 deletions
+4 -2
View File
@@ -89,8 +89,6 @@ Other things (like prompts, segs etc.) that have been used can be selected using
## Mask Image Filter
**Note that the Mask Image Filter works with the new Mask Editor; it does not work with the old one**
Designed for a single image, when executed the Mask Image Filter node will automatically launch the mask editor.
![mask](images/mask.png)
@@ -103,6 +101,10 @@ mask the bit you don't like, before doing an img2img step.
Again, there is a timeout, and if you don't save a mask before the end of the timeout (or if you press the cancel button in the mask editor),
it will either cancel, or send a blank mask, depending on the option chosen.
**Note that the Mask Image Filter works with the new Mask Editor; it does not work with the old one**
![img](images/editorchoice.png)
---
## Text Image Filter
+1 -1
View File
@@ -9,7 +9,7 @@ from .image_filter import ImageFilter, MaskImageFilter, TextImageFilterWithExtra
from .list_utility_nodes import PickFromList, BatchFromImageList, ImageListFromBatch
from .string_utility_nodes import SplitByCommas, StringToFloat, StringToInt
VERSION = "1.2.2"
VERSION = "1.2.3"
WEB_DIRECTORY = "./js"
NODE_CLASS_MAPPINGS= {
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

+6
View File
@@ -31,6 +31,12 @@ app.registerExtension({
type: "boolean",
defaultValue: false
},
{
id: "ImageFilter.DetailedLogging",
name: "Turn on detailed logging",
type: "boolean",
defaultValue: false
},
],
setup() {
create('link', null, document.getElementsByTagName('HEAD')[0],
+5
View File
@@ -13,11 +13,16 @@ const CANCEL = "-3"
class Log {
static log(s) { if (s) console.log(s) }
static error(e) { console.error(e) }
static detail(s) {
if (app.ui.settings.getSettingValue("ImageFilter.DetailedLogging")) Log.log(s)
}
static message_in(message, extra) {
if (!app.ui.settings.getSettingValue("ImageFilter.DetailedLogging")) return
if (message.detail && !message.detail.tick) Log.log(`--> ${JSON.stringify(message.detail)}` + (extra ? ` ${extra}` : ""))
if (message.detail && message.detail.tick) Log.log(`--> tick`)
}
static message_out(response, extra) {
if (!app.ui.settings.getSettingValue("ImageFilter.DetailedLogging")) return
Log.log(`"<-- ${JSON.stringify(response)}` + (extra ? ` ${extra}` : ""))
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "cg-image-filter"
description = "A set of custom nodes that pause a workflow while you select images, add masks, or edit text."
version = "1.2.2"
version = "1.2.3"
license = { file = "LICENSE" }
[project.urls]
+9 -3
View File
@@ -15,9 +15,15 @@ class SplitByCommas:
}
def func(self, string:str, split:str=","):
bits = [r.strip() for r in string.split(split,5)]
padded = bits + [""]*5
return tuple(padded[:5] + [bits,])
bits = [r.strip() for r in string.split(split)]
as_list = [b for b in bits]
if len(bits)<=5:
bits += ["",]*(5-len(bits))
else:
bits = bits[:4] + [",".join(bits[4:]),]
bits.append(as_list)
return tuple(bits)
class StringToInt:
RETURN_TYPES = ("INT",)