- Python 92.3%
- JavaScript 7.7%
| fonts | ||
| lib | ||
| lora | ||
| nodes | ||
| web | ||
| .gitignore | ||
| __init__.py | ||
| config.py | ||
| LICENSE | ||
| patterns.json | ||
| presets.json | ||
| README.md | ||
| requirements.txt | ||
ComfyUI VII86 Utility Nodes
Custom nodes for ComfyUI covering LoRA tooling, prompt manipulation, inpaint presets, image switching, and text watermarks.
Installation
Clone into the ComfyUI custom_nodes directory:
git clone https://forgejo.krockauer-bonn.de/VII86/comfyui-viisutilitynodes.git
Install additional Python dependencies (see Requirements):
pip install -r requirements.txt
Place TrueType font files (.ttf) in the fonts/ directory for the watermark node.
After installation, reload the ComfyUI frontend so the web extensions under web/ are loaded.
Requirements
ComfyUI supplies torch, numpy, Pillow, and aiohttp. This package adds:
| Package | Purpose |
|---|---|
requests |
Civitai API lookups for LoRA info |
Project layout
comfyui-viisutilitynodes/
├── __init__.py # Node registration
├── config.py # Color definitions for watermarks
├── patterns.json # Tag Extractor pattern library
├── presets.json # Inpaint preset storage
├── db.json # LoRA metadata cache (created at runtime)
├── fonts/ # TrueType fonts for watermarks
├── lib/ # Shared helpers (tags, graphics, types)
├── lora/ # LoRA nodes and Civitai integration
├── nodes/ # Utility, preset, and watermark nodes
├── web/ # Frontend extensions (presets, patterns)
└── requirements.txt
LoRA nodes
Category: VII86/LoRA Tools
| Node | Description |
|---|---|
| Apply LoRA + Output Path | Applies a LoRA to model and CLIP; outputs the LoRA file path as a string. |
| Lora Info With Override | Resolves LoRA name or path and displays metadata (trigger words, Civitai link, examples). Accepts any existing LoRA loader output. |
| Load LoRA and get Name and Trigger words | Applies a LoRA and outputs the base name and trigger words. |
| Loads all Triggerwords from a LoRA Stack | Collects and deduplicates trigger words from a LORA_STACK input. |
LoRA metadata is cached locally in db.json. Missing entries are fetched from the Civitai API by file hash.
Utility nodes
Category: VII86/utility
Null checks
| Node | Description |
|---|---|
| Null Check (List) | Filters null and empty entries from a list; returns an empty list when the input is null or empty. |
| Null Check (List → First Item) | Returns the first non-null list item, or null when none exists. |
Prompt Expander
Expands a script-style prompt string using $var() definitions and $exp() expressions. Syntax resembles common ComfyUI wildcard notation.
Comments are delimited with # … # and are stripped before expansion.
$exp({red|green|blue}_shorts)
→ red_shorts, green_shorts, blue_shorts
$var(color={red|white|black})
$var(apparel={hoodie|pants})
$exp(${color}_${apparel})
→ red_hoodie, red_pants, white_hoodie, white_pants, black_hoodie, black_pants
Weighted expansion is supported: $exp(tag:1.2) wraps each result as (tag:1.2).
Tag Filter
Removes tags from a source prompt whose base names appear in an exclude list. Weighted tags (name:weight) are handled case-insensitively. Inputs accept either a comma-separated string or a list socket (mutually exclusive per input).
Prompt Cleaner
Deduplicates tags from a comma-separated string or list. When duplicates share a base name, weighted variants with the higher weight are kept. Underscore preference, alphabetical sorting, and space-to-underscore conversion are configurable.
Tag Extractor (JSON pattern library)
Extracts tags matching rules defined in patterns.json. Each match entry defines a name and a list of pseudo-regex patterns (* maps to .*). The pattern library is reloaded automatically when the file changes on disk; the match dropdown in the UI updates via the web extension.
Example patterns.json entry:
{
"matches": [
{
"match": "face",
"patterns": ["*face*", "*mask*", "freckles", "*_on_face"]
}
]
}
Image switch
| Node | Description |
|---|---|
| Select Image if present | Selects between two lazy image inputs. When both are connected, priority determines the output; when neither is connected, a 1×1 black placeholder is returned. |
Inpaint presets
Presets store inpainting-related parameters in presets.json.
| Node | Description |
|---|---|
| Preset Loader (view & edit) | Loads a named preset into editable widgets and outputs all values. A summary is shown after execution. |
| Preset Store (Save/Delete/New) | Saves, deletes, or inspects presets. The new_preset_name field creates a preset under a new name when set; otherwise the selected preset_name is used. |
Selecting a preset in either node loads its values into the widgets via the web extension. After a save or delete action, the preset dropdown is refreshed automatically.
Preset fields: Mask_Dilation, Feather, Noisemask_Feather, Refiner_Steps, BBOX_Crop_Factor, CFG, BBOX_Threshold, SAM_Mask, SAM_Dilation, NoiseMask, Inpaint.
Watermark node
Category: VII86/watermark
| Node | Description |
|---|---|
| Create a Watermark | Overlays text on an image with configurable alignment, opacity, font, color, margins, and optional handwriting-style character variations. |
Fonts are loaded from the fonts/ directory. The watermark implementation derives from ComfyUI Comfyroll Custom Nodes graphics utilities.
HTTP API
Routes registered on the ComfyUI prompt server:
| Method | Path | Description |
|---|---|---|
| POST | /vii86 |
LoRA metadata lookup by name |
| GET | /vii86/presets |
List of preset names |
| GET | /vii86/presets/{name} |
Preset values for a given name |
| GET | /vii86/patterns |
Tag Extractor match options and file modification time |
Web extensions
| File | Purpose |
|---|---|
web/viis_presets.js |
Syncs preset dropdowns with stored values; refreshes preset lists after save/delete |
web/viis_patterns.js |
Updates Tag Extractor match options when patterns.json changes |
License
This project is licensed under the GNU General Public License v3.0. See LICENSE for the full text.