ComfyUI Extension: ComfyUI Credit Tracker
Simple UI extension to track Modal GPU credits in real-time.
Custom Nodes (0)
README
š° ComfyUI Credit Tracker
Simple UI extension to track Modal GPU credits in real-time.
šø Preview
Displays a simple $80.00 button in the header bar that updates every second.
⨠Features
- šµ Simple dollar amount display in header
- ā” Real-time tracking (updates per second)
- š¾ Persistent across restarts
- š® Auto GPU detection
- š Click to view details
- šØ Color-coded: Green (>50%), Yellow (20-50%), Red (<20%)
š¦ Installation
Quick Install
cd ComfyUI/custom_nodes/
git clone https://github.com/yourusername/ComfyUI-ModalCredits.git
Restart ComfyUI.
Manual Install
- Create folder:
cd ComfyUI/custom_nodes/
mkdir ComfyUI-ModalCredits
cd ComfyUI-ModalCredits
mkdir js
-
Copy files:
__init__.py(root)config.json(root)js/creditTracker.js(in js folder)
-
Restart ComfyUI
āļø Configuration
Edit config.json to set your GPU costs:
{
"starting_balance": 80.00,
"gpu_costs_per_hour": {
"NVIDIA H100": 3.95,
"NVIDIA A100-SXM4-80GB": 2.50,
"NVIDIA A100-SXM4-40GB": 2.10,
"NVIDIA A10G": 1.10,
"Tesla T4": 0.59
},
"gpu_count": 1
}
š Usage
- Start ComfyUI - The credit display appears in the header automatically
- View balance - See remaining credits (e.g.,
$79.50) - Click for details - Shows GPU type, cost/hour, time remaining
- Color changes - Green ā Yellow ā Red as credits decrease
š¾ Data Storage
Balance is saved to balance.json in the extension folder:
{
"last_updated": "2025-10-21T12:00:00Z",
"remaining_balance": 75.40
}
š Reset Balance
API Method:
curl -X POST http://localhost:8188/credit_tracker/reset
Manual Method:
Delete balance.json and restart ComfyUI.
š File Structure
ComfyUI-ModalCredits/
āāā __init__.py # Backend API
āāā config.json # GPU costs configuration
āāā balance.json # Auto-generated balance file
āāā js/
ā āāā creditTracker.js # Frontend UI
āāā README.md
š§ API Endpoints
GET /credit_tracker/config- Get configurationGET /credit_tracker/balance- Get current balancePOST /credit_tracker/balance- Update balanceGET /credit_tracker/gpu_info- Get GPU informationPOST /credit_tracker/reset- Reset to starting balance
š ļø Troubleshooting
Display not showing?
- Clear browser cache (Ctrl+Shift+R)
- Check browser console (F12) for errors
- Verify files are in correct locations
- Restart ComfyUI completely
Wrong GPU detected?
- Check
nvidia-smicommand works - Manually edit GPU name in
config.json - Add your GPU model to the cost list
Balance not saving?
- Check write permissions on folder
- Look for
balance.jsonfile - Check server console for errors
š” Tips
- Update
config.jsoncosts to match your Modal pricing - Click the display to see detailed breakdown
- Balance auto-saves every 10 seconds
- Color changes warn when credits are low
š License
MIT License - Free to use and modify
š¤ Contributing
Issues and PRs welcome!
Made for the ComfyUI community ā¤ļø