Fix blur and sharpen nodes not working with fp16 intermediates.#13181
Fix blur and sharpen nodes not working with fp16 intermediates.#13181comfyanonymous merged 1 commit intomasterfrom
Conversation
📝 WalkthroughWalkthroughThis pull request updates the Gaussian kernel generation function to accept and respect a dtype parameter, ensuring blur and sharpen post-processing operations use kernels matching the input image's data type. The 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 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.
🧹 Nitpick comments (1)
comfy_extras/nodes_post_processing.py (1)
203-204: Remove the now-redundant kernel cast inSharpen.execute.Since Line 203 already requests
dtype=image.dtypefromgaussian_kernel, Line 204 can be dropped for clarity.♻️ Suggested cleanup
- kernel = gaussian_kernel(kernel_size, sigma, device=image.device, dtype=image.dtype) * -(alpha*10) - kernel = kernel.to(dtype=image.dtype) + kernel = gaussian_kernel(kernel_size, sigma, device=image.device, dtype=image.dtype) * -(alpha*10)🤖 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 203 - 204, In Sharpen.execute, remove the redundant kernel.astype/cast line: since gaussian_kernel is already called with dtype=image.dtype (kernel = gaussian_kernel(kernel_size, sigma, device=image.device, dtype=image.dtype) * -(alpha*10)), delete the subsequent kernel = kernel.to(dtype=image.dtype) statement so the kernel variable is not unnecessarily re-cast.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@comfy_extras/nodes_post_processing.py`:
- Around line 203-204: In Sharpen.execute, remove the redundant
kernel.astype/cast line: since gaussian_kernel is already called with
dtype=image.dtype (kernel = gaussian_kernel(kernel_size, sigma,
device=image.device, dtype=image.dtype) * -(alpha*10)), delete the subsequent
kernel = kernel.to(dtype=image.dtype) statement so the kernel variable is not
unnecessarily re-cast.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7a6f9b4d-5565-4948-aad2-6cecda1a407f
📒 Files selected for processing (1)
comfy_extras/nodes_post_processing.py
No description provided.