comfyui-toml-prompt

comfyui-toml-prompt
★ 1

提示词TOMLComfyUI自定义节点
将提示词编码为TOML格式以供ComfyUI使用,便于结构化管理和复用复杂提示参数。
💡 把复杂提示词以TOML编码后传入ComfyUI流程
🍴 2 Forks💻 Python🔄 2026-03-14
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/9d76119b2ef2
📄 README

comfyui-utils

ComfyUI custom nodes.

Install

cd ComfyUI/custom_nodes
git clone git@github.com:morino-kumasan/comfyui-utils.git
cd ../../
python_embeded/python -m pip install -r ComfyUI/custom_nodes/comfyui-utils/requirements.txt

How to use

See sample workflows.

PromptDecode

text

_t is prompt.

_k is available keys for random choice.

_w is weight for random choice with _k.

_e is chance(0.0~1.0) for all choice with _k.

_export is string to export to output.

_f is called by toml_key_name().

_post is post prompt key.

# key _t is prompt
[base]
_t="score_9, score_8_up, score_7_up, source_anime"

# direct string prompt
quality="best quality"

color=["dark", "light", "dark blue"]

[base.girl]
_t="""1girl, perfect anatomy, 
beautiful face, (detailed skin), (detailed face), (beautiful detailed eyes),  
shiny hair, $color hair"""
# $color is replaced with red, blue or blonde.

twintails = "twintails, <lora:twintails.safetensors:1>"
ponytails = "ponytails"
color=["red", "blue", "blonde"]

[base.boy]
_t = "1boy, muscular, $::color hair, formal suit"
# $color is replaced with dark, light or dark blue

# "base().test" equals "base._f.test"
[base._f]
_t = "base() is called"

test="test1"

# "random_weight.?" to select a or b or c
[random_weight]
_k = ["a", "b", "c"]
# random select weight
_w = [0.8, 0.1, 0.1]
a = "80%"
b = "10%"
c = "10%"

# "random_weight.*" to select a and b and c
[random_weight2]
_k = ["a", "b", "c"]
# each select ratio
_r = [0.8, 0.3, 0.3]
a = "80%"
b = "30%"
c = "30%"

# "post._post" equels "post._post.*.??"
[post]
_t = "main prompt"
_post = ["post_prompt.*", "::post_prompt2.?"]
[post.post_prompt]
_when = "base.boy"
_r = [0.1, 0.1, 1.0]
all1 = "10%"
all2 = "10%"
[post_prompt2]
_w = [0.5, 0.5]
one1 = "one1 or one2"
one2 = "one1 or one2"

[_exports]
key = "value"

lora_info

[““]

“lora.safetensors” = “lora prompt”


### key_name_list

// this is commont

this is comment

/* this is comment */

quality /* encode as “best quality” */

base, quality /* encode as “score_9, score_8_up, score_7_up, source_anime, best quality” */

{base | quality} /* encode as “score_9, score_8_up, score_7_up, source_anime” or “best quality” */

base.girl /* equals “base, base.girl”, but not duplicate prompt. */

base.girl+boy /* equals “base, base.girl, base.boy” */

base.? /* equals “{base.girl | base.boy}” */

base.?? /* equals “{base.girl.twintails | base.girl.ponytails | base.boy}” */

/* load LoRA and encode as “lora prompt” */

/* raw positive prompt */

this line is raw positive prompt.

/* raw negative prompt */

this line is raw negative prompt.

/* key_name1 if key name is already loaded else key_name2 */

key_name1

key_name2

/* 10%: key_a, 90%: key_b */

key_a

key_b

/* fix random choise, “base.??” is always “base.girl” */

/* fix random choise, “base.??” is always tag including girl */

/* fix random choise, “base.??” is always tag excluding girl */

/* export key=value */

/* _v.color = [“black”] */

/* base.girl._v.color = [“cyan blue”] */

/* _v.color = [“dark”, “dark blue”] */