Nodes/Simple Markdown/Simple Markdown Preview
ComfyUI Node

Simple Markdown Preview

The text-preview node that reads your workflow back to you

By Mohamed-Sakr·Created 10 months ago·Updated 10 months ago· 2
Simple Markdown Preview
    • STRING
    text

    Every ComfyUI workflow is mostly plumbing - nodes that touch no pixels and exist just to move text around. The Simple Markdown Preview node (SimpleMarkdownPreview) is the rare plumbing node that makes that text readable. It takes any string you feed it and renders it as formatted markdown inside the node itself: headers, bold, lists, inline code, and fenced code blocks with color-coded syntax. No API calls, no API key, no models to download, zero dependencies. It's a display widget, pure and simple.

    Why reach for it? Most likely you're on the text side of a workflow that also produces images: you've got an LLM node or a prompt-assembly graph generating strings, or you're building filenames and captions, and you're tired of squinting at raw escaped text in a tiny input box. Or you want to keep a notes/markdown panel in a shared workflow so the thing is self-documenting when you hand it to someone. ComfyUI's core Show Text-style nodes print a string into a log or a monospace box; this one formats it. That's the entire niche, and it fills it fine.

    How it actually works

    The Python side is almost embarrassingly simple - and that's a feature. The node class takes one text input, returns it unchanged, and shoves a copy into the ui payload that ComfyUI sends to the frontend. Because it's marked OUTPUT_NODE, ComfyUI treats it like Preview Image: it always runs, and the graph re-executes enough upstream to keep it fresh. Because it returns the string as its output rather than just displaying it, you can wire it inline - put it in the middle of a graph and the text keeps flowing to whatever's next.

    The rendering happens in the JavaScript side, which registers a custom DOM widget on the node. When the node executes, a JS handler grabs the string, normalizes the indentation of fenced code blocks, and regexes the markdown into styled HTML: # and ## become headers, **bold** becomes bold, - items become bulleted, backticked inline code gets a dark chip background. Fenced blocks get a crude syntax highlighter that color-codes strings, comments, keywords, and numbers. It also lets you pass raw <div style="color: ...">...</div> tags through for custom colors - handy when a prompt-assembly graph is tagging parts of its output. Two small touches worth knowing: it auto-scrolls to the newest content (nice for live-updating logs), and the display area resizes with the node.

    Don't expect GitHub-flavored markdown. This is a hand-rolled subset - tables, links, images, and ###+ headers won't render as you'd hope, and the "syntax highlighting" is regex approximation, not a real parser. For a quick glance it's plenty; for documentation authoring you'd export elsewhere.

    The one input and the pass-through output

    • text (STRING, required) - the only input. Note it's forceInput, so it's a socket, not a box: you can't type into this node. Wire it from any string source - a PrimitiveString, an LLM node, or the Convert widget to input output of a CLIP Text Encode. Dynamic prompts are explicitly disabled, so {prompt} syntax passes through as literal text.
    • Output (STRING) - the same string, unchanged, so you can chain the preview into the middle of a graph instead of making it a dead end.

    Installing

    Easiest path is ComfyUI Manager - search "Simple Markdown Preview" (the pack is ComfyUI-SimpleMarkdown) and hit Install. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Mohamed-Sakr/ComfyUI-SimpleMarkdown
    

    Then restart ComfyUI. That's it - the pack's pyproject.toml declares an empty dependency list, so there's no pip step and no model download to babysit.

    Where people get burned

    The most common stumble is forgetting the input is a socket, not a widget - you wire a string in and nothing renders until you queue a run, since output nodes only fire when the graph executes. Blank preview? Check that the upstream node actually ran.

    The deeper, ecosystem-level gotcha: display widgets like this one were exactly the class of node that ComfyUI's Nodes 2.0 frontend rewrite broke for some third-party packs. If the markdown area is missing or dead after an update, the standard community fix is to disable Nodes 2.0 in Settings and run the legacy canvas - ComfyUI's own forums and the reddit threads on display-widget breakage say so plainly. This pack is small and its widget code is straightforward, but when the frontend changes, the unpaid display-node authors feel it first.

    Keep expectations calibrated: it's a utility node for reading your own text at a glance, and it does that one job without fuss. It won't format your paper, but nothing else in the ecosystem will do it for zero install cost, either.

    Categoryutils

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING