diff --git a/README.md b/README.md index 9768ea9..e5cfd9b 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ There's also a helper node, 'Split String by Commas' that can be used if you wan --- +## Global Options + +In the main Comfy options, under 'ImageFilter', there is a setting to turn on or off the sound played when one of these nodes activates. + ## Image Filter The image filter node pauses execution of the workflow while you choose which, if any, of the images produced, you want to progress. @@ -47,7 +51,6 @@ Here's a simple use: generate a batch of images and pick which ones you want to - 'Click to send': clicking an image also sends it - 'autosend one if identical': automatically send a single image if all the images are identical -- 'play sound': play a chime when the window pops up (the sound played is 'ding.mp3' from the 'js' folder) ### Optional inputs diff --git a/__init__.py b/__init__.py index 88ac668..0440355 100644 --- a/__init__.py +++ b/__init__.py @@ -8,7 +8,7 @@ from .image_filter import ImageFilter, TextImageFilter, MaskImageFilter, TextImageFilterWithExtras from .split_by_commas import SplitByCommas -VERSION = "1.1.3" +VERSION = "1.1.4" WEB_DIRECTORY = "./js" NODE_CLASS_MAPPINGS= { diff --git a/js/image_filter.js b/js/image_filter.js index 7fbf9de..f2f0bae 100644 --- a/js/image_filter.js +++ b/js/image_filter.js @@ -6,6 +6,14 @@ import { popup } from "./popup.js"; app.registerExtension({ name: "cg.image_filter", + settings: [ + { + id: "ImageFilter.PlaySound", + name: "Play sound when activating", + type: "boolean", + defaultValue: true + }, + ], setup() { create('link', null, document.getElementsByTagName('HEAD')[0], {'rel':'stylesheet', 'type':'text/css', 'href': new URL("./filter.css", import.meta.url).href } ) diff --git a/js/popup.js b/js/popup.js index 3cf3400..6fac723 100644 --- a/js/popup.js +++ b/js/popup.js @@ -37,8 +37,6 @@ class Popup extends HTMLSpanElement { this.click_sends_label = create('label', 'control_text', this.checkboxes, {for:"click_sends", innerText:"click to send"}) this.auto_send = create('input', 'control', this.checkboxes, {type:"checkbox", id:"auto_send"}) this.auto_send_label = create('label', 'control_text', this.checkboxes, {for:"auto_send", innerText:"autosend one if identical"}) - this.play_sound = create('input', 'control', this.checkboxes, {type:"checkbox", id:"play_sound", checked:true}) - this.play_sound_label = create('label', 'control_text', this.checkboxes, {for:"play_sound", innerText:"play sound"}) this.send_button = create('button', 'control', this.buttons, {innerText:"Send (S)"} ) this.cancel_button = create('button', 'control', this.buttons, {innerText:"Cancel (X)"} ) this.extras = create('span', 'extras', this.buttons) @@ -68,7 +66,7 @@ class Popup extends HTMLSpanElement { } maybe_play_sound() { - if (this.play_sound.checked) this.audio.play(); + if (app.ui.settings.getSettingValue("ImageFilter.PlaySound")) this.audio.play(); } send_current_state() { diff --git a/pyproject.toml b/pyproject.toml index 73e77be..a54cace 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.1.3" +version = "1.1.4" license = { file = "LICENSE" } [project.urls]