Nodes/ComfyUI-ZhiHui/🎨 智绘_预设文本管理
ComfyUI Node

🎨 智绘_预设文本管理

Your favorite prompts, saved to a JSON file you can edit by hand

By zhuyungen·Created 8 months ago·Updated 4 months ago· 0
🎨 智绘_预设文本管理
    • 📄文本
    • 📋状态
    • 👁️预设预览
    ◄预设选择(不使用预设)►
    ◄组合模式仅使用预设►
    ◄分隔符 ►
    ◄文本内容►
    ◄保存为新预设false►
    ◄新预设名称►
    ◄删除选中预设false►

    Every prompt-heavy workflow has the same trio of "I always type this" strings: a quality opener, a style boilerplate, a negative block. ZH_PresetLoader ("🎨 智绘_预设文本管理") turns those into a dropdown. Pick a saved preset, optionally glue your own text to it, and the result flows out as a string - and because presets live in a plain JSON file, you can add and edit them without touching the node at all.

    It's part of ComfyUI-ZhiHui, a Chinese-language utility pack with basically no footprint in the English community. The node ships with two presets that tell you exactly what it's for: "通用起手式" (a universal quality opener - masterpiece, best quality, 8k resolution, highly detailed) and "九宫格换装" (a long product-photography prompt for grid outfit shots). You'll probably delete both and add your own.

    How it works

    Presets are stored in nodes/text/presets.json inside the pack. On every page load the node reads that file and builds the dropdown from its keys, so you can edit the JSON directly (or add presets via the node) and they show up on refresh. Internally it then combines the selected preset with the optional 文本内容 input according to 组合模式:

    • 仅使用预设 - just the preset (default).
    • 仅使用输入文本 - ignore the preset entirely.
    • 预设+输入文本 / 输入文本+预设 - concatenate both, joined by 分隔符 (default newline).

    Saving and deleting are driven by two toggles: 保存为新预设 + 新预设名称 writes the current text under a new key, and 删除选中预设 (the author labels it "危险操作") removes one. Neither needs a special button - the toggle being true is the action.

    The inputs and outputs that matter

    • 预设选择 - the dropdown, populated from presets.json.
    • 组合模式, 分隔符 - how the preset and your text are joined.
    • 文本内容 - your free-text input; also the thing that gets saved when the save toggle is on.
    • 保存为新预设 / 新预设名称 / 删除选中预设 - the management trio.

    Outputs: 📄文本 (the combined string - wire this into a CLIP Text Encode or prompt node), 📋状态 (what the last operation did), and 👁️预设预览 (the raw preset contents, for checking what you're about to load).

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/zhuyungen/ComfyUI-ZhiHui.git
    

    Restart ComfyUI. Base deps only, no models. ComfyUI Manager search "ComfyUI-ZhiHui" also works.

    Where people get burned

    The refresh thing is the big one: after you save or delete a preset, the dropdown won't show the change until you refresh the browser (F5). That's not a bug - ComfyUI builds dropdown widgets when the page loads, so the JSON edit only registers on reload. The author's own guide calls this out. Second, don't name a preset (不使用预设) - that string is the reserved "no preset" sentinel. And if you hand-edit presets.json, back it up first and keep the JSON valid, because a corrupt file makes the dropdown read "读取失败_请检查JSON格式". One more, from the prompt-engineering side: these presets are just strings - whether masterpiece, best quality actually does anything depends entirely on which encoder/checkpoint you're feeding; on LLM-encoded 2026 models it's inert, on anime SDXL it isn't.

    Category智绘灵箱/文本

    Inputs (7)

    NameTypeDefaultDescription
    预设选择COMBO(不使用预设)选择要加载的预设(选中后会显示在预设预览中)
    组合模式COMBO仅使用预设如何组合预设和输入文本
    分隔符STRING 组合预设和文本时使用的分隔符
    文本内容optSTRING可选输入,用于与预设组合或单独使用
    保存为新预设optBOOLEANfalse💾 打开此开关可将当前文本保存为预设
    新预设名称optSTRING保存时的预设名称(需要先打开保存开关)
    删除选中预设optBOOLEANfalse🗑️ 打开此开关将删除上方选中的预设(危险操作)

    Outputs (3)

    NameTypeDescription
    📄文本STRING—
    📋状态STRING—
    👁️预设预览STRING—