feat: Add RemoteComboOptions for rich remote-populated combo inputs#13432
feat: Add RemoteComboOptions for rich remote-populated combo inputs#13432
Conversation
Signed-off-by: bigcat88 <bigcat88@icloud.com>
11be773 to
fdf9290
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis pull request introduces structured configuration support for remote combo widgets. Two new classes— 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adds a new way to populate combo inputs from a remote endpoint with image/video/audio previews, per-field search, and progressive pagination. Aimed at API nodes where the set of choices is dynamic and too large to hardcode, like ElevenLabs voice libraries (11K+ community voices with audio samples), Kling element libraries, or user-trained profile lists.
The existing
remote=RemoteOptions(...)path only gives you a flat list of strings in a standard dropdown; the newremote_combo=RemoteComboOptions(...)adds the rich widget on top.The surface is two new classes in
comfy_api/latest/_io.py:RemoteItemSchemadescribes how to map each raw API response object to a dropdown item. All fields use dot-path notation (labels.gender,task_result.elements.0.name).label_fieldanddescription_fieldadditionally accept template strings with{field}placeholders, so you can build composite labels without a helper endpoint.RemoteComboOptionsis the widget spec you hand toCombo.Input(remote_combo=...). It takes aroute, theitem_schema, and optional knobs:page_sizefor progressive pagination,refreshfor client-side cache TTL,use_comfy_apito route through the comfy-api proxy with auth,auto_selectfor fallback selection,response_keyfor responses that wrap the array under a key, andtimeout/max_retriesfor network tuning.Two response shapes are supported. Without
page_size, the endpoint returns an array, or an array atresponse_key. Withpage_size, it returns{"items": [...], "has_more": bool}and the frontend fetches page by page asGET <route>?page=N&page_size=M, starting at page 0. Endpoints that use cursor tokens, 1-based pages, or limit/offset need a small shim.When
use_comfy_api=True, the frontend prepends the configured comfy-api base URL torouteand injects auth headers. When it'sFalse, the route is used as-is with no auth.PR to Frontend repo: Comfy-Org/ComfyUI_frontend#11310
Temporary PR with new API Nodes to test current PR: #13433