BK Housing Decision
Should you actually buy that house? This node simulates your finances month by month
- 趋势图
- 结论
This is the node people install ComfyUI_Baikong_Buying for. BK Housing Decision doesn't touch a single pixel - it's a financial simulator that runs your household's income, mortgage, and savings month by month, for years into the future, and tells you whether buying beats renting-and-investing. In ComfyUI. Which is either the cleverest or the most unhinged use of a node graph you'll see this month, depending on your tolerance for 26 Chinese-named input widgets.
The pack is by JayLyu (GitHub alias "baikong"), it's built around China's homebuying mechanics - 公积金 (housing provident fund), 首付 (down payment), 等额本息 (equal principal-and-interest mortgages) - and this node is its heart.
How it actually works
Behind the widgets is a month-by-month loop over (剩余工作年限 + post-work years) × 12 months - the author assumes you earn for 剩余工作年限 more years, then hit an "unemployment point" (失业时点) where income stops and expenses drop to 60%. While working: your salary and provident fund grow at 工资年涨幅 yearly, expenses inflate at 通货膨胀率, and a year-end bonus lands every December. The fund pool earns 年化收益率/12 in interest each month.
On the property side it computes the down payment (房价 × 首付比例), splits the loan into a provident-fund portion (capped at min(公积金贷款额度, 房价 − 首付)) plus a commercial loan, and calculates the monthly payment with the standard amortization formula. You pay rent until 交房等待月份 (delivery), and if 未来是否卖出房产 is on, you sell at 交房等待月份 + 卖出月份 for 房价 × (1 + 房产增值率) and pay off the balance.
The smart part: it runs the same cash through a parallel "no-buy" fund pool - rent forever, invest the would-be down payment instead - so the final comparison isn't a vibe check, it's two numbers side by side. It also tracks your minimum pool balance (cashflow risk) and your worst post-unemployment monthly surplus.
The inputs that matter
All 26 are required-with-defaults, but a beginner really needs these:
初始资金池/月收入/月开销/剩余工作年限- your starting cash and current cashflow, and how many more years you'll earn. This last one drives the whole unemployment sub-scenario; set it to your actual horizon or the advice lines about unemployment are meaningless.房价/首付比例/房贷年限- the property and the loan term.未来是否卖出房产+卖出月份+房产增值率- flip the toggle off to model holding forever, or set how and when you'd exit.地区月供收入比上限- your region's debt-to-income cap as a percentage (50 = 50%); the node compares your computed 月供收入比 against it.
Everything monetary is in yuan, rates and ratios are decimals (0.05 = 5%), and the whole UI is Chinese.
What you get out
Two outputs: 趋势图 (IMAGE) and 结论 (STRING). The chart is a two-panel seaborn figure - top panel plots your buying fund pool, the no-buy pool, and the mortgage balance over time with red/green/magenta vertical lines at the unemployment, delivery, and sale points; bottom panel plots monthly income vs. spending. The conclusion is a Chinese report: 房价收入比, down-payment %, 月供收入比, the buy-vs-no-buy final pool difference in 万元, then nine numbered recommendations covering price pressure, unemployment risk, cashflow warnings, and sale profit.
The honest take
This is a deterministic what-if calculator, not a prophecy. The output swings hard on two assumptions - 房产增值率 and 地区房价增长预期 - which nobody can actually know in advance. Use it to stress-test scenarios (what if the region cools? what if I lose my job at month 36?), not to pick a house. Think of the chart as the payoff: watching the two pools diverge is genuinely the clearest way this tool tells its story.
Installing
Same pack, same one-time install - ComfyUI Manager, search "ComfyUI_Baikong_Buying", restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/JayLyu/ComfyUI_Baikong_Buying
Dependencies are torch, pandas, numpy, matplotlib, seaborn (all pip-managed by Manager; nothing exotic). No models, no weights, no API keys, no network - the entire "AI" here is numpy math and a two-panel chart. The only real gotcha beyond the Chinese labels is that a fresh graph defaults to a demo scenario (a ¥2.5M apartment with ¥1M saved up), so change every field before trusting any advice - or you'll be deciding on a stranger's mortgage.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| 初始资金池 | INT | 10000000–99999999999 | — |
| 房价 | INT | 25000000–99999999999 | — |
| 首付比例 | FLOAT | 0.300–1 | — |
| 交房等待月份 | INT | 240–100 | — |
| 房贷年限 | INT | 200–100 | — |
| 公积金贷款额度 | INT | 6000000–99999999999 | — |
| 公积金贷款利率 | FLOAT | 0.02850–1 | — |
| 商业贷款利率 | FLOAT | 0.02900–1 | — |
| 未来是否卖出房产 | BOOLEAN | true | — |
| 卖出月份 | INT | 84 | — |
| 房产增值率 | FLOAT | 0.20-1–10 | — |
| 月开销 | INT | 50000–99999999999 | — |
| 租房费用 | INT | 50000–99999999999 | — |
| 月收入 | INT | 150000–99999999999 | — |
| 工资年涨幅 | FLOAT | 0.050–1 | — |
| 公积金 | INT | 50000–99999999999 | — |
| 年终奖 | INT | 500000–99999999999 | — |
| 剩余工作年限 | INT | 30–100 | — |
| 年化收益率 | FLOAT | 0.020–1 | — |
| 通货膨胀率 | FLOAT | 0.0050–1 | — |
| 地区房价指数 | FLOAT | 1.000–10 | — |
| 地区首付比例要求 | FLOAT | 0.150–1 | — |
| 地区月供收入比上限 | FLOAT | 50.00–100 | — |
| 地区房价增长预期 | FLOAT | 0.05-1–1 | — |
| 地区失业率 | FLOAT | 0.050–1 | — |
| 地区经济增长预期 | FLOAT | 0.03-1–1 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 趋势图 | IMAGE | — |
| 结论 | STRING | — |