Nodes/comfyui_nai_api/NovelAI Prompt Convert Tool
ComfyUI Node

NovelAI Prompt Convert Tool

Translating {curly braces} into (weighted:1.2) syntax

By Creeper-MZ·Created 2 years ago·Updated 2 years ago· 0
NovelAI Prompt Convert Tool
    • STRING
    promptprompt
    To

    A small, boring, genuinely useful node: it converts prompt emphasis syntax between NovelAI's format and ComfyUI's format. If you've ever copied a prompt off a NovelAI generation into a ComfyUI workflow (or the other way around) and had the emphasis come out wrong, this is the node that fixes it instead of you hand-editing brackets.

    NovelAI and ComfyUI/A1111 disagree on how you tell the model to weight a word more or less heavily. NovelAI uses nested {curly braces} to increase weight and [square brackets] to decrease it - each pair of braces bumps the weight by a fixed multiplier, and you stack them for more emphasis. ComfyUI and A1111 use the (word:1.2) explicit-number syntax instead. They're not interchangeable - paste a {{tag}}-heavy NovelAI prompt straight into a ComfyUI CLIP Text Encode and it'll either error or get read literally as text, not as emphasis. This node does the translation so you don't have to do it by hand every time you move a prompt between the two.

    How it works

    It's a straightforward text-in, text-out converter - no model call, no API key needed, nothing generative about it at all. It parses your prompt string, recognizes whichever bracket convention you're converting from, and rewrites it into the other convention.

    The inputs and outputs that matter

    Just two fields, and they're both self-explanatory:

    • prompt - your prompt text, in whichever format you're converting from.
    • To - an enum: NovelAI or Comfyui. This sets the target format - pick Comfyui to convert a NovelAI-style prompt into ComfyUI's (word:weight) syntax, or NovelAI to go the other way.

    The output is a single STRING - your converted prompt, ready to feed into whatever expects that format next: NovelAI's own prompt_positive/prompt_negative fields if you're heading that direction, or a standard CLIP Text Encode if you're heading toward a local checkpoint.

    Installing it

    Part of the same pack as the rest of the NovelAI nodes. ComfyUI Manager: search comfyui_nai_api, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Creeper-MZ/comfyui_nai_api
    

    Restart ComfyUI. No API key is required for this specific node - unlike the generation and Vibe Transfer nodes in this pack, it doesn't call NovelAI's servers at all, so it'll work even before you've set up config.py. You only need the key configured if you're also using the other nodes in the same graph.

    Common issues & troubleshooting

    Wrong direction, garbled output - the most common mistake is picking the wrong To value: converting a prompt that's already in ComfyUI format to ComfyUI does nothing useful, and converting NovelAI syntax to NovelAI mangles it. Double-check which format your source prompt is actually in before you set the target.

    Mixed syntax in one prompt - if you've hand-edited a prompt and it now has both {braces} and (word:1.2) weights mixed together, don't expect a clean conversion. Simple converters like this generally assume one convention at a time; sort out the mixing first if the output looks off.

    This isn't a prompt improver - it changes syntax, not content. If your prompt reads badly in the target ecosystem (wrong tag vocabulary, wrong style of phrasing for that model), that's a separate problem this node was never meant to solve - it only handles the emphasis-weighting punctuation.

    CategoryNovelAI

    Inputs (2)

    NameTypeDefaultDescription
    promptSTRINGprompt
    ToCOMBO2 options: NovelAI, Comfyui

    Outputs (1)

    NameTypeDescription
    STRINGSTRING