View DOC Metadata
Read everything a document says about itself
- doc
- title
- description
- author
- copyright
- language
- keywords
- keywords_list
- created
- modified
- generator
- custom
- word_count
- character_count
- asset_count
- assets
- has_metadata
- summary
Documents are boxes of text that also carry a story about themselves - who wrote them, when, what licence, what to call them. View DOC Metadata is the node that opens the box and hands you every bit of that story on its own socket, and it shows the whole reading on the node as it goes. It's the first thing you reach for after a Load DOC or a Text to DOC when you want to know what you're actually holding.
What it does
Feed it any DOC (from any node with a DOC output - Text to DOC, Load DOC, a converted file) and out comes a column of sockets, one per metadata field: title, description, author, copyright, language, and keywords, plus a keywords_list (the same keywords as a list, for Text List Get and friends). Then come the timestamps - created and modified as UTC strings like 2026-01-02T03:04:05Z, which sort correctly as text - and generator, which is WAS Node Suite for anything this pack wrote.
The important thing about all of these: a field the document doesn't carry comes out empty, not invented. An older document with no language tag reports an empty language, and a document with no created stamp doesn't pretend it was written when you read it. No guessing, which keeps downstream logic honest.
Beyond the descriptive fields:
- custom - the author's own key-value pairs as a DICT, for Text Dictionary Get or Dictionary to Console. This is where anything the standard fields have no room for travels.
- word_count and character_count - counted from the content on this run, with markup stripped first, so bold text inside a word doesn't split it. That means they're always right even if the file's own stored count went stale. Zero for an empty document.
- asset_count and assets - how many files are embedded in the document (pictures, say) and their names, each relative to the document's own assets folder. Zero and empty when there are none.
- has_metadata - true when any of title, description, author, copyright, language or keywords holds something. Wire it into a switch and you can fill fields in before export rather than shipping a file that describes nothing.
- summary - the whole reading as one block of text, a field per line with
(not set)for empties. The same text is drawn on the node. Send it to Text to Console or a text file to keep a record of what a run produced.
How to use it
This is an output-style node (ComfyUI marks it as one), so its main job is inspection - but the sockets make it programmable too. The pattern that pays off is gating exports on has_metadata (fill in a title before you ship), feeding word_count into a condition that catches an accidentally-empty document, and using keywords_list to drive list nodes when a doc's tags need processing. And honestly, just wiring it after any DOC-producing node once is worth it: it's the fastest way to see what your Text to DOC really ended up carrying, and it reads from the wire, not from disk, so what it reports is what this document actually holds right now.
Installing it
Part of WAS Node Suite v3 (WASasquatch's was-node-suite-comfyui, MIT). Search "WAS Node Suite v3" in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
Restart ComfyUI after installing. Requires ComfyUI 0.14.0+ and Python 3.10+; no extra packages needed to read metadata. Only exporting to Office formats (via Save DOC) pulls in the optional document_export dependency group.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| doc | DOC | The document to read, from any node with a DOC output. What is reported is what this wire carries; nothing is opened from disk. |
Outputs (17)
| Name | Type | Description |
|---|---|---|
| title | STRING | What the document is called. Empty when it has none, which is how a document made from plain text starts out. This is the title an exported file carries and the one a file manager shows in its title column. |
| description | STRING | The sentence or two saying what the document is. Empty when nothing was written. Every format a DOC exports to carries it. |
| author | STRING | Who wrote the document, as free text. Empty when the document names nobody. |
| copyright | STRING | The rights statement as free text, such as '(c) 2026 A. Name, CC BY 4.0'. Empty when the document makes no claim. |
| language | STRING | The language tag the document is written in, such as 'en' or 'pt-BR', which sets hyphenation and spell checking in an exported file. Empty when the document carries no tag. |
| keywords | STRING | The keywords joined with commas, which is how the document formats and desktop search engines spell the field. Empty when the document has none. Use the keywords_list output instead to reach one keyword at a time. |
| keywords_list | ARRAY | The same keywords as a list, in the order they were given, for Text List Get, Text List Length and Text List Slice. A document with no keywords gives an empty list, which those nodes report as a length of zero rather than failing. |
| created | STRING | When the document was first made, as UTC in the form '2026-01-02T03:04:05Z', which sorts correctly as text. Empty when the document carries no stamp: the time it was read is never reported as the time it was written. |
| modified | STRING | When the document's content last changed, in the same form as created. Editing its text or embedded files stamps this; changing only its metadata does not. Empty when the document carries no stamp. |
| generator | STRING | What produced the document, 'WAS Node Suite' for one this pack wrote. Empty for a container built by hand or by another tool that did not fill the field in. |
| custom | DICT | The author's own pairs of text, in document order, for Text Dictionary Get, Text Dictionary Keys and Dictionary to Console. All three export formats keep them. Empty when the document has none. |
| word_count | INT | How many words the document's text holds, markup stripped first. Counted from the content on every run, never read from the file. 0 for an empty document. |
| character_count | INT | How many characters that same text holds: spaces between words count, each line break counts as one, indentation between tags counts for nothing. 0 = the document came out empty. |
| asset_count | INT | How many files are embedded in the document, such as its pictures. 0 for a document that carries none. An entry naming a place outside the document is not counted. |
| assets | ARRAY | The names of those files, sorted, each one relative to the document's own assets folder and spelled with '/' whatever machine the document was written on. An empty list when there are none. |
| has_metadata | BOOLEAN | True when any of title, description, author, copyright, language or keywords holds something; the timestamps and generator do not count. Wire it into a switch to fill the fields in before an export. |
| summary | STRING | The whole reading as text, a field to a line labelled with its socket's name, '(not set)' where empty. The same text shows on the node; send it to Save Text File to keep a record. |