From 26ea8e93ee3625caab0be089a93af8763cde7dac Mon Sep 17 00:00:00 2001
From: WebDev9000 <6970043+WebDev9000@users.noreply.github.com>
Date: Sat, 25 Nov 2023 14:19:52 -0800
Subject: [PATCH] Init
---
.gitignore | 1 +
IgnoreBraces.py | 20 ++++++++++++++++++++
LICENSE | 21 +++++++++++++++++++++
README.md | 18 ++++++++++++++++++
SettingsSwitch.py | 28 ++++++++++++++++++++++++++++
__init__.py | 14 ++++++++++++++
6 files changed, 102 insertions(+)
create mode 100644 .gitignore
create mode 100644 IgnoreBraces.py
create mode 100644 LICENSE
create mode 100644 README.md
create mode 100644 SettingsSwitch.py
create mode 100644 __init__.py
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..bee8a64
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+__pycache__
diff --git a/IgnoreBraces.py b/IgnoreBraces.py
new file mode 100644
index 0000000..2e18b9a
--- /dev/null
+++ b/IgnoreBraces.py
@@ -0,0 +1,20 @@
+class IgnoreBraces:
+ def __init__(self, ):
+ pass
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "text": ("STRING", {"multiline": True, "dynamicPrompts": False}),
+ }
+ }
+
+ RETURN_TYPES = ("STRING",)
+ RETURN_NAMES = ("text",)
+ OUTPUT_NODE = True
+ FUNCTION = "text"
+ CATEGORY = "WebDev9000"
+
+ def text(self, text):
+ return (text,)
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..c10f238
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 WebDev
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e37d8e7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,18 @@
+# WebDev9000 Nodes
+
+A few misc nodes I've created for various needs.
+
+## IgnoreBrace
+
+A string input node that disables "dynamic prompts", thereby allowing unescaped braces { } in your prompts.
+
+Created to fix an issue loading LoRA with braces in their names via [ComfyUI Prompt Control](https://github.com/asagi4/comfyui-prompt-control).
+Without disabling dynamic prompts, braces in the filename are otherwise incompatible even when escaped.
+
+## SettingsSwitch
+
+A node I made to switch between two sets of settings I use often in a high-res pass.
+
+Plug it into Steps and Denoise on a KSampler node to quickly toggle between two presets.
+Low denoise = steps: 5, denoise: 0.35
+High denoise = steps: 10, denoise: 0.5
\ No newline at end of file
diff --git a/SettingsSwitch.py b/SettingsSwitch.py
new file mode 100644
index 0000000..d122d5c
--- /dev/null
+++ b/SettingsSwitch.py
@@ -0,0 +1,28 @@
+class SettingsSwitch:
+ def __init__(self, ):
+ pass
+
+ @classmethod
+ def INPUT_TYPES(s):
+ return {
+ "required": {
+ "preset": (["low noise", "high noise"],),
+ }
+ }
+
+ RETURN_TYPES = ("INT","FLOAT")
+ RETURN_NAMES = ("steps","denoise")
+ OUTPUT_NODE = True
+ FUNCTION = "doit"
+ CATEGORY = "WebDev9000"
+
+ def doit(self, preset):
+
+ if (preset == "low noise"):
+ steps = 5
+ denoise = 0.35
+ else:
+ steps = 10
+ denoise = 0.5
+
+ return (steps, denoise)
\ No newline at end of file
diff --git a/__init__.py b/__init__.py
new file mode 100644
index 0000000..79ad8d9
--- /dev/null
+++ b/__init__.py
@@ -0,0 +1,14 @@
+from .IgnoreBraces import IgnoreBraces
+from .SettingsSwitch import SettingsSwitch
+
+NODE_CLASS_MAPPINGS = {
+ "IgnoreBraces": IgnoreBraces,
+ "SettingsSwitch": SettingsSwitch,
+}
+
+NODE_DISPLAY_NAME_MAPPINGS = {
+ "IgnoreBraces": "Ignore Braces",
+ "SettingsSwitch": "Settings Switch",
+}
+
+__all__ = [NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS]
\ No newline at end of file