🐲How To: D&D Character Sheet Generator

This workflow creates an easy to reproduce and reiterate D&D character creation Glif. It uses a mix of User Input, Randomization, Text Generation. JSON Extraction, Image Generation, and HTML.

Part 1
Part 2

Check out and Remix our Example Glif Here!

Step by Step

  1. Click β€˜Build’ to start a new project.

  2. Add the two user inputs for text prompt and level.

  3. Add the two text input Multipick blocks and upload the official D&D race list and class list into each. Select the Randomize button.

  4. Add a Text Generation block and adjust to the recommended settings for Character Background.

  5. Add a Text Generation block and adjust to the recommended settings for Stats Blocks.

  6. Add a Text Generation block and adjust to the recommended settings for Image Prompt.

  7. Add a ComfyUI block and adjust the JSON as recommended.

  8. Add two JSON Extractor blocks and set one up to correspond with the Character Background output and another to correspond with the Stat Block output.

  9. Using an HTML block, finish setting up the HTML formatted final character sheet with the provided HTML code and make any necessary changes.

  10. Name and Publish your Glif.

Codes and Content

Text Generation LLM Blocks

Prompt

You are tasked to create an amazing new character for a D&D campaign. Using {text-input} {lvl}(absolutely work in these inputs and follow closely), in addition to {race} and {class} , you need to use all of the official d&d published character resources to come up with a character, choose an official sublcass, and give them a really interesting backstory. If the race or class in {text-input}is different from the {race} or {class}, default to {text-input}{lvl}.
Do not speak conversationally, you should say just the details of the character and nothing more. You do not need to create a stat block for them, please just focus on personal details. Make sure that official details like race, class, and subclass follow published d&d materials. Keep the backstory to one paragraph in length. 
Export as a json.

Max Tokens

2000

Model

Claude-3.5-sonnet

System Prompt

You are an incredibly talented DM. You are a helpful assistant. Your specialty is to come up with the character traits in the following format:

{
    "name": "NAME",
    "race": "RACE",
    "backstory":"BACKSTORY",
    "class":"CLASS",
    "subclass":"SUBCLASS",
    "background":"BACKGROUND",
    "inventory":"INVENTORY",
    "equipment":"EQUIPMENT"
}

ComfyUI Image Generation Prompts & HTML

To put in the JSON area:

{
  "3": {
    "inputs": {
      "seed": 270796374588362,
      "steps": 45,
      "cfg": 7,
      "sampler_name": "dpmpp_2m_sde",
      "scheduler": "karras",
      "denoise": 0.9,
      "model": [
        "29",
        0
      ],
      "positive": [
        "6",
        0
      ],
      "negative": [
        "7",
        0
      ],
      "latent_image": [
        "30",
        0
      ]
    },
    "class_type": "KSampler",
    "_meta": {
      "title": "KSampler"
    }
  },
  "4": {
    "inputs": {
      "ckpt_name": "sd_xl_base_1.0.safetensors"
    },
    "class_type": "CheckpointLoaderSimple",
    "_meta": {
      "title": "Load Checkpoint"
    }
  },
  "6": {
    "inputs": {
      "text": "portrait of {prompt}, illustration style",
      "clip": [
        "29",
        1
      ]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "CLIP Text Encode (Prompt)"
    }
  },
  "7": {
    "inputs": {
      "text": "watermark, bad, ugly, messy",
      "clip": [
        "29",
        1
      ]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "CLIP Text Encode (Prompt)"
    }
  },
  "8": {
    "inputs": {
      "samples": [
        "3",
        0
      ],
      "vae": [
        "4",
        2
      ]
    },
    "class_type": "VAEDecode",
    "_meta": {
      "title": "VAE Decode"
    }
  },
  "25": {
    "inputs": {
      "filename_prefix": "ComfyUI",
      "images": [
        "8",
        0
      ]
    },
    "class_type": "SaveImage",
    "_meta": {
      "title": "Save Image"
    }
  },
  "29": {
    "inputs": {
      "repo_id": "alvdansen/midsommarcartoon",
      "subfolder": "",
      "filename": "araminta_k_midsommar_cartoon.safetensors",
      "strength_model": 1,
      "strength_clip": 1,
      "model": [
        "4",
        0
      ],
      "clip": [
        "4",
        1
      ]
    },
    "class_type": "HFHubLoraLoader",
    "_meta": {
      "title": "Load HF Lora"
    }
  },
  "30": {
    "inputs": {
      "width": 1024,
      "height": 1024,
      "batch_size": 1
    },
    "class_type": "EmptyLatentImage",
    "_meta": {
      "title": "Empty Latent Image"
    }
  }
}

Last updated