Nodes/WAS Node Suite v3/Convert DOC to HTML
ComfyUI Node Runs on cloud

Convert DOC to HTML

The DOC is a zip full of HTML — this puts the markup on a string

By WASasquatch·Created 3 years ago·Updated 4 days ago· 1,844
Convert DOC to HTML
  • doc
  • html
wrapcontent only

If you saw "Convert DOC to HTML" in the Add Node menu and assumed it opens your Word files, close but no. In WAS Node Suite a DOC isn't a file you point at - it's a document that travels the graph on a wire. Open one and you'll find a little container whose guts are the markup in a content.html, a meta.json with the title and author, and any embedded assets. This node does exactly one job: pull that stored markup out and put it on a plain STRING socket so you can log it, save it, or hand it to something that expects text.

It makes sense inside WAS's document pipeline. Load Document reads a file into a DOC value - a .wasdoc (the container Save DOC writes) natively, or a .docx/.odt converted along the way. Rich Text Editor lets you edit a document's markup by hand. Save DOC writes the result back out. This node is the moment in between where you want the raw markup as a string rather than as a document - to preview it, to write a standalone .html, or to feed a text-processing node that doesn't know what a DOC is.

How it works

The doc input is the whole document, but the node reads only what you asked for and never opens anything from disk or changes the document - it's a read, not a conversion of a file sitting somewhere. The one widget that matters is wrap:

  • content only answers the markup fragment the document stores - the exact thing Rich Text Editor edits.
  • whole page wraps that fragment in a file with a doctype and a <head> carrying the title, author and the rest of the metadata, so you get a self-contained .html you could double-click in a browser.

If the document's markup already opens a page of its own, it comes through as it stands either way. Markup that holds no fragment at all - say a document built from nothing but metadata - answers an empty string, which a node saving it writes as an empty file.

The single output is html (STRING). Since the node is marked as an output node it runs even with nothing wired after it, which makes it a handy place to end a branch when all you want is to see or capture the markup.

Installing it

Standard WAS Node Suite install - ComfyUI Manager, search for WAS Node Suite v3, or:

cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git

Restart and it's there. Nothing else downloads; this v3 pack installs no pip packages by default and needs ComfyUI 0.14.0+ with Python 3.10+.

One wrinkle if your document actually starts life as a Word or OpenDocument file: Load Document reads .docx and .odt through python-docx and odfdo, which arrive with the pack's optional document_export group. Without them Load Document says so in its error, and a .wasdoc needs nothing at all.

Where people get confused

The most common stumble is expecting a file browser on this node. There isn't one, and that's by design - converting never touches disk, so the file picker lives upstream on Load Document. If you feed it a doc that carries no markup you get an empty string, not an error, which reads as "broken" until you check what the upstream node actually produced. Both are easy to chase if you know where to look.

CategoryWAS Suite/Document

Inputs (2)

NameTypeDefaultDescription
docDOCThe document to read, from any node with a DOC output. Nothing is opened from disk and the document is not changed.
wrapCOMBOcontent only'content only' answers the markup the document stores, which is what Rich Text Editor takes. 'whole page' wraps it in a file with a doctype and a head carrying the title, the author and the rest of the metadata. Markup that already opens a page is answered as it stands either way.

Outputs (1)

NameTypeDescription
htmlSTRINGThe document's markup. Empty where the document holds none, which a node saving it writes as an empty file.