- Python 100%
| images | ||
| .gitignore | ||
| __init__.py | ||
| db.json | ||
| lora.py | ||
| patterns.json | ||
| prompt_expander.py | ||
| README.md | ||
| utility.py | ||
comfyUI-viisUtilityNodes
What is this?
These ComfyUI Nodes were created by me based off of other Nodes to enhance some of my own workflows.
LoRA Nodes
Apply LoRA and extract path
Applies a LoRA to a Model and CLIP like a normal Node, but can also extract the path of the LoRA
Apply LoRA and extract name and trigger words
Applies a LoRA like you'd expect, but also extracts the name of the LoRA and it's triggerwords (if any).
Lora Info
If you can't be bothered with replacing all your LoRA Nodes with mine, this node will provide the extra information. Input needs to be the LoRA name or path.
Utility Nodes
Check List for null
This takes in a list and checks if it is null. Will return an empty List, if so or the full list, if it has items. This will prevent nodes further down to error if you encounter nullable lists in your workflow.
Check List for null and return first item
Sometimes you'd only want the first item of a list that is nullable. Will return an empty item or the first item in the list.
Prompt Expander
Now this node was made by me because I couldn't find any that fit my needs. What this Node does, it takes an input text with a script language that is similar to the wildcard one widely used in ComfyUI and uses functions (currently only var and exp) to expand a prompt into a full string. So you can easily program, say, a bunch of negative prompts to control your image generation.
Examples
$exp({red|green|blue}_shorts)
This will produce
red_shorts, green_shorts, blue_shorts
You can also use more than one bracket block
$exp({red|green|blue}_{shirt|trousers|hoodie})
This will result in
red_shirt, red_trousers, red_hoodie, green_shirt, green_trousers,
green_hoodie, blue_shirt, blue_trousers, blue_hoodie
And you can also define variables so you needn't write too many bracket blocks
$var(color={red|white|black|green|brown|orange|pink|blue|yellow})
$var(apparel={hoodie|pants})
$exp(${color}_${apparel}
This will produce
red_hoodie, red_pants, white_hoodie, white_pants, black_hoodie,
black_pants, green_hoodie, green_pants, brown_hoodie, brown_pants,
orange_hoodie, orange_pants, pink_hoodie, pink_pants, blue_hoodie,
blue_pants, yellow_hoodie, yellow_pants
And that's it so far. I also plan on adding more functions as I encounter new problems.
Prompt Cleaner
Now I'm pretty sure this Node has already been implemented somewhere, but since I was already on the go, this will clean up a List of Tags (String with ',' or a List of Strings). It will remove dupes, preferring higher weighted tags over lower weighted ones. It also prefers tags with '' in them over those without (can be toggled to invert). It can also sort the List alphabetically and can replace all ' ' with ''.
Tag Filter
This node will remove any tag from the source string that is present in the exclude String. It will recognize weighted tags as well.
Tag Extractor
This will extract Tags from a prompt that fulfill rules specified in "patterns.json"
{
"matches": [
{
"match": "face",
"patterns": ["*face*", "*mask*","*horns","freckles","*_on_face","*_on_lips","*_on_nose","nose*","*makeup","*expression"]
},
{
"match": "eyes",
"patterns": ["*_eyes", "eye_*","*_iris","*_pupils"]
},
{
"match": "hair",
"patterns": ["*_hair", "hair_*","*ponytail*","*horns"]
}
]
}
This will extract any tag that matches the pseudo-RegEx specified above (* will evaluate into .* when matching). This way, you can specify Lists of Tags that will also be used in other prompts further down a pipeline without either having to type them all by hand nor changing tags at several positions.








