new node added

This commit is contained in:
Satadal Dhara
2025-11-14 21:25:31 +05:30
parent 6b358ac267
commit 19e94ff1e0
13 changed files with 59 additions and 58 deletions
+29 -33
View File
@@ -16,6 +16,7 @@ It includes:
- **Prompt Machine:** Easy prompt selection from a CSV for positive/negative prompt workflows.
- **Touchpad Pan & Zoom:** Seamless navigation for large images in the ComfyUI preview panel.
- **Resolution Machine:** Quick selection of model-specific image resolutions for popular models.
- **Save Image w/Metadata:** saving images with meta data and with different file formats.
---
@@ -100,29 +101,31 @@ It includes:
---
### Prompt Machine
### 💬 Prompt Machine
Loads positive and negative prompts from a `prompts.csv` file, allowing you to quickly switch between predefined prompt sets in your workflow.
| Name | Type | Description |
|-------------|--------|------------------------------------|
| `selection` | STRING | Prompt set name from CSV |
**Outputs:**
| Name | Type | Description |
|-------------|--------|------------------------------------|
| `positive` | STRING | Positive prompt |
| `negative` | STRING | Negative prompt |
---
### Touchpad Pan & Zoom
- **No node configuration required.**
- Enables pan/zoom in the ComfyUI preview panel for large images.
### 🖱️ Touchpad Pan & Zoom
A UI enhancement that enables smooth, intuitive touchpad-based panning and zooming on images in the ComfyUI preview panel. No node configuration is required—it works automatically.
---
### Resolution Machine
### 📏 Resolution Machine
Provides dropdowns to quickly select recommended resolutions for popular models like SDXL, Pony, SD3, and more. Selecting a preset auto-populates width and height, but you can also set them manually.
| Name | Type | Description |
|--------------|--------|--------------------------------------------------|
@@ -132,38 +135,31 @@ It includes:
| `height` | INT | Image height (can be set manually) |
**Outputs:**
| Name | Type | Description |
|----------|------|----------------------------|
| `width` | INT | Final image width |
| `height` | INT | Final image height |
---
### 💾 Save Image w/Metadata
An advanced image saving node with dynamic pathing, metadata embedding, and filename collision avoidance.
### 💾 Save Image w/Metadata — Inputs & Outputs
| Name | Type | Description |
|--------------------|---------|-------------|
| `path_and_filename`| STRING | Single required path + filename string. Examples: `comfy`, `Test/comfy`, `SDXL/Test/comfy`. The last segment is used as filename (extension ignored); preceding segments are folder path under ComfyUI output directory. |
| `extension` | STRING | File format dropdown: `png`, `jpeg`, `webp`. |
| `custom_string` | STRING | Optional custom text to embed in metadata. |
| `quality_jpeg_or_webp` | INT | JPEG/WEBP quality (1-100). |
| `lossless_webp` | BOOLEAN | If true, WEBP will be saved lossless (when supported). |
**Hidden inputs:**
- `prompt` — a dict-like object the node will consult to resolve `%...%` placeholders used in the `path_and_filename` string (best-effort lookup).
**Outputs:**
The node returns no tensor outputs but updates the UI with the list of saved filenames and their subfolders (so ComfyUI will display the saved files in the results panel).
**Behavior notes & examples:**
- If `path_and_filename` is `comfy` and `extension` is `png`, the node saves `OUTPUT_DIR/comfy.png` (or `comfy_0001.png` if it already exists).
- If `path_and_filename` is `SDXL/Test/comfy`, the node creates `OUTPUT_DIR/SDXL/Test/` if missing and saves `comfy.<ext>` inside it.
- You may use placeholders in `path_and_filename`, for example `%title%/img`, which will be resolved from the `prompt` dict when possible.
| Name | Type | Description |
|------------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `path_and_filename` | STRING | Path and filename string (e.g., `MyRenders/character`). The last segment is the filename; preceding segments are folders under the ComfyUI `output` directory. |
| `extension` | STRING | File format: `png`, `jpeg`, `webp`. |
| `custom_string` | STRING | Optional custom text to embed in metadata. |
| `quality_jpeg_or_webp` | INT | Quality for JPEG/WEBP formats (1-100). |
| `lossless_webp` | BOOLEAN | If true, saves WEBP files losslessly. |
| `prompt` (hidden) | DICT | Workflow data used to resolve `%...%` placeholders in the filename (e.g., `%sampler_name%`). |
**Key Behaviors:**
- **Dynamic Paths:** Automatically creates any missing folders in your specified path.
- **Metadata:** Embeds workflow data into PNG (tEXt), JPEG (EXIF), and WEBP (EXIF) files.
- **Collision Safe:** Prevents overwrites by appending a number (e.g., `image_0001.png`) if the filename already exists.
- **UI Output:** Returns a list of saved files to the ComfyUI manager/preview panel.
## 📝 License
+15 -9
View File
@@ -1,22 +1,28 @@
from .nodes.upscale_machine import Upscale_Machine
# __init__.py
# Import all the node classes from the nodes directory
from .nodes.prompt_machine import Prompt_Machine
from .nodes.resolution_machine import Resolution_Machine
from .nodes.save_image_metadata import ImageSaveWithMetadata
from .nodes.upscale_machine import Upscale_Machine
# A dictionary that maps class names to class objects
NODE_CLASS_MAPPINGS = {
"Upscale_Machine": Upscale_Machine,
"Prompt_Machine": Prompt_Machine,
"Resolution_Machine": Resolution_Machine,
"Save_Image_Metadata": ImageSaveWithMetadata,
"ImageSaveWithMetadata": ImageSaveWithMetadata,
"Upscale_Machine": Upscale_Machine,
}
# A dictionary that maps display names to class names
NODE_DISPLAY_NAME_MAPPINGS = {
"Upscale_Machine": "Upscale Machine",
"Prompt_Machine": "Prompt Machine",
"Resolution_Machine": "Resolution Machine",
"Save_Image_Metadata": "Save Image Metadata",
"Prompt Machine": "Prompt_Machine",
"Resolution Machine": "Resolution_Machine",
"Save Image w/Metadata": "ImageSaveWithMetadata",
"Upscale Machine": "Upscale_Machine",
}
WEB_DIRECTORY = "./web"
# A dictionary that contains web directory information
WEB_DIRECTORY = "./js"
__all__ = ["WEB_DIRECTORY", "NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"]
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS', 'WEB_DIRECTORY']
+13
View File
@@ -34,3 +34,16 @@ Space Hologram,"hologram floating in space, a vibrant digital illustration, drib
Cute Creatures,"3d fluffy, closeup cute and adorable, cute big circular reflective eyes, long fuzzy fur, Pixar render, unreal engine cinematic smooth, intricate detail, cinematic",,
Realistic Photo Portraits,"RAW candid cinema, 16mm, color graded portra 400 film, remarkable color, ultra realistic, textured skin, remarkable detailed pupils, realistic dull skin noise, visible skin detail, skin fuzz, dry skin, shot with cinematic camera",,
Professional Scenic Photographs,"long shot scenic professional photograph of {prompt}, perfect viewpoint, highly detailed, wide-angle lens, hyper realistic, with dramatic sky, polarizing filter, natural lighting, vivid colors, everything in sharp focus, HDR, UHD, 64K",,
"Cotton, Fine","{prompt} in fine cotton fabric, highly detailed, gorgeous, matte fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Cotton, Regular","{prompt} dress in heavy knit cotton fabric, matte fabric, gorgeous cloth, highly detailed, cinematic","wrinkles, linen, seethrough, transparent, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Denim,"{prompt} in heavy japanese (denim fabric), highly detailed, hard drape","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Flannel, Brushed","{prompt} in soft woven brushed flannel, highly detailed, fuzzy flannel cloth, cashmere flannel","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Latex/Plastic,"{prompt} dress in shiny latex plastic material, expensive exquisite latex fabric, tight fitting","metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Latex/Plastic, Glossy","{prompt} in shiny wet glossy latex material, hard lighting, expensive exquisite latex fabric, tight fitting","metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Leather,"{prompt} in smooth thin leather, highly detailed, expensive exquisite leather","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Linen,"{prompt} in linen fabric, loosely woven, gorgeous cloth, highly detailed","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Silk,"{prompt} in silk cloth, highly detailed, gorgeous, sheen lustre","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Velvet,"{prompt} in smooth velvet fabric, gorgeous exquisite cloth, highly detailed, fuzzy velvet cloth, expensive","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Wool, Fine knit","{prompt} in wool cloth, highly detailed, gorgeous, fine knit cashmere wool fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Wool, Heavy knit","{prompt} in chunky heavy wool yarn, highly detailed, heavy knit large wool fabric, sailor's wool","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Wool, Cable knit","{prompt} in chunky heavy cable knit wool yarn, highly detailed, cable knit large wool fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
1 name positive negative note
34 Cute Creatures 3d fluffy, closeup cute and adorable, cute big circular reflective eyes, long fuzzy fur, Pixar render, unreal engine cinematic smooth, intricate detail, cinematic
35 Realistic Photo Portraits RAW candid cinema, 16mm, color graded portra 400 film, remarkable color, ultra realistic, textured skin, remarkable detailed pupils, realistic dull skin noise, visible skin detail, skin fuzz, dry skin, shot with cinematic camera
36 Professional Scenic Photographs long shot scenic professional photograph of {prompt}, perfect viewpoint, highly detailed, wide-angle lens, hyper realistic, with dramatic sky, polarizing filter, natural lighting, vivid colors, everything in sharp focus, HDR, UHD, 64K
37 Cotton, Fine {prompt} in fine cotton fabric, highly detailed, gorgeous, matte fabric anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
38 Cotton, Regular {prompt} dress in heavy knit cotton fabric, matte fabric, gorgeous cloth, highly detailed, cinematic wrinkles, linen, seethrough, transparent, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
39 Denim {prompt} in heavy japanese (denim fabric), highly detailed, hard drape anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
40 Flannel, Brushed {prompt} in soft woven brushed flannel, highly detailed, fuzzy flannel cloth, cashmere flannel anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
41 Latex/Plastic {prompt} dress in shiny latex plastic material, expensive exquisite latex fabric, tight fitting metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
42 Latex/Plastic, Glossy {prompt} in shiny wet glossy latex material, hard lighting, expensive exquisite latex fabric, tight fitting metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
43 Leather {prompt} in smooth thin leather, highly detailed, expensive exquisite leather anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
44 Linen {prompt} in linen fabric, loosely woven, gorgeous cloth, highly detailed anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
45 Silk {prompt} in silk cloth, highly detailed, gorgeous, sheen lustre anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
46 Velvet {prompt} in smooth velvet fabric, gorgeous exquisite cloth, highly detailed, fuzzy velvet cloth, expensive anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
47 Wool, Fine knit {prompt} in wool cloth, highly detailed, gorgeous, fine knit cashmere wool fabric anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
48 Wool, Heavy knit {prompt} in chunky heavy wool yarn, highly detailed, heavy knit large wool fabric, sailor's wool anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
49 Wool, Cable knit {prompt} in chunky heavy cable knit wool yarn, highly detailed, cable knit large wool fabric anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
+1 -1
View File
@@ -5,7 +5,7 @@ from server import PromptServer
from aiohttp import web
# Directory for CSV files (adjust if needed)
CSV_DIR = os.path.join(os.path.dirname(__file__), "..", "prompts")
CSV_DIR = os.path.join(os.path.dirname(__file__), "..", "asset")
def list_csv_files():
try:
+1 -1
View File
@@ -7,7 +7,7 @@ NODE_NAME = "Resolution_Machine"
# Path to JSON config (root of SATA_UtilityNode folder)
CONFIG_PATH = os.path.join(
os.path.dirname(os.path.dirname(__file__)), "resolutions.json"
os.path.dirname(os.path.dirname(__file__)), "asset","resolutions.json"
)
def load_config():
-14
View File
@@ -1,14 +0,0 @@
name,positive,negative,note
"Cotton, Fine","{prompt} in fine cotton fabric, highly detailed, gorgeous, matte fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Cotton, Regular","{prompt} dress in heavy knit cotton fabric, matte fabric, gorgeous cloth, highly detailed, cinematic","wrinkles, linen, seethrough, transparent, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Denim,"{prompt} in heavy japanese (denim fabric), highly detailed, hard drape","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Flannel, Brushed","{prompt} in soft woven brushed flannel, highly detailed, fuzzy flannel cloth, cashmere flannel","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Latex/Plastic,"{prompt} dress in shiny latex plastic material, expensive exquisite latex fabric, tight fitting","metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Latex/Plastic, Glossy","{prompt} in shiny wet glossy latex material, hard lighting, expensive exquisite latex fabric, tight fitting","metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Leather,"{prompt} in smooth thin leather, highly detailed, expensive exquisite leather","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Linen,"{prompt} in linen fabric, loosely woven, gorgeous cloth, highly detailed","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Silk,"{prompt} in silk cloth, highly detailed, gorgeous, sheen lustre","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
Velvet,"{prompt} in smooth velvet fabric, gorgeous exquisite cloth, highly detailed, fuzzy velvet cloth, expensive","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Wool, Fine knit","{prompt} in wool cloth, highly detailed, gorgeous, fine knit cashmere wool fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Wool, Heavy knit","{prompt} in chunky heavy wool yarn, highly detailed, heavy knit large wool fabric, sailor's wool","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
"Wool, Cable knit","{prompt} in chunky heavy cable knit wool yarn, highly detailed, cable knit large wool fabric","anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted",
1 name positive negative note
2 Cotton, Fine {prompt} in fine cotton fabric, highly detailed, gorgeous, matte fabric anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
3 Cotton, Regular {prompt} dress in heavy knit cotton fabric, matte fabric, gorgeous cloth, highly detailed, cinematic wrinkles, linen, seethrough, transparent, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
4 Denim {prompt} in heavy japanese (denim fabric), highly detailed, hard drape anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
5 Flannel, Brushed {prompt} in soft woven brushed flannel, highly detailed, fuzzy flannel cloth, cashmere flannel anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
6 Latex/Plastic {prompt} dress in shiny latex plastic material, expensive exquisite latex fabric, tight fitting metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
7 Latex/Plastic, Glossy {prompt} in shiny wet glossy latex material, hard lighting, expensive exquisite latex fabric, tight fitting metallic, nude, naked, fabric wrinkles, anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
8 Leather {prompt} in smooth thin leather, highly detailed, expensive exquisite leather anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
9 Linen {prompt} in linen fabric, loosely woven, gorgeous cloth, highly detailed anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
10 Silk {prompt} in silk cloth, highly detailed, gorgeous, sheen lustre anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
11 Velvet {prompt} in smooth velvet fabric, gorgeous exquisite cloth, highly detailed, fuzzy velvet cloth, expensive anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
12 Wool, Fine knit {prompt} in wool cloth, highly detailed, gorgeous, fine knit cashmere wool fabric anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
13 Wool, Heavy knit {prompt} in chunky heavy wool yarn, highly detailed, heavy knit large wool fabric, sailor's wool anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted
14 Wool, Cable knit {prompt} in chunky heavy cable knit wool yarn, highly detailed, cable knit large wool fabric anime, graphic, text, painting, crayon, graphite, glitch, cartoon, ugly, deformed, noisy, blurry, distorted