Nodes/comfyui-undistort/IG_MatrixAndDistCoefToText
ComfyUI Node

IG_MatrixAndDistCoefToText

Free your calibration numbers from the graph with IG_MatrixAndDistCoefToText

By iFREEGROUP·Created 2 years ago·Updated 2 years ago· 2
IG_MatrixAndDistCoefToText
  • matrix
  • dist_coef
  • matrix_text
  • dist_coef_text

Three-node packs usually have a hero node and two passengers. IG_Undistort is the hero in iFREEGROUP/comfyui-undistort; this one is a passenger, and that's fine. IG_MatrixAndDistCoefToText does exactly one thing: takes the matrix and dist_coef outputs from IG_LoadCheckerboardImageForCalibrateCamera and renders them as plain text.

Why does that deserve a node? Because the MATRIX and DIST_COEF types are private to this pack. Nothing else in ComfyUI understands them, and there's no built-in way to see what the calibration actually found. Turn them into strings and you can read the numbers, copy them, save them, or ship them somewhere the graph can't follow. The pack's example workflow wires both outputs into ShowText (the pysssss node), which is exactly the intended use: a floating readout of your calibration sitting on the canvas.

When you'd actually reach for it

  • Sanity-checking a calibration. A sane camera matrix has focal lengths that are close to each other and on the order of the image dimensions; a dist_coef vector full of absurd magnitudes means a bad solve. Reading raw numbers beats guessing from output quality.
  • Exporting the calibration out of ComfyUI. If you want to reuse the same lens correction in a standalone OpenCV script, a scanning app, or a photogrammetry tool that accepts camera intrinsics, this is your copy-paste escape hatch. The output is just numpy's str(), so it's human-readable and re-importable.
  • Logging a calibration to a file for reproducibility - the pack has no way to save anything on its own, so text is the only persistence it offers.

Inputs and outputs

Two required inputs: matrix (MATRIX) and dist_coef (DIST_COEF) - straight from the calibration node, or anywhere else in the pack that emits them. Two outputs: matrix_text and dist_coef_text, both STRING. No parameters, no settings, no surprises. Under the hood it's literally str(matrix) and str(dist_coef).

Install

It's not a separate install - all three nodes ship in the same pack. ComfyUI Manager → search "comfyui-undistort", or:

cd ComfyUI/custom_nodes
git clone https://github.com/iFREEGROUP/comfyui-undistort

then restart ComfyUI. requirements.txt is a single line, opencv-python, which your ComfyUI install almost certainly already provides.

The honest take

This is a five-line node that exists to make the pack's private data types inspectable. It won't fix your calibration - it'll just let you see it, and seeing is usually the step before fixing. If your undistorted output looks wrong, wire this in and look at the numbers before you touch anything else. In a pack this small, that's not a criticism; it's the difference between diagnosing a bad solve and guessing.

CategoryIG

Inputs (2)

NameTypeDefaultDescription
matrixMATRIX
dist_coefDIST_COEF

Outputs (2)

NameTypeDescription
matrix_textSTRING
dist_coef_textSTRING