Update MediaPipe nodes to standardize with existing code base (CORE-242)#14025
Conversation
📝 WalkthroughWalkthroughMediaPipe face detection nodes have been refactored to use a new 🚥 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: 1
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_mediapipe.py (1)
4-4:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate module docstring to reflect the renamed custom IO type.
The module docstring still references
FACE_LANDMARKERon line 4, but the custom IO type was renamed toFACE_DETECTION_MODEL(line 31). This inconsistency was introduced by this PR's changes.📝 Proposed fix
Custom IO types: - FACE_LANDMARKER — FaceLandmarkerModel wrapper (ModelPatcher inside) + FACE_DETECTION_MODEL — FaceLandmarkerModel wrapper (ModelPatcher inside) FACE_LANDMARKS — {"frames": List[List[face_dict]], "image_size": (H, W),🤖 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_extras/nodes_mediapipe.py` at line 4, Summary: module docstring still mentions FACE_LANDMARKER but the custom IO type was renamed to FACE_DETECTION_MODEL. Update the top-of-file docstring to replace the outdated symbol FACE_LANDMARKER with FACE_DETECTION_MODEL and ensure the descriptive text still reads correctly (e.g., "FaceLandmarkerModel wrapper (ModelPatcher inside)") so the docstring matches the renamed custom IO type used elsewhere in the module.
🤖 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_extras/nodes_rtdetr.py`:
- Line 81: The PR renamed the node output socket from out_image to image which
breaks existing workflows; restore backward compatibility by adding/keeping an
output socket named out_image (aliasing the same output as the new
io.Image.Output("image")) or revert the change to use
io.Image.Output("out_image") in the DrawBBoxes node so existing connections
continue to work; locate the DrawBBoxes node definition in
comfy_extras/nodes_rtdetr.py and either add a second output socket named
"out_image" that forwards the same value as "image" or rename the current
io.Image.Output("image") back to io.Image.Output("out_image") and, if keeping
both, document the alias and consider deprecation notes.
---
Outside diff comments:
In `@comfy_extras/nodes_mediapipe.py`:
- Line 4: Summary: module docstring still mentions FACE_LANDMARKER but the
custom IO type was renamed to FACE_DETECTION_MODEL. Update the top-of-file
docstring to replace the outdated symbol FACE_LANDMARKER with
FACE_DETECTION_MODEL and ensure the descriptive text still reads correctly
(e.g., "FaceLandmarkerModel wrapper (ModelPatcher inside)") so the docstring
matches the renamed custom IO type used elsewhere in the module.
🪄 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: b0633107-35ad-4680-a47e-a2b3da0d69ce
📒 Files selected for processing (2)
comfy_extras/nodes_mediapipe.pycomfy_extras/nodes_rtdetr.py
There was a problem hiding this comment.
🧹 Nitpick comments (1)
folder_paths.py (1)
63-63: ⚡ Quick winConsider adding backwards compatibility during migration period.
The folder mapping change from "mediapipe" to "detection" is a documented breaking change. For smoother user experience, you could temporarily support both folders by including the old path as a fallback (similar to how "controlnet" supports both "controlnet" and "t2i_adapter" on line 36).
Optional backwards-compatible approach
-folder_names_and_paths["detection"] = ([os.path.join(models_dir, "detection")], supported_pt_extensions) +folder_names_and_paths["detection"] = ([os.path.join(models_dir, "detection"), os.path.join(models_dir, "mediapipe")], supported_pt_extensions)This would allow models in the old "mediapipe" folder to continue working while encouraging migration to "detection" (which is checked first).
🤖 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 `@folder_paths.py` at line 63, Add backwards compatibility for the folder rename by mapping both "detection" and the old "mediapipe" to the same model path list: update the folder_names_and_paths entry for "detection" (the existing assignment that uses models_dir and supported_pt_extensions) to include os.path.join(models_dir, "mediapipe") as a fallback while keeping the "detection" path first; follow the same pattern used by the "controlnet"/"t2i_adapter" mapping so existing mediapipe models continue to load during migration.
🤖 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.
Nitpick comments:
In `@folder_paths.py`:
- Line 63: Add backwards compatibility for the folder rename by mapping both
"detection" and the old "mediapipe" to the same model path list: update the
folder_names_and_paths entry for "detection" (the existing assignment that uses
models_dir and supported_pt_extensions) to include os.path.join(models_dir,
"mediapipe") as a fallback while keeping the "detection" path first; follow the
same pattern used by the "controlnet"/"t2i_adapter" mapping so existing
mediapipe models continue to load during migration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0b51aeaa-1923-4fb5-b693-c89a67820f35
📒 Files selected for processing (2)
folder_paths.pymodels/detection/put_detection_models_here
|
This is breaking the "ONNX Detection Model Loader" node's detection of .onnx models in the /models/detection folder. However, there is an updated nodes.py that fixes the issue here: https://github.com/kijai/ComfyUI-WanAnimatePreprocess Not sure how other loaders will be affected. |
This PR updates the recently added MediaPipe nodes to standardize them with the code base. Note the change of folder name is a breaking change:
./models/mediapipeby./models/detection, this aligns with the detection folder introduced by the popular custom node: https://github.com/kijai/ComfyUI-WanAnimatePreprocess