Nodes/ComfyUI-Prompt-Format-Converter/Prompt Format Converter (SD/NAI/NewBie)
ComfyUI Node

Prompt Format Converter (SD/NAI/NewBie)

Moving prompts between SD, NovelAI, and NewBie without losing your mind

By zisonMyu·Created 4 months ago·Updated 3 months ago· 2
Prompt Format Converter (SD/NAI/NewBie)
    • converted_prompt
    • detected_source_format
    • warnings
    prompt
    source_format
    target_format
    escape_parenthesestrue
    include_commentsfalse
    use_exact_artist_detectionfalse
    artist_csv_path/tmp/ComfyUI/custom_nodes/ComfyUI-Prompt-Format-Converter/data/danbooru_artist.csv

    The anime ecosystem is a tower of prompt dialects, and this node is the translation layer between them. Illustrious and NoobAI speak plain Danbooru tags with (tag:1.2) weights. NovelAI wants either nested braces ({{tag}}) or numeric 1.2::tag:: prefixes. NewBie wants XML. And the Anima crowd reaches for @artist prefixes. If you've ever grabbed a prompt from a NovelAI workflow, run it on an Illustrious model, and watched it come out wrong, this is the node you were missing.

    PromptFormatConverter is the flagship of the zisonMyu pack and the one that does the heavy lifting. Feed it any prompt and a target format, and it rewrites both the weight syntax and the artist prefix convention. The README's example says it all: artist:wlop, 1.2::blue hair::, 1girl becomes @wlop, (blue hair:1.2), 1girl when you target SD(anima) - weight dialect and artist prefix handled in one pass.

    How it works

    The node auto-detects the source format by scanning for its signature. It checks for NewBie XML tags first, then weight::tag:: (NAI4), then braces and brackets (NAI3), then @ artist prefixes (SD(anima)), and defaults to plain SD. Once detected, conversion is mostly regex work with real math underneath: a NAI3 brace is 1.05^level, so {tag} becomes (tag:1.05) and [[tag]] becomes (tag:0.9025). Going the other way, (tag:0.95) collapses to [tag].

    Two details are worth knowing because they're why this works in practice rather than in theory. First, artist prefixes are treated as a separate axis from weights - @wlop, artist:wlop, and plain wlop all convert independently, so (artist:wlop:1.2) survives with its weight intact. Second, there's a fast path: if your input already looks like the target format, the node returns it unchanged instead of churning through regexes.

    The inputs that matter

    • source_format - leave it on Auto-detect and let the node figure it out; override only when detection gets confused.
    • target_format - the five dialects: SD, SD(anima), NAI3, NAI4, NewBie.
    • escape_parentheses - leave this on. It turns literal parens like ask(askzy) into ask\(askzy\), so SDXL's CLIP doesn't read a username as emphasis.
    • use_exact_artist_detection + artist_csv_path - the one pair that needs setup. Plain artist tags are indistinguishable from ordinary tags without a lookup table; flip this on only after you've downloaded the Danbooru artist CSV (the DanbooruArtistCSVManager node in the same pack does that).

    It returns converted_prompt plus two useful extras: detected_source_format (great for debugging why a conversion surprised you) and warnings. The warnings output is where the pack's one genuine opinion lives: if you're converting to NAI3 and a tag carries a weight over 1.5, it tells you that NAI4 is the better target, because heavy weights need deep brace nesting that gets unreadable fast.

    Install

    It's dependency-free - a single nodes.py, standard library only, no requirements.txt, nothing to download at install time. Either search "ComfyUI-Prompt-Format-Converter" in ComfyUI Manager or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/zisonMyu/ComfyUI-Prompt-Format-Converter
    

    Then restart ComfyUI. That's it.

    Common gotchas

    The big one is the plain-artist problem: without the artist CSV, wlop and 1girl look identical to the converter, so a plain SD prompt converted to NAI3 won't get its artist rebadged as artist:wlop. That's not a bug, it's the ambiguity of the format - grab the CSV first if artist prefixes matter. Second, NewBie conversion is heuristic tag-classification, not semantic parsing; the README says so outright, so expect it to be "practical" rather than perfect. And if your output has a stray # converted from ... header, you left include_comments on - that flag emits commented, sectioned prompts for models that like them, and it's off by default for a reason.

    CategoryPrompt Tools

    Inputs (7)

    NameTypeDefaultDescription
    promptSTRING
    source_formatCOMBO5 options: Auto-detect, SD, SD(anima), NAI3, NAI4
    target_formatCOMBO5 options: SD, SD(anima), NAI3, NAI4, NewBie
    escape_parenthesesBOOLEANtrue
    include_commentsBOOLEANfalse
    use_exact_artist_detectionBOOLEANfalse
    artist_csv_pathSTRING/tmp/ComfyUI/custom_nodes/ComfyUI-Prompt-Format-Converter/data/danbooru_artist.csv

    Outputs (3)

    NameTypeDescription
    converted_promptSTRING
    detected_source_formatSTRING
    warningsSTRING