Skip to content

ComfyUI backport release v0.22.3#14141

Closed
Kosinkadink wants to merge 9 commits into
masterfrom
backport/v0.22.3-krea2
Closed

ComfyUI backport release v0.22.3#14141
Kosinkadink wants to merge 9 commits into
masterfrom
backport/v0.22.3-krea2

Conversation

@Kosinkadink
Copy link
Copy Markdown
Member

@Kosinkadink Kosinkadink commented May 27, 2026

Backport for v0.22.3. Cherry-picks:

API Node PR Checklist

Scope

  • Is API Node Change

Pricing & Billing

  • Need pricing update
  • No pricing update

If Need pricing update:

  • Metronome rate cards updated
  • Auto‑billing tests updated and passing

QA

  • QA done
  • QA not required

Comms

  • Informed Kosinkadink

bigcat88 and others added 9 commits May 21, 2026 15:39
* [Partner Nodes] add reasoning widget to Anthropic node

Signed-off-by: bigcat88 <bigcat88@icloud.com>

* [Partner Nodes] add new OpenRouterLLM node

Signed-off-by: bigcat88 <bigcat88@icloud.com>

* [Partner Nodes] fix passing images to Grok LLM

Signed-off-by: bigcat88 <bigcat88@icloud.com>

---------

Signed-off-by: bigcat88 <bigcat88@icloud.com>
…Reference node (#14032)

Signed-off-by: bigcat88 <bigcat88@icloud.com>
* [Partner Nodes] add new Rodin2.5 nodes

Signed-off-by: bigcat88 <bigcat88@icloud.com>

* [Partner Nodes] fixed Quality Mesh Options

Signed-off-by: bigcat88 <bigcat88@icloud.com>

* [Partner Nodes] fix: remove non-supported "usdz"

Signed-off-by: bigcat88 <bigcat88@icloud.com>

* [Partner Nodes] fix: always pass seed to server

Signed-off-by: bigcat88 <bigcat88@icloud.com>

* [Partner Nodes] fix: set the default "material" value to "Shaded"

Signed-off-by: bigcat88 <bigcat88@icloud.com>

---------

Signed-off-by: bigcat88 <bigcat88@icloud.com>
… 2 (#14098)

* [Partner Nodes] feat: improve video references uploading for SeeDance 2

Signed-off-by: bigcat88 <bigcat88@icloud.com>

* [Partner Nodes] hash video via memoryview to avoid memory copy

Signed-off-by: bigcat88 <bigcat88@icloud.com>

---------

Signed-off-by: bigcat88 <bigcat88@icloud.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces three new LLM/3D-generation node modules (Krea2 image generation, OpenRouter chat completions, and Rodin Gen-2.5 support), adds Claude thinking behavior with per-model configuration, refactors video resizing utilities to support both downscaling and upscaling, integrates the new utilities into ByteDance Seedance with virtual-library asset uploads, and bumps package versions to 0.22.2. The changes span infrastructure (video handling), feature additions (LLM nodes, 3D generation), and utility updates (quality-mode lookup tables, response validation).

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.40% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ⚠️ Warning The title states 'v0.22.3' but the actual version changes in the PR are to '0.22.2' (comfyui_version.py and pyproject.toml), not '0.22.3'. Update the title to reflect the actual version being released, such as 'ComfyUI backport release v0.22.2' to match the version bumps in comfyui_version.py and pyproject.toml.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description clearly identifies it as a backport for v0.22.3 and lists three specific cherry-picked commits with their purposes, directly corresponding to the changeset modifications.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_anthropic.py`:
- Around line 268-270: Validate the incoming reasoning_effort before indexing
_REASONING_BUDGET: check if reasoning_effort is a key in _REASONING_BUDGET and
if not raise a clear validation error (e.g., ValueError or a
NodeValidationError) with a message like "Invalid reasoning_effort: <value>";
only after that perform budget = _REASONING_BUDGET[reasoning_effort], apply the
min(...) cap, and construct AnthropicThinkingConfig as before (references:
_REASONING_BUDGET, reasoning_effort, AnthropicThinkingConfig, thinking_cfg).

In `@comfy_api_nodes/nodes_rodin.py`:
- Around line 581-588: The list comprehension that builds files opens file
handles via open(image, "rb") without closing them, causing a resource leak;
replace the comprehension with logic that uses a helper (e.g., _open_image_file)
to open string paths, append those open file objects to a local list, and ensure
all opened file handles are closed in a finally block after the upload/usage
completes; keep using tensor_to_filelike(image) for non-string inputs and
reference/modify the variable files and the helper _open_image_file so every
file opened is explicitly closed even on exceptions.
🪄 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: 7d9f3154-dfe0-43ad-a5f7-5f0c534e2091

📥 Commits

Reviewing files that changed from the base of the PR and between 175e854 and 0cc5934.

⛔ Files ignored due to path filters (5)
  • comfy_api_nodes/apis/anthropic.py is excluded by !comfy_api_nodes/apis/**
  • comfy_api_nodes/apis/bytedance.py is excluded by !comfy_api_nodes/apis/**
  • comfy_api_nodes/apis/krea.py is excluded by !comfy_api_nodes/apis/**
  • comfy_api_nodes/apis/openrouter.py is excluded by !comfy_api_nodes/apis/**
  • comfy_api_nodes/apis/rodin.py is excluded by !comfy_api_nodes/apis/**
📒 Files selected for processing (10)
  • comfy_api_nodes/nodes_anthropic.py
  • comfy_api_nodes/nodes_bytedance.py
  • comfy_api_nodes/nodes_krea.py
  • comfy_api_nodes/nodes_openrouter.py
  • comfy_api_nodes/nodes_rodin.py
  • comfy_api_nodes/util/__init__.py
  • comfy_api_nodes/util/conversions.py
  • comfyui_version.py
  • pyproject.toml
  • requirements.txt

Comment on lines +268 to +270
budget = _REASONING_BUDGET[reasoning_effort]
budget = min(budget, max(1024, max_tokens - 1024))
thinking_cfg = AnthropicThinkingConfig(type="enabled", budget_tokens=budget)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Guard reasoning_effort before budget lookup.

_REASONING_BUDGET[reasoning_effort] can throw a KeyError if the incoming model payload is malformed (e.g., edited workflow JSON). Please fail with a clear validation error instead of an unhandled exception.

Suggested fix
-                budget = _REASONING_BUDGET[reasoning_effort]
+                budget = _REASONING_BUDGET.get(reasoning_effort)
+                if budget is None:
+                    raise ValueError(f"Invalid reasoning_effort: {reasoning_effort!r}")
                 budget = min(budget, max(1024, max_tokens - 1024))
                 thinking_cfg = AnthropicThinkingConfig(type="enabled", budget_tokens=budget)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
budget = _REASONING_BUDGET[reasoning_effort]
budget = min(budget, max(1024, max_tokens - 1024))
thinking_cfg = AnthropicThinkingConfig(type="enabled", budget_tokens=budget)
budget = _REASONING_BUDGET.get(reasoning_effort)
if budget is None:
raise ValueError(f"Invalid reasoning_effort: {reasoning_effort!r}")
budget = min(budget, max(1024, max_tokens - 1024))
thinking_cfg = AnthropicThinkingConfig(type="enabled", budget_tokens=budget)
🤖 Prompt for 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.

In `@comfy_api_nodes/nodes_anthropic.py` around lines 268 - 270, Validate the
incoming reasoning_effort before indexing _REASONING_BUDGET: check if
reasoning_effort is a key in _REASONING_BUDGET and if not raise a clear
validation error (e.g., ValueError or a NodeValidationError) with a message like
"Invalid reasoning_effort: <value>"; only after that perform budget =
_REASONING_BUDGET[reasoning_effort], apply the min(...) cap, and construct
AnthropicThinkingConfig as before (references: _REASONING_BUDGET,
reasoning_effort, AnthropicThinkingConfig, thinking_cfg).

Comment on lines +581 to +588
files = [
(
"images",
open(image, "rb") if isinstance(image, str) else tensor_to_filelike(image),
)
for image in images
if image is not None
]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Resource leak: file handles opened without context manager.

When isinstance(image, str) is True, open(image, "rb") creates a file handle that's never explicitly closed. This can exhaust file descriptors under heavy use.

Proposed fix using a helper to manage file lifecycle

A minimal fix is to restructure so the files list is built with proper cleanup. One approach:

+    file_handles = []
+    try:
         files = None
         if images:
             files = [
                 (
                     "images",
-                    open(image, "rb") if isinstance(image, str) else tensor_to_filelike(image),
+                    _open_image_file(image, file_handles),
                 )
                 for image in images
                 if image is not None
             ]
 
         response = await sync_op(
             ...
         )
+    finally:
+        for fh in file_handles:
+            fh.close()

Where _open_image_file appends file handles to the list for later cleanup.

🤖 Prompt for 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.

In `@comfy_api_nodes/nodes_rodin.py` around lines 581 - 588, The list
comprehension that builds files opens file handles via open(image, "rb") without
closing them, causing a resource leak; replace the comprehension with logic that
uses a helper (e.g., _open_image_file) to open string paths, append those open
file objects to a local list, and ensure all opened file handles are closed in a
finally block after the upload/usage completes; keep using
tensor_to_filelike(image) for non-string inputs and reference/modify the
variable files and the helper _open_image_file so every file opened is
explicitly closed even on exceptions.

@Kosinkadink Kosinkadink changed the title ComfyUI backport release v0.22.3 (patch version bump) ComfyUI backport release v0.22.3 May 27, 2026
@comfy-fennec-girl comfy-fennec-girl Bot deleted the backport/v0.22.3-krea2 branch May 27, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants