simple wildcard for ComfyUI
详情
下载文件
关于此版本
模型描述
ComfyUI-node-Lilly
安装
进入 ./custom_nodes 目录并克隆 git 仓库:
cd ./custom_nodes
git clone https://github.com/kuriot/ComfyUI_node_Lilly.git
或者 https://github.com/lilly1987/ComfyUI_node_Lilly/archive/refs/heads/main.zip 下载并安装,方式如下:
通配符
通配符 示例
格式:
a{b|{c|}|{d|e|}|f|}g____ my结果:
aeg quality_my, breasts, { |character_dress|dress_my}, shoulder, {high heels,| } {choker,| } {lora:__lora_lst__:__rora_num__,| } NSFW, NSFW_my, { |style_my,}
ex : {3$$a1|{b2|c3|}|d4|{-$$|f|g}|{-2$$h||i}|{1-$$j|k|}}/{$$l|m|}/{0$$n|}
{1|2|3} -> 1 或 2 或 3
{2$$a|b|c} -> a,b 或 b,c 或 c,a 或 bb 等等
{9$$a|b|c} -> {3$$a|b|c} 自动修复最大数量
{1-2$$a|b|c} -> 1~2 随机选择
{-2$$a|b|c} -> {0-2$$a|b|c} 0-2
{1-$$a|b|c} -> {0-3$$a|b|c} 1-max
{-$$a|b|c} -> {0-3$$a|b|c} 0-max
通配符文本文件使用示例
- ~/a/b.txt
1
- ~/b.txt
2
b 代表 1 或 2
/b 代表 2
/a/b 代表 1
?b 代表 2
* 代表 1 或 2
文件名模式匹配
* 匹配所有内容
? 匹配任意单个字符
[seq] 匹配 seq 中任意字符
[!seq] 匹配不在 seq 中的任意字符
运行示例
python wildcards.py
Python 示例
import wildcards as w
# 获取的文件列表。获取通配符文件
w.card_path = os.path.dirname(__file__) + "\\wildcards\\**\\*.txt"
# 执行
print(w.run("a{__b__|{c|}|{__d__|e|}|f|}g____ __my__"))
文本文件(支持不同编码格式的 .txt 文件)
输入:
# 注释 comment
a,b
{b|c|__anotherfile__}
__anotherfile__
输出结果:
a,b
b
c
__anotherfile__
重新加载通配符卡片
调用 wildcards.card_load() 或 wildcards.run("{9$$-$$a|b|c}", True)
与 ComfyUI 集成
CLIPTextEncodeWildcards
- CLIPTextEncodeWildcards:不带种子
- CLIPTextEncodeWildcards:带种子
SimpleSampler+modelVAE
- 支持通配符
SimpleSampler
- 支持通配符
SimpleSamplerVAE
- 支持通配符
VAELoaderText,LoraLoaderText,CheckpointLoaderSimpleText
- 支持文件名通配符(?*)









