OdinSam DocumentAnalysis
ComfyUI document loader/parser: txt single STRING output, markdown multi STRING outputs by / sections. Optional OdinSamKit UI.
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
- The line after each
### titlemust be#### content, or an error is raised - There must be a space between
###/####and the text - Empty title (after trim) → skip that group
- Duplicate titles → error
- 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
- Without KIT: upload
.txt, formattxt, wire to Show Text — full text OK. - Valid paired
###/####, formatmarkdown— labels = titles, contents OK. - Select
markdownfirst, then upload a.txt— format stays markdown (not forced by extension). - Bad next line / duplicate title / non-UTF-8 → clear errors.
- Optional: install OdinSamKit → Chinese labels/sections; MD rules visible in markdown mode.
License
MIT