Extensions/OdinSam DocumentAnalysis
ComfyUI Extension

OdinSam DocumentAnalysis

ComfyUI document loader/parser: txt single STRING output, markdown multi STRING outputs by / sections. Optional OdinSamKit UI.

By odinGitGmail·Created a day ago·Updated about 23 hours ago· 0
odinGitGmail/ComfyUI-OdinSam-DocumentAnalysis
Nodes—
On cloudLocal install
Stars0
Updatedabout 23 hours ago
Readme
<div align="center"> <h1>DocumentAnalysis</h1> <p> <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a> <a href="pyproject.toml"><img alt="Version" src="https://img.shields.io/badge/version-0.1.0-blue.svg"></a> <a href="https://github.com/comfyanonymous/ComfyUI"><img alt="ComfyUI" src="https://img.shields.io/badge/ComfyUI-Custom%20Node-00b894.svg"></a> <a href="https://www.python.org/"><img alt="Python" src="https://img.shields.io/badge/Python-%3E%3D3.9-3776AB.svg"></a> <a href="https://registry.comfy.org"><img alt="Registry" src="https://img.shields.io/badge/Registry-odinsam--document--analysis-6c5ce7.svg"></a> </p> <p> <a href="README.md">English</a> · <a href="README.zh-CN.md">中文</a> </p> <p> ComfyUI <b>document parser</b> node: upload <code>.txt</code> / <code>.md</code> (UTF-8), emit <code>STRING</code> by format (single output for txt, multi for markdown). </p> <p> <b>Node:</b> <code>OdinSamDocumentAnalysis</code> / 文档解析 (OdinSam)<br> <b>Category:</b> <code>OdinSam/DocumentAnalysis</code> · <b>Registry:</b> <code>odinsam-document-analysis</code> </p> <p> <img src="docs/node.png" alt="DocumentAnalysis node" width="420"> </p> </div>

Features

| Feature | Detail | |---------|--------| | Ports | Outputs only (format / upload are in-node widgets) | | Format | Combo txt / markdown (above the file field) | | File | Read-only path box; filled after “Choose file to upload”; .txt / .md only | | Encoding | UTF-8 only; non-UTF-8 raises an error | | Format txt | Whole file → first STRING slot (label text) | | Format markdown | Multi STRING outputs (max 16); slot labels = ### titles | | Auto parse | Parse after upload using the current format; re-parse on format change if a file is set (extension does not override format) | | MD rules blurb | When format is markdown, a read-only rules panel appears under the upload button | | OdinSamKit | Optional: section collapse, Chinese labels, rules visibility |

Markdown rules

  1. The line after each ### title must be #### content, or an error is raised
  2. There must be a space between ### / #### and the text
  3. Empty title (after trim) → skip that group
  4. Duplicate titles → error
  5. Max 16 groups; output display names = titles
### Prompt
#### a cat sitting on a sofa
### Negative
#### blurry, low quality

→ Two STRING outputs labeled Prompt and Negative. Set downstream node titles to the same names for alignment.

OdinSamKit

Business logic does not require KIT. Without it the node still runs fully (upload, parse, rename outputs).

| Item | Requirement | |------|-------------| | Minimum KIT version | OdinSamKit ≥ 0.2.0 | | Check | Browser console: window.OdinSamKit.version | | Relationship | Weak / optional enhancement |

Embedded config includes labels, a “文档” section, and visibility for md_rules when format=markdown.
Output ports are managed by this package’s frontend — not KIT countSync.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/odinGitGmail/ComfyUI-OdinSam-DocumentAnalysis.git DocumentAnalysis
# optional UI kit
git clone <OdinSamKit-repo> OdinSamKit

Restart ComfyUI. Node: 文档解析 (OdinSam) under OdinSam/DocumentAnalysis.

Or install via Comfy Registry / Manager: odinsam-document-analysis.

Minimal usage

Add「文档解析 (OdinSam)」
Pick format txt or markdown
Choose file to upload → .txt / .md
STRING outputs → [Show Text] or other text nodes

Smoke checks

  1. Without KIT: upload .txt, format txt, wire to Show Text — full text OK.
  2. Valid paired ###/####, format markdown — labels = titles, contents OK.
  3. Select markdown first, then upload a .txt — format stays markdown (not forced by extension).
  4. Bad next line / duplicate title / non-UTF-8 → clear errors.
  5. Optional: install OdinSamKit → Chinese labels/sections; MD rules visible in markdown mode.

License

MIT