ComfyUI Node

Chandra OCR 2

Chandra OCR 2 turns scans and screenshots into clean markdown

By MohammadAboulEla·Created 4 months ago·Updated 4 months ago· 0
Chandra OCR 2
  • image
  • text
output_formatmarkdown
prompt

ComfyUI is famously an image-in, image-out machine, which makes a node that spits out text something of a unicorn. Chandra OCR 2 is one of them: feed it a screenshot, a scanned page, or a photo of a whiteboard, and it returns the text as clean markdown, HTML, or JSON - layout preserved, tables intact, 90+ languages covered. If you've ever wanted to digitize a stack of PDFs into editable notes, pull text out of a UI mockup to paste into a spec, or hand a transcribed page to an LLM node downstream, this is the node you'd reach for.

A couple of honest caveats before you get excited. This is a brand-new, single-node pack from MohammadAboulEla with essentially zero community footprint yet - no battle-tested workflows floating around. The good news is the hard part isn't the wrapper, it's the model: Chandra OCR 2 comes from Datalab, the team behind the popular PDF-to-markdown tool Marker, and it's genuinely strong (the model card claims 85.8% on the olmOCR benchmark, with big gains on tables, math, and handwriting). The node is just a thin envelope around that model, so what you get out is mostly what the model earns.

How it works

Under the hood this isn't a lightweight OCR library. The node loads the full datalab-to/chandra-ocr-2 model - a ~10.6 GB BF16 safetensors vision-language model built on Qwen3.5 - through HuggingFace transformers, runs your image through Chandra's ocr_layout prompt template, and parses the raw output into the format you picked. It uses device_map="auto", so if your GPU can't hold the whole thing it spills into system RAM rather than crashing. The model is cached in a models/ folder inside the custom node directory, loaded once per ComfyUI session.

The first run is the rude awakening. The node pip-installs the chandra-ocr package (with --no-deps so it won't clobber ComfyUI's torch/transformers), then downloads that 10.6 GB model. That's a "go make coffee" moment, not a hang. Later runs are fast.

One gotcha the README hides from you: it's actually the GGUF model card, full of links to 5.16 GB Q8_0 quants. Don't download any of that. The node uses the full safetensors model and never touches GGUF - the qwen35 architecture isn't supported by the transformers GGUF loader yet, so the quant route is a dead end as of now. Ignore the download table entirely.

The inputs that matter

Only three, and honestly only two you'll touch:

  • image (required) - your IMAGE tensor. Note it reads the first image of the batch, so don't feed it a 100-frame video batch expecting per-frame OCR.
  • output_format - a dropdown: markdown (default), html, or json. Markdown is the sweet spot for reading and pasting; JSON gives you structured chunks if you're feeding the result into another node programmatically.
  • prompt (optional) - an empty string uses the default layout-OCR instruction. Fill it in to steer the model, e.g. "transcribe only the table" or "describe the handwritten notes in the margin."

The single output, text, is a plain STRING. Since the node is an output node, you'll see the result rendered right on it - from there you can save it to a file with a text-writing node or wire it into an LLM node for the next stage of a workflow.

Installing it

Standard stuff - the README doesn't bother to explain it, but it's the same for every pack:

  • ComfyUI Manager: search for "ComfyUI-Chandra-OCR-2", install, restart.
  • Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/MohammadAboulEla/ComfyUI-Chandra-OCR-2

Then restart ComfyUI. The pack's requirements.txt (accelerate, beautifulsoup4, markdownify, pypdfium2, and friends) is handled by Manager; the chandra-ocr package and model download happen automatically on your first run. One real constraint: this is built against ComfyUI's newer Nodes 2.0 / V3 API (comfy_api.latest), so if the node doesn't appear after install, update ComfyUI itself first - old builds won't load it.

If your first run dies partway through the model download, delete the partial files in custom_nodes/ComfyUI-Chandra-OCR-2/models/ and try again - HuggingFace resumes, but a clean slate is faster to debug. Beyond that, the biggest thing to expect is patience: a 10 GB download, a bf16 model that wants a chunky GPU (or lots of RAM to spill into), and an ecosystem that hasn't built around this pack yet. The model's worth it; just don't judge it on minute one.

CategoryChandra

Inputs (3)

NameTypeDefaultDescription
imageIMAGE
output_formatCOMBOmarkdown3 options: markdown, html, json
promptoptSTRING

Outputs (1)

NameTypeDescription
textSTRING