📁 COF Files
Skills, memories and documents for a character — text only, and that's the safety feature
- cof
- text
- paths
- labels
- count
The strangest node in the pack, and the most 2026
A .cof can carry the stuff an agent needs rather than the stuff a renderer needs: skills, memories, documents. COF Files exports those as text and as files on disk. It's the only node in the ComfyUI-COF pack that has nothing to do with pixels, audio or meshes.
Why is it in a ComfyUI node pack at all? Because the same graph that generates the character can now also run the character. Local LLM nodes are routine - prompt enhancers, captioners, chat - and a character preset is a bundle of exactly the things a local model wants: a persona, a language, and now a set of documents you'd otherwise paste into a giant text box. Skills as Markdown, memories as JSON, a document as YAML. Move that out of your clipboard and into the file that owns the character.
How it works
kind filters by category:
all- everything in the files category.skill- agent skill packages, typically aSKILL.mdplus areference/tree.memory- memory blobs, usually JSON.document- prose, notes, YAML configs, CSV tables.other- anything the author tagged that way.
Only text is read or extracted: .md, .txt, .json, .yaml, .yml, .csv. That's enforced in the reader, not the UI, and it's the reason this node can exist at all in a pack people will download blind. A script sitting inside a skill is listed in labels - you can see it's there - but it is never extracted, never opened, never executed. The pack is explicit that nothing in a .cof is run: only JSON, images, audio and safetensors get read, with a header check on the weights.
Extraction preserves the layout, which matters for skills:
ComfyUI/input/cof/cof-<file-stem>/files/<variant>/SKILL.md
ComfyUI/input/cof/cof-<file-stem>/files/<variant>/reference/schema.md
The variant-id path segments are sanitised, and .. segments are stripped - a skill can't climb out of its folder. So a skill stays a skill, with its relative links intact, rather than a flattened pile of Markdown.
The text output is the same content concatenated in one string, each file preceded by a ### <relative path> header. That header isn't decoration: it's what lets an LLM know which document it's reading when you stuff three of them into one prompt.
Inputs and outputs
Required: cof, kind, pick (all plus item_001…item_064, filled from the file in the UI).
text- every chosen file, one after another, each under its path header. This is the one you wire to an LLM prompt or a text-concat chain.paths- where the files were written, newline-separated.labels- one line per file, including any that were listed but skipped as non-text.count- how many files matched the kind, beforepick.
Mind the difference between text and paths: the first is content, the second is location. A workflow that wants to shove an entire skill into a context window uses text. A workflow whose consumer reads files from disk uses paths.
Install
Nothing extra - the pack's dependency list is empty and this node needs no model.
cd ComfyUI/custom_nodes
git clone https://github.com/yannsouetre/ComfyUI-COF
mkdir -p ComfyUI/models/cof
cp your-character.cof ComfyUI/models/cof/
Restart, press R for new .cof files. The preview workflow includes a COF Files node wired to Preview Any, which is how you check that a .cof actually has content behind those category names.
Common issues
text is empty but count isn't. Everything that matched was skipped as non-text. Read labels: skipped entries are annotated. This is the node doing its job - the alternative is a user asking "why did my workflow just read a shell script".
Huge text blows out your LLM's context. Obvious in hindsight, easy to do in practice. Pick one item, or use kind to narrow to memory, and remember the headers count toward tokens too.
Folder layout looks flattened. Check you picked a skill kind - the layout preservation is per-variant, so files that the author put in a flat variant really are flat.
An empty list is an empty list. Presets without files return zero items and a label saying so. No error, no fallback text.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| cof | COF | — | |
| kind | COMBO | the file types this preset has, with their counts | |
| pick | COMBO | all | the files by name; all = every one |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| text | STRING | the chosen text files, one after the other, each under its path |
| paths | STRING | where they were exported |
| labels | STRING | one line per file |
| count | INT | how many files match |