Nodes/babydjac Nodes/Safe Tag List Prompt
ComfyUI Node

Safe Tag List Prompt

Template-Matching Taglists, With a Safety Net

By babydjac·Created 7 months ago·Updated 5 months ago· 12
Safe Tag List Prompt
    • taglist_prompt
    template_text
    custom_idea
    api_key
    model_namegrok-3-latest
    temperature0.20
    safe_modetrue
    blocklistnsfw, porn, sexual, sex, nude, naked, topless, boobs, breast, areola, pussy, ass, butt, buttocks, erotic, explicit, horny, aroused, arousing, cum, ejaculate, semen, oral, anal, penetration, blowjob, handjob, vagina, penis, cock, dick, fetish, bdsm

    The Safe Tag List Prompt solves a weirdly specific problem: you have a template taglist that you know works - the right density, the right tag style - and you want new taglists that mirror it, but for different ideas. Type an idea, paste a template, and Grok rewrites your idea as a taglist that matches the template's structure and style. The "Safe" part is the safety net: a blocklist that rejects explicit content before the call, and a post-check that blocks it again if it sneaks into the output.

    It's from the babydjacNODES pack, and it's the "SFW" side of an otherwise NSFW-oriented pack - the author's own tool for keeping prompt generation clean where it needs to be.

    How it works

    You provide template_text (the working taglist) and custom_idea (the new concept). If safe_mode is on, the node first checks both against the blocklist - a long comma-separated list of explicit terms that defaults to essentially the entire NSFW vocabulary (nsfw, porn, sexual, sex, nude, ... bdsm). If either input trips it, you get Input rejected by safe_mode blocklist and the call never happens.

    If it passes, the node sends a system prompt to the API (default grok-3-latest, temperature 0.2) that says: rewrite the idea as a taglist mirroring the template's structure, density and style; keep it SFW; output only the taglist. After the response comes back, safe_mode does a second check on the model's output and blocks it too if the model drifted explicit. So the blocklist guards both sides of the call - that's the "safe" made real.

    The inputs that matter

    • template_text - required. The working taglist whose shape you want copied. If it's empty, you get "Please provide a template taglist."
    • custom_idea - required. What the new taglist should be about.
    • api_key - required (no env-var fallback in this one).
    • safe_mode - on by default; the whole point of the node.
    • blocklist - editable, so you can extend (or relax) the vocabulary. This is where you customize what counts as "unsafe."

    Output: a single STRING, taglist_prompt.

    Install

    ComfyUI Manager → babydjacNODES, or git clone https://github.com/babydjac/babydjacNODES into ComfyUI/custom_nodes, restart, hard-refresh. No extra pip deps.

    Gotchas

    • The blocklist is a blunt instrument. Whole-word matching means cockpit is safe but anything literally containing sex, anal, or penis is rejected. If your template uses a term that trips the filter, edit the blocklist - that's what the editable field is for.
    • "Template" means density, not content. The node mirrors structure and tag style, not your exact tags. A sparse template gives a sparse output; a dense one gives dense output. Garbage in, shaped garbage out.
    • It's a paid API call per run. The dual safety checks happen around one Grok call, and you pay for it every queue. If you're batch-generating taglists, count the cost.

    For anyone who's found a taglist format that works and wants variations on it without reinventing the format - and needs the content to stay clean - this node is the pack's most purposeful SFW tool.

    CategorybabydjacNODES/Taglists

    Inputs (7)

    NameTypeDefaultDescription
    template_textSTRING
    custom_ideaSTRING
    api_keySTRING
    model_nameoptSTRINGgrok-3-latest
    temperatureoptFLOAT0.200–1
    safe_modeoptBOOLEANtrue
    blocklistoptSTRINGnsfw, porn, sexual, sex, nude, naked, topless, boobs, breast, areola, pussy, ass, butt, buttocks, erotic, explicit, horny, aroused, arousing, cum, ejaculate, semen, oral, anal, penetration, blowjob, handjob, vagina, penis, cock, dick, fetish, bdsm

    Outputs (1)

    NameTypeDescription
    taglist_promptSTRING