Nodes/ComfyUI-SimpleChat/Markdown Preview
ComfyUI Node

Markdown Preview

Read your LLM's reply the way it was meant to be read

By Moeblack·Created 9 months ago·Updated 7 months ago· 8
Markdown Preview
      text

      LLM replies are markdown. Headings, bold, tables, code blocks - and ComfyUI's default text widget renders all of that as a wall of raw ## and ** characters that's painful to read. Markdown Preview fixes the display end: wire any text output into it, run the graph, and the LLM's reply opens in a clean, rendered popup. It's the pack's built-in way to actually read what your chat node produced instead of squinting at escaped markup in a node title.

      How it works

      The backend does almost nothing - it just passes your text through on the ui.text channel, the same shape the stock PreviewAny node uses. The rendering happens in the frontend: the pack's web/markdown_preview.js takes that text and renders it to HTML in a popup, sanitized so you're not running arbitrary HTML from a model that might happily try. Nothing hits the network; it's purely local display.

      There are no output ports, because this is a terminal node - is_output_node is true, which is the pack's way of saying "the text goes nowhere from here, this is the end of the line." You can't chain past it.

      Where it fits

      End of a chat pipeline: SimpleChatText (or Chat with Image, or Chat NoASS) → text → this node. Execute, and the full reply - formatting intact - pops up. It's also handy as a debug end-point when you're building an LLM-to-JSON workflow: wire json_text in before it goes to a parser and see exactly what the model actually wrote, fences and all, before it hits JSON Parse.

      Installing it

      cd ComfyUI/custom_nodes
      git clone https://github.com/Moeblack/ComfyUI-SimpleChat
      

      Restart, or use Manager and search "ComfyUI-SimpleChat". Only dependency is aiohttp. Since the rendering is a frontend JS extension (WEB_DIRECTORY), make sure you restart ComfyUI after installing - the JS is only loaded at startup, and a running instance won't pick up a freshly cloned web/ directory.

      Gotchas

      It displays what you give it, so a raw LLM JSON dump shows up as a JSON code block - prettier than a widget, but not a JSON viewer; for that you want JSON Parse or Prompt JSON Unpack. And because it's an output node with no ports, if you need the text and a rendered view, branch it: one copy to this node, one copy onward.

      CategorySimpleChat/Utils

      Inputs (1)

      NameTypeDefaultDescription
      textSTRING

      Outputs (0)

      No outputs