ComfyUI Node

BK Housing Calc

Render a CSV into a table image

By JayLyu·Created 2 years ago·Updated about a year ago· 4
BK Housing Calc
  • csv
  • JSON
  • CSV
  • IMAGE
sort_by房屋总价,得房率
sort_direction正序

ComfyUI doesn't usually do spreadsheets. But this node - BK Housing Calc, from JayLyu's ComfyUI_Baikong_Buying pack - is exactly that: it takes a table of data, sorts it, and hands you three things at once: pretty JSON, a CSV string, and a rendered table image. No GPU, no model, no API key. It's the terminal node of a small, entirely Chinese-language pack that uses ComfyUI as a home-buying decision tool, and it's the part you'll actually want once the pack's other nodes have built you a list of properties.

What it does

BK_HousingCalc is an output node with one required input: csv, which expects the pack's own CSV socket type - a string of comma-separated table data. Feed it a CSV from BK Housing Info (the node that produces property rows) and it:

  1. parses the CSV into a pandas DataFrame, filling missing cells with "-",
  2. sorts it by whichever columns you name in sort_by (comma-separated, default 房屋总价,得房率 - "price, usable-area ratio"), in 正序 (ascending) or 倒序 (descending),
  3. emits the result three ways.

The three outputs tell you how this node thinks: JSON (a nicely indented STRING), CSV (a STRING you can write to a file or pipe into any text consumer), and IMAGE - the table drawn by matplotlib at 200 DPI using a bundled Alibaba Pu Hui Ti font, so Chinese column headers and values render correctly instead of as tofu boxes. That image is the shareable artifact: drag it out of a Preview Image node and you have a clean table graphic.

The two inputs that actually matter

  • sort_by - comma-separated column names to sort on. Multi-column sort works (房屋总价,得房率). Names that don't exist in the CSV are silently skipped with a console warning, so a typo won't crash anything, it'll just ignore that column.
  • sort_direction - 正序 (ascending) or 倒序 (descending), applied to all sort columns at once.

Everything else is automatic. This is a thin node - which is the point. It's the renderer at the end of the Baikong chain, not a tool you build workflows around.

Installing it

It ships with the whole pack, so the install is the pack install. ComfyUI Manager: search "ComfyUI_Baikong_Buying" and hit install, then restart. Or the manual way:

cd ComfyUI/custom_nodes
git clone https://github.com/JayLyu/ComfyUI_Baikong_Buying
# restart ComfyUI

Dependencies are torch, pandas, numpy, matplotlib, seaborn - torch and numpy are already in ComfyUI, so Manager just tops up pandas/matplotlib/seaborn, which most installs already have. There are no model files to download and no font to hunt down (the CJK font is bundled in fonts/). The whole pack is pure Python math.

Where people get tripped up

The interface is Chinese-only: input names, the enum choices, and every output label are in Chinese. The table image is language-agnostic once it's rendered, but you'll want a translation handy for the field names.

One quirk worth knowing: the pack's repo ships a web/show_table.js that would draw the result as a text widget inside the node, but WEB_DIRECTORY is commented out of __init__.py, so that extension never loads. Don't go looking for an in-node preview - the table comes back as the IMAGE socket, so hang a Preview Image node off it (or use a Show Text node for the CSV/JSON strings). The CSV socket type also only connects to other nodes in this pack, but since the same data is exposed as a plain STRING, any text-handling node can still consume it.

Category⭐️ Baikong

Inputs (3)

NameTypeDefaultDescription
csvCSV
sort_byoptSTRING房屋总价,得房率
sort_directionoptCOMBO正序2 options: 正序, 倒序

Outputs (3)

NameTypeDescription
JSONSTRING
CSVSTRING
IMAGEIMAGE