Markdown编辑器
The Markdown editor node
- markdown代码
A Markdown editor has no business being in an OpenCV pack, and yet here it is - one of FlowCV's more pleasant surprises. Markdown编辑器 (class FCV_MarkdownEditor) drops a real editor widget into the canvas with a live preview, and hands the text out as a STRING so other nodes can consume it. If you've ever wanted to keep a workflow notebook attached to the graph - parameter notes, changelogs, the prompt you actually used - this is a tidy way to do it.
It's the only editor in the group: the pack's other display nodes (FCV_ShowMarkdown, FCV_ShowDOM) are render-only, whereas this one is editable and connected. The default content is a friendly little sample doc, so the first thing you see is a working example, not a blank box.
How it works
The Python side is deliberately dumb: process() just passes the current content through and returns it twice - once as the ui payload that drives the frontend widget, once as the node's STRING output (markdown代码). All the interesting behavior lives in the JavaScript: the widget has an edit/preview mode toggle (labeled 预览模式), and rendering is done client-side with the marked library pulled from a CDN. Edit the textarea, hit preview, and the rendered HTML updates in place.
Using it
The single input, 内容 (content), is the initial Markdown - it's the seed text, and its tooltip says so. The output is the current content as a plain STRING, so you can wire it into any node that takes text: a prompt field, a caption, a file-writer, or another FCV_ShowMarkdown if you want the rendered result somewhere specific. Because editing happens in the frontend, the output reflects whatever's in the box when you run the workflow - editing a workflow you loaded from a PNG keeps the notes attached to the graph itself.
Installing
It ships in FlowCV - ComfyUI Manager, search "FlowCV"; or:
cd ComfyUI/custom_nodes
git clone https://github.com/Koren-cy/FlowCV
Restart ComfyUI. Dependencies: opencv-python, numpy, pyserial - note these are pack-wide; the editor itself needs nothing beyond the bundled JS. The README says the project migrated to ComfyUI_For_Academic, so this repo is archived but functional.
Gotchas
The preview renderer loads marked from cdn.jsdelivr.net, so a browser that can't reach the CDN (air-gapped setup, strict network) shows plain text instead of rendered Markdown - the editor still works, it just won't pretty-print. And it's a UI widget, not a file: the content lives in the workflow JSON, so keep saving your workflow. Minor thing: the tooltip/default labels are in Chinese, which is par for the course in this pack.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| 内容 | STRING | # Markdown编辑器 在这里编写你的**Markdown**内容。 - 支持实时预览 - 支持代码输出 - 易于使用 | 编辑器的初始Markdown内容 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| markdown代码 | STRING | — |