Skip to content

SDPose: resize fix#13656

Merged
comfyanonymous merged 3 commits intoComfy-Org:masterfrom
kijai:master
May 1, 2026
Merged

SDPose: resize fix#13656
comfyanonymous merged 3 commits intoComfy-Org:masterfrom
kijai:master

Conversation

@kijai
Copy link
Copy Markdown
Collaborator

@kijai kijai commented May 1, 2026

  • Fix model input orientation. head.heatmap_size follows MMPose's (W, H) convention, which was matched wrong for pytorch (H, W)

  • Switch resize from bilinear to area

  • Stretch resize instead of aspect ratio preserving pad, as the model is trained like that, gives expected accuracy on harder images.

Swap H and W
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

📝 Walkthrough

Walkthrough

In comfy_extras/nodes_sdpose.py the SDPose preprocessing was corrected: model_w is now taken from head.heatmap_size[0] and model_h from head.heatmap_size[1]. _resize_to_model was changed to stretch images to (model_h, model_w) and return separate horizontal/vertical scales (sx, sy). _remap_keypoints was updated to use scale_x/scale_y with x/y-only remapping. Call sites were adjusted for the new return values and signature. In CropByBBoxes, common_upscale was switched from bilinear to area for both resize paths.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'SDPose: resize fix' directly corresponds to the main changes: fixing SDPose keypoint extraction and switching from bilinear to area resizing.
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 pull request description directly addresses the changes made: fixing model input orientation (W, H vs H, W convention), switching from bilinear to area resize, and changing from aspect-ratio preserving pad to stretch resize.

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

alexisrolland
alexisrolland previously approved these changes May 1, 2026
@comfyanonymous comfyanonymous merged commit b5921c8 into Comfy-Org:master May 1, 2026
14 checks passed
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