[Partner Nodes] feat: add Krea2 Image nodes#14130
Conversation
Signed-off-by: bigcat88 <bigcat88@icloud.com>
📝 WalkthroughWalkthroughThis PR adds a new Krea 2 image-generation module for ComfyAPI. The changes introduce two nodes: 🚥 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_krea.py`:
- Line 175: The prompt is currently validated with validate_string(prompt,
strip_whitespace=False, min_length=1) which accepts whitespace-only input;
update the logic to reject such prompts by trimming before validation or
enabling stripping—e.g., call prompt = prompt.strip() before validation or
change to validate_string(prompt, strip_whitespace=True, min_length=1)—so that
whitespace-only prompts are rejected before sending to Krea and downstream API
errors are avoided.
- Around line 190-197: The code assumes each entry in style_reference has "url"
and "strength" and will crash on malformed items; update the builder in
nodes_krea.py (the block that constructs image_style_references and uses
KreaImageStyleReference) to validate each item shape and types before creating
KreaImageStyleReference: ensure each item is a dict, contains "url" and
"strength", "url" is a non-empty string and "strength" can be converted to
float, and if any item fails validation raise a clear ValueError describing the
invalid item index and reason (and keep the existing max-10 check).
🪄 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: 4f54f56b-0ca7-49e9-954d-c126b8d67a23
⛔ Files ignored due to path filters (1)
comfy_api_nodes/apis/krea.pyis excluded by!comfy_api_nodes/apis/**
📒 Files selected for processing (1)
comfy_api_nodes/nodes_krea.py
New node for the Medium and Large endpoints: https://docs.krea.ai/api-reference/image/krea-2-medium
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms