ComfyUI Node

Debug Model

When OCR returns nothing, run this before you blame the model

By PsychoLogicAu·Created 2 months ago·Updated 2 months ago· 0
Debug Model
  • unlimited_ocr
  • image
  • model_info
  • debug_image
  • debug_output
test_promptdocument parsing.

OCR came back empty and you're staring at the annotated image like it owes you money. Before you reinstall anything, drop Debug Model on the canvas. It's the pack's smoke test: run a tiny inference against your loaded model and report exactly what's happening.

What it does

It takes the model handle, an image, and a test_prompt (default "document parsing."), then runs a deliberately small decode - it forces max_length down to 256 and temperature to 0, ignoring any config you've built elsewhere. A smoke test shouldn't burn a full 32,000-token generation just to prove the plumbing works.

Three outputs come out:

  • model_info - a JSON string with model_path, load_device, offload_device, and dtype. The fastest check that the loader did what you asked: it tells you whether the model actually landed on the GPU or got offloaded to CPU, and at what precision. If it says torch.float16 when you asked for bf16, there's your clue.
  • debug_image - the input image passed straight through. Useful for confirming which image the test actually ran on.
  • debug_output - the first 200 characters of the model's answer, or the full exception text if inference failed. This is the money output: real output proves the model works and the problem is your image, prompt, or settings; an error trace proves the model itself is the problem.

How to read it

Wire the model from Load Unlimited OCR Model and any image in, then put a Show Text node on model_info and debug_output. The diagnostic flow goes: does the model load (is model_info sane)? Does it produce anything (is debug_output non-empty)? Only then is it worth debugging your actual OCR settings. It saves you the classic trap of tuning image_size and max_length for an hour when the real issue was a half-downloaded model.

Notes

The debug node shares the pack's memory management - the model loads through ComfyUI's patcher, so it plays nice with whatever else is in VRAM, and the cache keeps the model warm for the inference node right after. And remember: it ignores your Configure Inference node on purpose, so don't try to "fix" a debug failure by tweaking config. The smoke test runs fixed tiny settings regardless.

Install is the same as its siblings: it ships in comfyui-unlimited-ocr, so ComfyUI Manager (search "Unlimited OCR") or cloning https://github.com/PsychoLogicAu/ComfyUI-Unlimited-OCR gives you all four nodes plus the shared model download.

Honestly, most workflows will never need this node. But when OCR silently fails - and it will, eventually - this is the difference between a five-minute diagnosis and a two-hour rabbit hole.

CategoryUnlimited OCR/Debug

Inputs (3)

NameTypeDefaultDescription
unlimited_ocrunlimited_ocr_model
imageIMAGE
test_promptSTRINGdocument parsing.

Outputs (3)

NameTypeDescription
model_infotext
debug_imageIMAGE
debug_outputtext