[Partner Nodes] add ByteDance Seed LLM node#13919
Conversation
Signed-off-by: bigcat88 <bigcat88@icloud.com>
📝 WalkthroughWalkthroughThis PR adds a new ByteDance Seed 2.0 text generation node to ComfyUI. The module defines model metadata and API configuration, implements dynamic input UI for multimodal context (images and videos), and builds the request to the BytePlus endpoint with token-based pricing calculation. The execute method validates inputs, constructs content blocks from uploaded media, calls the remote API, validates responses for errors and refusals, extracts assistant text, and returns the result. An extension class registers the node for loading. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@comfy_api_nodes/nodes_bytedance_llm.py`:
- Around line 223-225: The code directly indexes model["model"] and
model["temperature"] and then looks up SEED_MODELS[model_label], which can raise
KeyError on malformed payloads; update the logic in the handler that uses
model_label/temperature (the variables model_label, temperature, model_id and
the SEED_MODELS lookup) to first validate that the keys "model" and
"temperature" exist in the incoming model dict and that model_label is present
in SEED_MODELS, and if any check fails raise a clear ValueError (e.g. "missing
'model' key" or "unsupported model: <label>") so downstream error handling is
predictable.
- Around line 193-201: The PriceBadge token-rate literals for the "mini" and
"lite" branches are out of sync with the runtime constant
_SEED_PRICES_PER_MILLION; update these hardcoded usd arrays (the branch that
produces "type": "list_usd") to derive per-1K-token values from
_SEED_PRICES_PER_MILLION instead of using the current literals so UI hints match
runtime pricing. Locate the conditional branches that check $contains($m,
"mini") and $contains($m, "lite") in comfy_api_nodes/nodes_bytedance_llm.py and
replace the fixed usd arrays with values computed from _SEED_PRICES_PER_MILLION
(divide the per-million price by 1000) for both lower and upper bounds, keeping
the existing format object intact.
🪄 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: 4efb8427-38c8-45be-95d9-fd9691205b4a
⛔ Files ignored due to path filters (1)
comfy_api_nodes/apis/bytedance_llm.pyis excluded by!comfy_api_nodes/apis/**
📒 Files selected for processing (1)
comfy_api_nodes/nodes_bytedance_llm.py
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms