Skip to content

fix: Make ColorTransfer node ref_image mandatory (CORE-140)#13691

Merged
alexisrolland merged 2 commits intomasterfrom
alexis/fix-color-transfer
May 4, 2026
Merged

fix: Make ColorTransfer node ref_image mandatory (CORE-140)#13691
alexisrolland merged 2 commits intomasterfrom
alexis/fix-color-transfer

Conversation

@alexisrolland
Copy link
Copy Markdown
Member

The ColorTransfer node has a ref_image input which is optional but when it is not provided, the node triggers the error:

TypeError: ColorTransfer.execute() missing 1 required positional argument: 'image_ref'

  • This PR changes the ref_image input to be optional
  • Add a user friendly display name

Before:

{33001F17-1CD4-4099-B111-8FF9141BBD2D}

After:

{2E2DCBFB-F9D4-49F7-9AE4-7A247160A272}

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

📝 Walkthrough

Walkthrough

The ColorTransfer node schema in comfy_extras/nodes_post_processing.py was modified: the image_ref input is no longer optional and its tooltip was shortened to "Reference image(s) to match colors to." The order and definitions of the other inputs (image_target, method, source_stats, strength) were left unchanged.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title states the PR fixes a ColorTransfer error when ref_image is none, but the changes actually make ref_image mandatory, not optional. Update the title to accurately reflect that the change makes image_ref mandatory rather than optional, such as 'fix: Make ColorTransfer image_ref input mandatory to prevent missing argument error'.
Description check ⚠️ Warning The description describes the intent to make ref_image optional and fix the error, but the actual changes in the PR make ref_image mandatory by removing optional=True. Clarify the description to accurately explain that the fix makes image_ref a required input rather than optional, preventing the error when the argument is missing from the function call.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 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.

✏️ 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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
comfy_extras/nodes_post_processing.py (1)

841-842: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

image_ref is None is now unreachable dead code.

Since this PR removes optional=True from the image_ref input, the execution framework will always provide a tensor here. The image_ref is None branch can never be taken and should be cleaned up.

🧹 Proposed cleanup
-        if strength == 0 or image_ref is None:
+        if strength == 0:
             return io.NodeOutput(image_target)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@comfy_extras/nodes_post_processing.py` around lines 841 - 842, The condition
"image_ref is None" in the post-processing early-return is dead code now that
image_ref is always provided; in the function containing the line "if strength
== 0 or image_ref is None: return io.NodeOutput(image_target)" remove the "or
image_ref is None" check so the branch only checks strength (i.e., change to "if
strength == 0: return io.NodeOutput(image_target)"), and run/adjust any related
tests or callers expecting a possible None value for image_ref; keep references
to io.NodeOutput and image_target unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@comfy_extras/nodes_post_processing.py`:
- Around line 841-842: The condition "image_ref is None" in the post-processing
early-return is dead code now that image_ref is always provided; in the function
containing the line "if strength == 0 or image_ref is None: return
io.NodeOutput(image_target)" remove the "or image_ref is None" check so the
branch only checks strength (i.e., change to "if strength == 0: return
io.NodeOutput(image_target)"), and run/adjust any related tests or callers
expecting a possible None value for image_ref; keep references to io.NodeOutput
and image_target unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 31c5ea93-4eb8-4508-8020-612652e9b86c

📥 Commits

Reviewing files that changed from the base of the PR and between 3a42c40 and 29d5f61.

📒 Files selected for processing (1)
  • comfy_extras/nodes_post_processing.py

@alexisrolland
Copy link
Copy Markdown
Member Author

After discussing with @rattus128 we aligned that it would be preferable to make ref_image mandatory rather than having a no-op node behavior. Since the original node was broken anyway this shouldn't affect existing workflows.

@alexisrolland alexisrolland merged commit 5538f62 into master May 4, 2026
16 checks passed
@alexisrolland alexisrolland changed the title fix: Fix ColorTransfer node error message when ref_image is none fix: Make ColorTransfer node ref_image mandatory May 4, 2026
@alexisrolland alexisrolland changed the title fix: Make ColorTransfer node ref_image mandatory fix: Make ColorTransfer node ref_image mandatory (CORE-140) May 4, 2026
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.

3 participants