Nodes/Prompt Builder/中文提示词构建器
ComfyUI Node

中文提示词构建器

A Chinese prompt builder for Qwen-Image and Z-Image that matches how those models actually think

By tudoupaigu946·Created 5 months ago·Updated 5 months ago· 13
中文提示词构建器
    • 最终提示词
    前置提示词
    后置提示词
    主体 (Subject)/人物 (People)
    主体 (Subject)/动物 (Animals)
    主体 (Subject)/物品 (Objects)
    场景 (Scene)/室内 (Indoor)
    场景 (Scene)/室外 (Outdoor)
    时间与天气 (Time & Weather)/时段 (Time of Day)
    时间与天气 (Time & Weather)/天气 (Weather)
    动作与姿态 (Action & Pose)/人物动作 (Human Action)
    动作与姿态 (Action & Pose)/姿态 (Pose)
    服装与配饰 (Clothing & Accessories)/服装 (Clothing)
    服装与配饰 (Clothing & Accessories)/配饰 (Accessories)
    风格 (Style)/绘画风格 (Art Style)
    风格 (Style)/艺术家 (Artists)
    风格 (Style)/渲染引擎 (Render Engine)
    材质 (Material)/自然材质
    光照 (Lighting)/自然光
    光照 (Lighting)/人造光
    氛围 (Atmosphere)/情绪与氛围
    构图 (Composition)/镜头与视角
    参数 (Parameters)/画质与设置
    NSFW/敏感类型

    If you prompt Qwen-Image or Z-Image in Chinese - and honestly, if you're running those models you probably should be - ChinesePromptBuilder (中文提示词构建器) turns a giant wall of dropdowns into your final prompt. It's one node in the tiny prompt_builder pack, it needs no API key, downloads nothing, and takes up no VRAM. It's just JSON and Python glue, and that's kind of the point.

    What it is

    Open the node and you're greeted by roughly twenty dropdowns, grouped the way an art director would organize a brief: 主体/Subject (people, animals, objects), 场景/Scene (indoor and outdoor), 时间与天气/Time & Weather, 动作与姿态/Action & Pose, 服装与配饰/Clothing & Accessories, 风格/Style (art styles, named artists, render engines), 材质, 光照, 氛围, 构图, 参数, and an NSFW group that defaults to 无 (none). Every choice shows both Chinese and an English gloss - "单人 (Single Person)", "Van Gogh 梵高" - so you don't need to read Chinese to use it, even though the whole thing is clearly built for a Chinese-speaking audience.

    Every dropdown has two special options beyond the real values: 无 (none, the default) and 随机 (random). Pick 无 and that category contributes nothing. Pick 随机 and the node rolls one value from that category's library each time the graph runs. Nothing forces you to fill all twenty; the default is deliberately empty.

    How it works

    The mechanism is refreshingly simple, and I checked the source so this isn't README hearsay. The pack ships prompt_categories.json, a nested dict of category → values. At import time INPUT_TYPES walks it recursively and turns every leaf into a combo widget. On execution, build_prompt walks your selections, swaps any 随机 for a random.choice out of that category's list, joins whatever survived the 无 filter with commas, then wraps the whole thing with your 前置提示词 (prefix) and 后置提示词 (suffix) and cleans up stray double commas.

    The sneaky part is IS_CHANGED. ComfyUI caches node outputs, so a plain combo node would only re-roll your randoms once. This node detects that any category is set to 随机 and returns the current timestamp, forcing a fresh execution every run. That's what "每次执行自动刷新" in the description means - set two categories to 随机 and you get a new composition on every Queue, not a stuck one.

    The single output is 最终提示词 (STRING). Wire it straight into your Qwen-Image or Z-Image text encoder - or a Save Text node if you just want to batch-generate prompt lists.

    Why this shape works for Qwen and Z-Image

    Here's the thing that makes this node smarter than it looks. Qwen-Image and Z-Image don't use CLIP; they encode prompts with a general-purpose LLM, so your prompt is an instruction, not a bag of tags. Attention weights like (word:1.3) get silently discarded, and the negative prompt box does nothing at all. What those models want is structured, comma-separated blocks - which is exactly what this node outputs. The named-artist and camera-angle dropdowns are especially worth reaching for, since naming real cameras and painters is the highest-leverage phrasing on LLM-encoded models.

    One caveat from the community: Z-Image prompt testing shows shorter prompts often beat longer ones - the top reply to a popular enhancer comparison was "this just adds unprompted stuff." So treat the 20 dropdowns as a buffet, not a checklist. Fill the categories you care about, leave the rest on 无, and don't auto-random everything just because you can.

    Installing it

    Easiest path is ComfyUI Manager: search "prompt_builder" and install. Otherwise:

    cd ComfyUI/custom_nodes
    git clone https://github.com/tudoupaigu946/prompt_builder
    

    then restart ComfyUI. No model files, no weights, no GPU setup.

    The gotcha: PySide6

    The pack's requirements.txt pins PySide6==6.7.2, and the README makes a fuss about it. Ignore it. The actual ComfyUI node imports only json, random, os, time, and typing - PySide6 belongs to the standalone GUI the author also describes, not to this node. If Manager chokes installing it (on Linux it often needs system Qt libraries like libxcb-cursor0), that's fine: the node will still load and run. It's one of those rare cases where a broken dependency in the install log is a non-issue.

    If you edit prompt_categories.json to add your own categories or values - the format is just nested arrays - restart ComfyUI to pick it up, since it's loaded once at import. And if you somehow break the JSON, the node won't register, so keep a backup before you hand-edit.

    Category提示词工具/中文提示词构建器

    Inputs (23)

    NameTypeDefaultDescription
    前置提示词STRING
    后置提示词STRING
    主体 (Subject)/人物 (People)COMBO19 options: 无, 随机, 单人 (Single Person), 双人 (Couple), 多人 (Group), 儿童 (Child), +13
    主体 (Subject)/动物 (Animals)COMBO22 options: 无, 随机, 猫 (Cat), 狗 (Dog), 鸟 (Bird), 马 (Horse), +16
    主体 (Subject)/物品 (Objects)COMBO27 options: 无, 随机, 汽车 (Car), 摩托车 (Motorbike), 飞机 (Airplane), 船 (Boat), +21
    场景 (Scene)/室内 (Indoor)COMBO28 options: 无, 随机, 客厅 (Living Room), 卧室 (Bedroom), 厨房 (Kitchen), 书房 (Study), +22
    场景 (Scene)/室外 (Outdoor)COMBO76 options: 无, 随机, 街道 (Street), 公园 (Park), 森林 (Forest), 山脉 (Mountain), +70
    时间与天气 (Time & Weather)/时段 (Time of Day)COMBO12 options: 无, 随机, 黎明 (Dawn), 清晨 (Early Morning), 上午 (Morning), 正午 (Noon), +6
    时间与天气 (Time & Weather)/天气 (Weather)COMBO19 options: 无, 随机, 晴天 (Sunny), 多云 (Cloudy), 阴天 (Overcast), 雨天 (Rainy), +13
    动作与姿态 (Action & Pose)/人物动作 (Human Action)COMBO32 options: 无, 随机, 站立 (Standing), 坐 (Sitting), 躺 (Lying Down), 行走 (Walking), +26
    动作与姿态 (Action & Pose)/姿态 (Pose)COMBO18 options: 无, 随机, 正面 (Front Pose), 侧面 (Side Pose), 背面 (Back Pose), 坐姿 (Seated Pose), +12
    服装与配饰 (Clothing & Accessories)/服装 (Clothing)COMBO30 options: 无, 随机, 便装 (Casual Wear), 正装 (Formal Wear), 礼服 (Gown), 西装 (Suit), +24
    服装与配饰 (Clothing & Accessories)/配饰 (Accessories)COMBO24 options: 无, 随机, 眼镜 (Glasses), 墨镜 (Sunglasses), 帽子 (Hat), 头盔 (Helmet), +18
    风格 (Style)/绘画风格 (Art Style)COMBO50 options: 无, 随机, 写实主义 (Realism), 印象派 (Impressionism), 抽象派 (Abstract), 超现实主义 (Surrealism), +44
    风格 (Style)/艺术家 (Artists)COMBO23 options: 无, 随机, 毕加索 (Picasso), 梵高 (Van Gogh), 达利 (Dali), 莫奈 (Monet), +17
    风格 (Style)/渲染引擎 (Render Engine)COMBO19 options: 无, 随机, Octane Render, V-Ray, Unreal Engine, Unity, +13
    材质 (Material)/自然材质COMBO28 options: 无, 随机, 木质 (Wood), 石材 (Stone), 金属 (Metal), 玻璃 (Glass), +22
    光照 (Lighting)/自然光COMBO12 options: 无, 随机, 阳光 (Sunlight), 月光 (Moonlight), 星光 (Starlight), 丁达尔效应 (God Rays), +6
    光照 (Lighting)/人造光COMBO18 options: 无, 随机, 霓虹灯 (Neon), LED灯 (LED), 烛光 (Candlelight), 聚光灯 (Spotlight), +12
    氛围 (Atmosphere)/情绪与氛围COMBO35 options: 无, 随机, 梦幻 (Dreamy), 神秘 (Mysterious), 孤独 (Lonely), 压抑 (Depressing), +29
    构图 (Composition)/镜头与视角COMBO29 options: 无, 随机, 广角镜头 (Wide Angle), 长焦镜头 (Telephoto), 鱼眼镜头 (Fisheye), 微距摄影 (Macro), +23
    参数 (Parameters)/画质与设置COMBO165 options: 无, 随机, 8k分辨率 (8k Resolution), 4k分辨率 (4k Resolution), 超高清 (Ultra HD), 高细节 (High Detail), +159
    NSFW/敏感类型COMBO21 options: 无, 随机, 无, 性感, 暴露, 泳装, +15

    Outputs (1)

    NameTypeDescription
    最终提示词STRING