Create Markdown Image
The Original Markdown-to-Image Node, Windows Path and All
- IMAGE
This is the node the whole dasilva333/ComfyUI_MarkdownImage pack is named after: type a chunk of text, get back an image of that text, auto-sized to fit, with a border and a background color of your choice. It's a text-rendering utility, not a diffusion model - no checkpoints, no LoRAs, no VRAM. You use it at the end of a workflow when you want a caption, a subtitle strip, or a text tile that you can save or composite onto whatever you just generated.
The catch is in how it renders. This V1 node shells out to a separate system binary called wkhtmltoimage (part of the wkhtmltopdf project) through the Python imgkit wrapper. That binary is not installed by pip - it's a manual download - and it's the single thing most people trip over. The pack's V2 node replaces this whole mechanism with headless Chrome, so if you're starting fresh and don't already have wkhtmltopdf, weigh whether you want V1 at all. If you do, here's the ground truth.
How it works
md_text goes through the Python markdown library into HTML, which is wrapped in a template with your background color, border, and exact pixel size. A little JavaScript inside the page runs a binary search over font sizes (1px to 1000px) to find the largest font that fits the container, and imgkit renders the page to PNG via wkhtmltoimage. The PNG decodes to a float32 IMAGE tensor in ComfyUI's standard [0,1] range, ready for any downstream image node.
Two behavior quirks worth knowing before you design around it:
- The text is rendered with
white-space: nowrap, so everything lands on one line and the auto-fitter shrinks the font to make it fit. Long paragraphs become tiny text. Use<br>line breaks (or the inline-HTML speaker format from the default) rather than expecting wrapping. - The default
md_textis already raw HTML - colored<b>name tags plus<br>breaks - and themarkdownlibrary passes HTML through untouched. That inline-HTML style is genuinely the easiest way to drive this node.
The inputs that matter
Five things you'll actually set, out of six total:
md_text- the content. Multiline, supports basic Markdown (bold, italic) and inline HTML for colors.image_width/image_height- canvas in pixels, 16–4096. Defaults are 1024×200, which is a widescreen caption bar; for a square text tile you'd set both.background_color- HEX or named color (lightblue,white,#FFFF00…). Unlike V2, there's no theme system here - you pick one flat color.border_color/border_size- the frame around the text.border_size0 disables it.
Output is a single IMAGE. Wire it to SaveImage/PreviewImage, or paste it onto a generated scene.
Installing
Easiest is ComfyUI Manager: search ComfyUI_MarkdownImage and install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/dasilva333/ComfyUI_MarkdownImage
Then the part the README is honest about but understates: download wkhtmltopdf from https://wkhtmltopdf.org/downloads.html and install it. The README tells you to add wkhtmltoimage.exe to PATH, but the actual code ignores PATH - it hardcodes this path:
wkhtmltoimage=r"C:\Program Files\wkhtmltopdf\bin\wkhtmltoimage.exe"
So on a default Windows install it just works; anywhere else (Linux, Mac, a custom install location) you have to edit create_markdown_image.py in the pack folder and put your real path in. This is the #1 cause of "imgkit fails" errors with this node, and it's not something you can fix from the ComfyUI side.
Troubleshooting
OSError: Unable to locate ... wkhtmltoimage- see above: edit the hardcoded path increate_markdown_image.py.- Text too small or clipped - the single-line fitter is doing its job; shorten the text, add
<br>, or growimage_height. - Emoji render as boxes - the page uses Segoe UI Emoji; on Linux the fallback font set may not cover them. That's a system font issue, not a node one.
The pack is MIT-licensed, ships no models, and is a good 15-minute setup on Windows and a mildly fiddly one elsewhere. If you're on anything but Windows, the Chrome-based V2 node is probably the version you want instead - V1 is the original, and it's fine, but its dependency is firmly Windows-flavored.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| md_text | STRING | <span style="color: #C71585;"><b>Girl:</b></span> Do you think the bunnies are watching us? 🐰<br> <span style="color: #00008B;"><b>Man:</b></span> Only to wish they could be as happy as we are. 😂 | — |
| border_color | STRING | #FFFF00 | — |
| border_size | INT | 10–100 | — |
| image_width | INT | 102416–4096 | — |
| image_height | INT | 20016–4096 | — |
| background_color | STRING | lightblue | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |