fix(api-io): serialize MultiCombo multi_select as object config#13484
fix(api-io): serialize MultiCombo multi_select as object config#13484Kosinkadink wants to merge 5 commits intomasterfrom
Conversation
…rialization Amp-Thread-ID: https://ampcode.com/threads/T-019dad04-a07a-724b-af4d-fbfe98654fdd Co-authored-by: Amp <amp@ampcode.com>
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughMultiCombo.Input.as_dict() now emits a nested 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 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 |
…tent NODES_LIST Amp-Thread-ID: https://ampcode.com/threads/T-019dad04-a07a-724b-af4d-fbfe98654fdd Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dad04-a07a-724b-af4d-fbfe98654fdd Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@execution.py`:
- Around line 997-1002: The current validation treats any list-valued input
(val) as valid if all elements are in combo_options, which lets {"__value__":
["a","b"]} slip through for single-select combos; change the logic in the
MultiCombo validation to first check the combo's config/multi flag (e.g.,
combo_config.get("multi") or is_multi) and only perform per-element validation
when that flag is true—otherwise treat a list as an invalid whole value (use the
existing scalar-path check for non-multi combos). Ensure you update the branch
that computes invalid_vals (currently using val, combo_options, invalid_vals) to
enforce this multi-check so single-select combos reject list inputs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0b0f5c93-50d1-4481-ae68-e72bf9f2f5c2
📒 Files selected for processing (1)
execution.py
…age, add tests Amp-Thread-ID: https://ampcode.com/threads/T-019dad04-a07a-724b-af4d-fbfe98654fdd Co-authored-by: Amp <amp@ampcode.com>
Summary
Fix
MultiCombo.Input.as_dict()serialization somulti_selectis emitted as an object config instead of a boolean, and fix validation so MultiCombo list values are accepted.Based on #12662 by @Ni-zav with additional fixes:
if self.multiselect else Nonebranch (MultiComboalways setsself.multiselect = True)placeholder/chipkeys (frontend reads them frommulti_selectobject)comfy_entrypointand remove nonexistentNODES_LISTWhy
Frontend expects
multi_selectto be an object (z.object({ placeholder, chip })). When serialized as a boolean, MultiCombo is not recognized as multiselect. Additionally, prompt validation rejected MultiCombo values because it compared the entire list against the options instead of checking each selected value individually.Changes
comfy_api/latest/_io.py: Emitmulti_select: {}(or withplaceholder/chipwhen provided)execution.py: Handle list values in combo validation for MultiCombo inputsnodes.py: Fix misleading skip warning messagetests-unit/comfy_api_test/multicombo_serialization_test.py: Regression testsCloses #12662