Nodes/ComfyUI-ZML-Image/ZML_筛选提示词V2
ComfyUI Node

ZML_筛选提示词V2

Strip tags you don't want, by category, with translations — ZML_筛选提示词V2

By zml-w·Created about a year ago·Updated 2 months ago· 218
ZML_筛选提示词V2
    • 筛选后文本
    • 过滤提示词
    • 过滤翻译
    输入文本
    自定义过滤词
    二次元角色false
    人物false
    场景false
    服饰false
    物品false
    环境false
    画面false
    艺术家false
    表情动作false
    镜头false

    ZML_筛选提示词V2 filters a prompt by category - not by typing a list of banned words, but by flipping switches named 艺术家 (artist), 场景 (scene), 服饰 (clothing), 物品 (object), and so on. Flip "artist" on, and every artist tag in your prompt gets stripped out. That's a surprisingly useful superpower when you inherit a workflow with someone else's artist pile and want it gone.

    The mechanism is grounded in data the author actually sourced: the keyword lists come from a hand-curated tag library by the Civitai user Miaoka (the README credits 《喵咔》's 妙妙小工具 as the inspiration). The pack ships ten category files in zml_w/txt/miaoka/ - 二次元角色, 人物, 场景, 服饰, 物品, 环境, 画面, 艺术家, 表情动作, 镜头 - each a list of tags, plus an English-to-Chinese translation map per category. At run time the node loads the sets for whatever switches you've enabled, merges in any 自定义过滤词 you typed (comma-separated), then walks your input line by line and drops every tag whose core name matches.

    Three outputs, and they're the reason this is more than a filter:

    • 筛选后文本 - your prompt with the matched tags removed, punctuation-formatting applied on top
    • 过滤提示词 - a flat comma-separated list of everything it removed
    • 过滤翻译 - one per removed tag, as english/中文/分类, e.g. artist//艺术家

    That last output is the fun part: it tells you what it took out and why, in both languages. Beginners learn their tag vocabulary by watching the filter explain itself. You can also chain it: feed 过滤提示词 elsewhere, or use it as a whitelist elsewhere in the graph.

    Installing it

    Ships in ComfyUI-ZML-Image. Manager → install ComfyUI-ZML-Image, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zml-w/ComfyUI-ZML-Image
    

    Restart. No downloads - the Miaoka keyword files are bundled. UI is Chinese by default; the English patch is at https://github.com/zml-w/ZZZ_ZML_English_Patch. Note the node's 输入文本 requires a wire (forceInput), so you can't just type into it - connect a text node or your prompt encoder's output first.

    Common issues

    The biggest gotcha is expectations. This is a drop matching tags filter, not a "keep only these categories" sorter - tags not in any enabled category pass through untouched. If you expect a 场景-switch to wipe everything non-scene, you'll be confused. It also filters against the core tag: (tag:1.2) and {{tag}} are matched on tag after stripping weight syntax, which is the right behavior.

    The Miaoka word lists are anime-tag-centric. If you're on a photorealistic SDXL workflow the categories will under-match and the filters will feel weak - that's the data, not a bug. And remember the filter operates per-line, preserving your original line breaks, so a one-line mega-prompt and a block-structured prompt behave the same.

    Author's own caveat applies here too: the pack is a solo dev's personal toolkit, updated weekly, and while this node was rebuilt from the Miaoka tool it's still Chinese-first. If a switch doesn't seem to bite, check whether the tag you're testing is actually in the shipped lists before assuming it's broken.

    Categoryimage/ZML_图像/文本

    Inputs (12)

    NameTypeDefaultDescription
    输入文本STRING
    自定义过滤词STRING
    二次元角色BOOLEANfalse
    人物BOOLEANfalse
    场景BOOLEANfalse
    服饰BOOLEANfalse
    物品BOOLEANfalse
    环境BOOLEANfalse
    画面BOOLEANfalse
    艺术家BOOLEANfalse
    表情动作BOOLEANfalse
    镜头BOOLEANfalse

    Outputs (3)

    NameTypeDescription
    筛选后文本STRING
    过滤提示词STRING
    过滤翻译STRING