INNER CODE UNIT · Python
check
gokayfem/ComfyUI-fal-API · nodes/billing_node.py:77
def check(self, force_refresh: bool = False) -> tuple[str, float]:
try:
balance = BillingUtils.get_balance(force=bool(force_refresh))
settings = SpendGuard.settings()
report = _build_report(balance, settings)
except Exception as err: # This node must never fail the graph.
logger.warning("FalBalance: could not build balance report: %s", err)
balance = None
report = f"fal account balance: unavailable ({err})\n{_UNAVAILABLE_HINT}"
return (report, float(balance) if balance is not None else -1.0)
NODE_CLASS_MAPPINGS = {
"FalBalance_fal": FalBalance,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"FalBalance_fal": "Fal Account Balance (fal)",