Nodes/FlowCV/渲染HTML
ComfyUI Node

渲染HTML

FCV_ShowDOM

By Bit-Walker·Created about a year ago·Updated 7 months ago· 3
渲染HTML
      内容<h1>Hello World</h1><p>This is <strong>HTML</strong> content.</p>

      Need to show HTML inside your ComfyUI graph instead of in a browser tab? That's this node. 渲染HTML (class FCV_ShowDOM) takes an HTML string and renders it live in a scrollable container on the node itself, refreshing whenever the workflow runs. It's an output-only node - one input, no outputs - so it's the end of a wire, the way a preview node is.

      Why would you? Same reasons you'd want any rich-text display in a graph: a styled status panel, a live-formatting preview of generated content, an HTML report summarizing your run, or just a nicer note than a plain STRING widget. Since the input is a normal STRING, you can wire it to anything that produces text - including Markdown-rendering chains or your own content generators.

      How it works

      The Python half is a stub: it takes the 内容 (content) input and ships it to the frontend as a ui payload. The JavaScript half creates a DOM container inside the node (via addDOMWidget) and, on each execution, injects the string as inner HTML. That's the whole trick - and the reason for the one real caveat: it's raw innerHTML, so if you feed it untrusted input you're building an XSS sink into your own canvas. Fine for your own workflows and workflow metadata; don't paste random web HTML into it and expect it to be inert.

      Using it

      Single input 内容 (content), default "<h1>Hello World</h1>...". It's is_output_node, so ComfyUI treats it as a graph endpoint - the node runs, the container updates, done. To get HTML into it from Markdown, pair it with a FCV_MarkdownEditor output or feed it a FCV_ShowMarkdown-style source. There's no output port, so this node is purely a display.

      Installing

      Bundled in FlowCV. ComfyUI Manager, search "FlowCV"; or:

      cd ComfyUI/custom_nodes
      git clone https://github.com/Koren-cy/FlowCV
      

      Restart ComfyUI. Dependencies are the pack's usual light set (opencv-python, numpy, pyserial); the display itself is pure frontend JS, no extra install. The README notes the project migrated to ComfyUI_For_Academic - repo archived, still works.

      Gotchas

      Besides the innerHTML caution, remember it renders on execution - a big or slow-to-build HTML string will lag the queue the same as any heavy node. And the node is a display widget: its content only lives in the workflow file, so save your workflow if the panel is precious. Chinese labels throughout, as is this pack's habit.

      CategoryopenCV/可视化

      Inputs (1)

      NameTypeDefaultDescription
      内容STRING<h1>Hello World</h1><p>This is <strong>HTML</strong> content.</p>要显示的HTML内容

      Outputs (0)

      No outputs