Nodes/comfyui_ui_render/HTML Renderer
ComfyUI Node

HTML Renderer

Render HTML Right Inside the Node, Not in a Browser Tab

By gabe-init·Created about a year ago·Updated about a year ago· 3
HTML Renderer
      html

      You've got a node that spits out HTML - an LLM node that builds a formatted table, a script that formats a status report, debug output you actually want to read - and you'd rather look at it than copy-paste it into a browser. That's the whole pitch of HTML Renderer: it's a display node that takes an HTML string and renders it in a small iframe embedded right in the node body. No external viewer, no copy-paste, just the rendered thing sitting in your graph.

      Think of it as the ShowText family's sibling that doesn't stop at text. ShowText prints a plain string; this interprets the string as HTML. It lives in the "UI Render" category, and it's genuinely nice for anything that already produces HTML, since the formatted output shows up exactly where you're working instead of as a wall of escaped markup in a text box.

      How it works

      The backend is about as simple as a ComfyUI node gets. HTMLRendererNode is declared as OUTPUT_NODE = True, the same flag Preview Image and Save Image use - it always runs, and ComfyUI caches backward from it. Its only input is html, a STRING with forceInput: True. That flag matters: you can't type into this node. There's no text widget. The input has to be connected from another node, period.

      On execution it returns {"ui": {"html": [html]}} - the string rides the execution message out to the frontend. There, a small JS extension (web/js/html_renderer.js) has already built the node's DOM: a container div holding an <iframe>, added via addDOMWidget. When the message arrives, onExecuted grabs message.html[0] and drops it into iframe.srcdoc. Because it renders through srcdoc, the HTML lives in its own iframe document - your scripts run, but they can't reach into the ComfyUI page around them. That isolation is browser-native iframe behavior doing the security work, not anything clever the pack does.

      The one input that matters

      Just html, and the outputs list is empty. This is a terminal node: it displays and stops, so don't go looking for a socket to wire out of it. Feed it from anything that outputs STRING - core's String node, PrimitiveString (the multiline variant is handy for big chunks of HTML), or an LLM/text node that emits HTML.

      Installing it

      ComfyUI Manager can find it if you search "comfyui_ui_render", or do it by hand:

      cd ComfyUI/custom_nodes
      git clone https://github.com/gabe-init/comfyui_ui_render
      

      Then restart ComfyUI. That's the entire install. pyproject.toml declares zero Python dependencies, there's no requirements.txt and no models to download - lighter than most custom nodes get. The pack is on the Comfy Registry, so Manager treats it as a first-class citizen.

      Where people get burned

      The most common failure is connecting nothing. Because the input is forceInput, an unconnected node errors out instead of showing a blank renderer - wire a string source in and you're done.

      The bigger annoyance is clipping. ComfyUI node bodies are a fixed height, and the container is overflow: hidden, so a long table or tall chart just gets cut off mid-content. The README's own Limitations admit there's no height auto-sizing, so keep your HTML compact. Inline <style> and inline <script> work reliably; external images or CDN-hosted resources are hit or miss because iframe CORS rules apply. And if a script silently dies, open the browser console (F12) - sandboxed iframes restrict some JavaScript, and the errors land there, not in the node.

      Honest caveat: this is a small, young pack with essentially no install base on comfy.icu, and it leans heavily on the ShowText pattern rather than doing anything novel. If all you need is HTML rendered inside a node, it's the smallest thing that does it. If you need it to do more, you'll outgrow it fast - but for a quick formatted-display node, it works.

      CategoryUI Render

      Inputs (1)

      NameTypeDefaultDescription
      htmlSTRING

      Outputs (0)

      No outputs