ComfyUI Node

D&D5E NPC STAT BLOCK

Fill in a D&D stat block without breaking your workflow

By OrsoEric·Created 5 months ago·Updated 5 months ago· 1
D&D5E NPC STAT BLOCK
    • STRING
    nameOlivia Prezzo
    raceHalfling - Lightfoot
    cr5
    hp50
    ac16
    speedWalk: 6sq
    image_promptPortrait AR1:1.5. Digital, semi-realistic painterly style that blends heroic fantasy with vibrant color palettes and detailed, textured, and shadowed rendering. Full body from head to toe. Chubby Halfling. Visible eye bags. Neutral expression. She's wearing a pointed hat and a rugged, earth‑toned robe cinched with a belt. In each hand, she holds a large glass flask—one filled with a vivid red liquid and the other with a bright green one. On her back, a alchemical refining alambic backpack with glass tubes and condensation loops with colorful liquids gurgling trough. Background is her workshop with wooden walls.
    descriptionOlivia Prezzo, a halfling woman in her forties, has become Campocestro's clandestine alchemist. Her laboratory is lined with dusty vials and ancient apparatus that glimmer with a faint blue glow despite their age. Chubby and a leg tall, her eyes perpetually rimmed with dark circles from endless nights of experimentation. She does lots of field work, and possesses an alchemical backpack to brew perishible ingredients on her gathering expeditions. The villagers hold her in high regard for her botanical expertise that saved countless crops from drought. Nobody knows why she left her prestigious job in Ironspur to come to the Ao forsaken frontier village of Campocestro
    resourcesActions: 1 Bonus Actions: 1 Reactions: 1 Legendary Actions: 1
    spellcastingSpell ability: INT Spell List: Wizard (Alchemist) Spell Bonus: +5 Spell Save DC: 16 Spell Slots: 5, 3, 1
    immunityPoison
    resistanceAcid
    weaknessHoly, Blunt, Fire
    proficiency3
    initiative3
    str_sep====== STRENGTH ======
    STRENGTH-2
    STR SAVE-2
    ATHLETICS-1
    dex_sep====== DEXTERITY ======
    DEXTERITY3
    DEX SAVE3
    ACROBATICS3
    SLEIGHT OF HAND1
    STEALTH2
    con_sep====== CONSTITUTION ======
    CONSTITUTION1
    CON SAVE1
    int_sep====== INTELLIGENCE ======
    INTELLIGENCE5
    INT SAVE8
    ARCANA4
    INVESTIGATION3
    HISTORY2
    NATURE1
    RELIGION0
    wis_sep====== WISDOM ======
    WISDOM1
    WIS SAVE2
    ANIMAL HANDLING-1
    INSIGHT2
    PERCEPTION3
    MEDICINE5
    SURVIVAL0
    cha_sep====== CHARISMA ======
    CHARISMA0
    CHA SAVE0
    DECEPTION1
    INTIMIDATION-1
    PERFORMANCE-1
    PERSUASION-1
    ability

    The D&D5E NPC STAT BLOCK node is where you actually write your NPC. The other two nodes in this pack render the card and build the action list, but this one is the data-entry form: ~45 fields in, one JSON string out, and that string is what the Sheet Generator prints. Think of it as a stat block form that happens to live inside ComfyUI - ugly to look at, exactly what you need.

    How it works. When you hit run, it gathers every input into a dictionary and json.dumps it with indentation. The keys matter because the card layout looks fields up by name: NAME, RACE, CR, HP, AC, SPEED, the six ability scores plus saves, the skill modifiers, IMMUNITY, RESISTENCE, WEAKNESS, SPELLCASTING, RESOURCES, DESCRIPTION, and an ACTIONS array. Everything goes into the JSON as strings (even the numbers, so HP 50 prints fine), and the output is a multiline STRING you wire straight into the Sheet Generator's i_s_npc_json input.

    The node is long, so the author added cosmetic ====== STRENGTH ====== separator widgets between each ability block. Those are pure UI decoration - they're defined as inputs so the widget stays visible in the node, but the code never reads them. Ignore them, or don't touch them; they change nothing.

    Inputs worth knowing. The top handful are obvious - name, race, cr, hp, ac, speed. Two details:

    • cr is a STRING, not a number, which is a small godsend: D&D challenge ratings like "1/2" or "1/4" work as-is.
    • image_prompt is metadata, not an instruction - it's the prompt you used (or will use) to generate the portrait, stored in the JSON so the card carries a record of how the art was made. Pair it with whatever you feed the portrait generator to keep the picture matching the sheet.

    Below that come the six ability scores with their saves and skills. There are two gotchas here, and both are in the shipped source, not rumors:

    • ATHLETICS is silently ignored. The node defines the input, but the code writes "ATHLETICS": -2 into the JSON no matter what you type. If Athletics on your NPC matters, edit the node file (cl_orso_character_sheet_generator_comfyui_bindings.py, one line where "ATHLETICS" is set) or accept the -2.
    • "RESISTENCE" is misspelled - deliberately consistent typo that the layout also uses. Leave it.

    The ability optional input is how the third node in this pack plugs in: feed it the chained abilities JSON and it merges them into ACTIONS.

    Where this sits in the pipeline. ComfyUI is mostly plumbing - this whole node is a glorified "build a string" value node with a D&D skin, and that's fine, because it's the source of truth for the card. Run it as part of your normal generation graph (the front-of-card portrait and this node can run in parallel; nothing waits on anything). Change a stat, hit run, and you're re-printing the card. If you'd rather keep the graph tidy, you can paste the whole JSON into the Sheet Generator by hand - the output is just text.

    Install. Same as the rest of the pack - ComfyUI Manager search comfyui-orso-character-sheet-generator, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/OrsoEric/comfyui-orso-character-sheet-generator
    

    Restart, and the three nodes show up under dnd5e-orso. No model downloads, no extra Python packages - the pack leans entirely on Pillow and torch, both already in ComfyUI. The one failure mode to expect is feeding the output somewhere that wants valid JSON and getting a multiline string instead - it's a STRING output, not a magic type, so wire it to another STRING input, not a JSON-loaded node.

    Categorydnd5e-orso

    Inputs (52)

    NameTypeDefaultDescription
    nameSTRINGOlivia Prezzo
    raceSTRINGHalfling - Lightfoot
    crSTRING5
    hpINT501–999
    acINT160–50
    speedSTRINGWalk: 6sq
    image_promptSTRINGPortrait AR1:1.5. Digital, semi-realistic painterly style that blends heroic fantasy with vibrant color palettes and detailed, textured, and shadowed rendering. Full body from head to toe. Chubby Halfling. Visible eye bags. Neutral expression. She's wearing a pointed hat and a rugged, earth‑toned robe cinched with a belt. In each hand, she holds a large glass flask—one filled with a vivid red liquid and the other with a bright green one. On her back, a alchemical refining alambic backpack with glass tubes and condensation loops with colorful liquids gurgling trough. Background is her workshop with wooden walls.
    descriptionSTRINGOlivia Prezzo, a halfling woman in her forties, has become Campocestro's clandestine alchemist. Her laboratory is lined with dusty vials and ancient apparatus that glimmer with a faint blue glow despite their age. Chubby and a leg tall, her eyes perpetually rimmed with dark circles from endless nights of experimentation. She does lots of field work, and possesses an alchemical backpack to brew perishible ingredients on her gathering expeditions. The villagers hold her in high regard for her botanical expertise that saved countless crops from drought. Nobody knows why she left her prestigious job in Ironspur to come to the Ao forsaken frontier village of Campocestro
    resourcesSTRINGActions: 1 Bonus Actions: 1 Reactions: 1 Legendary Actions: 1
    spellcastingSTRINGSpell ability: INT Spell List: Wizard (Alchemist) Spell Bonus: +5 Spell Save DC: 16 Spell Slots: 5, 3, 1
    immunitySTRINGPoison
    resistanceSTRINGAcid
    weaknessSTRINGHoly, Blunt, Fire
    proficiencyINT3-10–10
    initiativeINT3-10–10
    str_sepSTRING====== STRENGTH ======
    STRENGTHINT-2-10–10
    STR SAVEINT-2-10–10
    ATHLETICSINT-1-10–20
    dex_sepSTRING====== DEXTERITY ======
    DEXTERITYINT3-10–10
    DEX SAVEINT3-10–10
    ACROBATICSINT3-10–20
    SLEIGHT OF HANDINT1-10–20
    STEALTHINT2-10–20
    con_sepSTRING====== CONSTITUTION ======
    CONSTITUTIONINT1-10–10
    CON SAVEINT1-10–10
    int_sepSTRING====== INTELLIGENCE ======
    INTELLIGENCEINT5-10–10
    INT SAVEINT8-10–10
    ARCANAINT4-10–20
    INVESTIGATIONINT3-10–20
    HISTORYINT2-10–20
    NATUREINT1-10–20
    RELIGIONINT0-10–20
    wis_sepSTRING====== WISDOM ======
    WISDOMINT1-10–10
    WIS SAVEINT2-10–10
    ANIMAL HANDLINGINT-1-10–20
    INSIGHTINT2-10–20
    PERCEPTIONINT3-10–20
    MEDICINEINT5-10–20
    SURVIVALINT0-10–20
    cha_sepSTRING====== CHARISMA ======
    CHARISMAINT0-10–10
    CHA SAVEINT0-10–10
    DECEPTIONINT1-10–20
    INTIMIDATIONINT-1-10–20
    PERFORMANCEINT-1-10–20
    PERSUASIONINT-1-10–20
    abilityoptSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING