Nodes/ComfyUI_html/HTML Download
ComfyUI Node

HTML Download

The one-click 'just give me the file' node for generated HTML

By filipemeneses·Created about a year ago·Updated about a year ago· 2
HTML Download
      filenamemyhtml.html
      html

      Some nodes are for looking, some are for archiving, and then there's HTML Download, the one that just hands you the file. If your workflow has an LLM writing HTML - a landing page, an email, an invoice - this is the node that drops the finished markup straight into your browser's Downloads folder with zero ceremony. No counter, no output folder to dig through, no filename guessing. Run, download, done.

      It ships in the same tiny pack as HTML Preview and Save HTML, and the three are a natural read-modify-write loop: preview what the model wrote, tweak it, download the one-off copy. Where Save HTML is for permanent archiving, this is for "I just want the file on my machine right now."

      How it works

      The mechanism is two halves glued together. On the Python side, HtmlDownload is an output node with no return types - it writes your HTML to a file in ComfyUI's temp directory (the file gets a temp_ prefix), then hands the frontend a /view?filename=temp_...&type=temp URL. The bundled JavaScript extension hears that message, builds a hidden <a download> link pointing at the URL, and programmatically clicks it.

      That split matters: the actual download is a browser action, so this node only does anything when you run it in the ComfyUI web UI. Drive the same workflow headless or through the API and you'll get the temp file written and nothing visible on your screen.

      The inputs

      Only two, both required:

      • filename - what your browser saves the file as. Default myhtml.html. If you don't set it, everything you download is called myhtml.html, so set this.
      • html - the HTML string. It's marked forceInput, so wire it from a Load HTML node, a string primitive, or whatever your LLM node outputs.

      There are no outputs at all, which is fine - this is a sink node, the end of a line.

      Install

      Same as every node in this pack - no dependencies, no models, nothing heavy. Either search ComfyUI_html in ComfyUI Manager, or the manual route:

      cd ComfyUI/custom_nodes
      git clone https://github.com/filipemeneses/ComfyUI_html
      

      Then restart ComfyUI.

      Where people get tripped up

      • Nothing downloads when running via API or headless. The Python half runs, the browser half doesn't exist. If you need a download to trigger outside the UI, this is the wrong node - reach for Save HTML.
      • Temp files pile up. Every run writes a temp_<your filename> file into ComfyUI's temp folder. They get cleared on restart, so it's cosmetic, but it's there.
      • The filename is whatever your browser honors. The download attribute sets the suggested name, but some browsers still append a number if a file with that name exists in Downloads.

      It's a three-line utility wearing a friendly face, and for the one-off "give me the HTML" workflow it's exactly right. Just remember it's a UI feature, not a file-saving feature.

      Categoryutils

      Inputs (2)

      NameTypeDefaultDescription
      filenameSTRINGmyhtml.html
      htmlSTRING

      Outputs (0)

      No outputs