Commit Graph
16 Commits
Author SHA1 Message Date
科林_Cyril Pilgrim 26ed2a055c fix(ui): move token usage display below the node's bottom boundary to prevent overlapping with existing bottom widgets 2026-03-01 17:04:41 +08:00
科林_Cyril Pilgrim 7ec2e455cb feat(ui): migrate token display to native canvas rendering on the right side to completely avoid widget serialization issues 2026-03-01 16:16:08 +08:00
科林_Cyril Pilgrim bfecfe5f81 style(ui): increase token display widget height for better readability 2026-03-01 16:06:42 +08:00
科林_Cyril Pilgrim 162d65e239 fix(ui): prevent dynamically added token display widget from corrupting node parameter serialization indices 2026-03-01 14:36:39 +08:00
科林_Cyril Pilgrim fe9a0a1721 fix(openai-adapter): resolve HTTP 403, token display, and provider routing bugs
Motivation:
- WAF拦截:urllib默认User-Agent被API网关识别为爬虫,触发1010/403
- Token显示失效:前端JS import路径层级错误、缺少OUTPUT_NODE声明
- Provider路由错误:用base_url匹配ProviderRegistry导致适配逻辑永远失效

Implementation:
- 添加浏览器User-Agent到HTTP请求头,绕过WAF反爬拦截
- 修复display_tokens.js import路径(../../→../../../),改用find-or-create widget策略
- 添加OUTPUT_NODE=True,对齐ComfyUI UI反馈节点标准
- 修正provider查找逻辑:用provider_name匹配配置,用base_url发起API调用
- max_tokens默认值从512调整为2048
2026-02-28 10:43:25 +08:00
科林_Cyril Pilgrim 73fdbf6ac0 fix(ui): use ComfyWidgets for token display compatibility 2026-02-28 00:14:24 +08:00
科林_Cyril Pilgrim 52b8e5e68a feat(ui): display Token Usage directly on nodes & enhance request size logs 2026-02-28 00:04:04 +08:00
科林_Cyril Pilgrim a4ffc158eb refactor(json-builder): simplify to multiline keys + fixed value inputs
BREAKING CHANGE: Removed dynamic input_count approach entirely

New design:
- keys: multiline text box (one key name per line)
- value_1 ~ value_10: fixed input slots
- Line 1 → value_1, Line 2 → value_2, etc.

Removed frontend JS - no dynamic widgets needed.
This is the most reliable approach since ComfyUI doesn't
support dynamic widget value passing to backend.
2026-02-09 23:30:01 +08:00
科林_Cyril Pilgrim 14c7290a1e feat(json-builder): pure text widgets for keys with custom serialization
Implementation:
- Keys: addWidget('text') with custom serializeValue()
- Values: addInput() for connection slots
- onSerialize: saves dynamic key widget values to node properties
- onConfigure: restores key widgets on workflow load

This allows keys to be pure editable text boxes (not forceInput)
while still being properly serialized and restored.
2026-02-09 23:22:28 +08:00
科林_Cyril Pilgrim 4f9f0581a6 fix(json-builder): rewrite to use proper inputs for dynamic key/value pairs
BREAKING CHANGE: Keys now use forceInput=False (can type OR connect)
- Backend: key_N uses forceInput=False, value_N uses forceInput=True
- Frontend: dynamically adds both as proper inputs (not widgets)
- This ensures ComfyUI correctly serializes dynamic inputs
- Fixes issue where dynamically added keys were not being loaded
2026-02-09 23:14:29 +08:00
科林_Cyril Pilgrim 02cdce34ac style(json-builder): premium styled Update button with gradient design
- Custom draw function for button rendering
- Blue gradient background (#3a6ea5 → #2c5282)
- Rounded corners (6px radius)
- Subtle border and top highlight
- Icon prefix (⟳) for visual appeal
- Follows Google Material Design principles
2026-02-09 23:11:00 +08:00
科林_Cyril Pilgrim d8aee2746a style(json-builder): rename inputcount to input_count, reposition Update button
- Renamed inputcount to input_count for better readability
- Moved Update inputs button to appear right after input_count widget
2026-02-09 23:07:00 +08:00
科林_Cyril Pilgrim 6f349c948d fix(json-builder): remove base_json, make keys manual text inputs
Changes:
- Removed unnecessary base_json parameter
- Keys are now editable text widgets (not forceInput)
- Values remain as input slots for upstream connections
- Frontend JS updated to add text widgets for keys
2026-02-09 23:02:50 +08:00
科林_Cyril Pilgrim 87d9d055e3 feat(json): add frontend JS for dynamic input count refresh
- Created web/js/json_builder.js with Update inputs button handler
- Dynamically adds/removes key_N and value_N input pairs
- Pattern follows KJNodes JoinStringMulti implementation exactly

User can now:
1. Change inputcount value
2. Click Update inputs button
3. Frontend dynamically updates input slots
2026-02-09 22:57:25 +08:00
科林_Cyril Pilgrim 3ab84dbdd3 push 2025-01-30 00:52:30 +08:00
科林_Cyril Pilgrim 91e16cd3a2 push 2025-01-30 00:32:58 +08:00