diff --git a/README.md b/README.md index 4a89534..f5937a1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/__init__.py b/__init__.py index 7948ca4..ca6d823 100644 --- a/__init__.py +++ b/__init__.py @@ -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= { diff --git a/images/editorchoice.png b/images/editorchoice.png new file mode 100644 index 0000000..dda98d1 Binary files /dev/null and b/images/editorchoice.png differ diff --git a/js/image_filter.js b/js/image_filter.js index 7ddee8b..48dd389 100644 --- a/js/image_filter.js +++ b/js/image_filter.js @@ -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], diff --git a/js/popup.js b/js/popup.js index baf4782..487d8d9 100644 --- a/js/popup.js +++ b/js/popup.js @@ -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}` : "")) } } diff --git a/pyproject.toml b/pyproject.toml index 4131c2a..08fecbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] diff --git a/string_utility_nodes.py b/string_utility_nodes.py index 182d71c..ed77299 100644 --- a/string_utility_nodes.py +++ b/string_utility_nodes.py @@ -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",)