Skip to content

Update MediaPipe nodes to standardize with existing code base (CORE-242)#14025

Merged
alexisrolland merged 7 commits into
masterfrom
alexis/mediapipe
May 21, 2026
Merged

Update MediaPipe nodes to standardize with existing code base (CORE-242)#14025
alexisrolland merged 7 commits into
masterfrom
alexis/mediapipe

Conversation

@alexisrolland

@alexisrolland alexisrolland commented May 21, 2026

Copy link
Copy Markdown
Member

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:

  • Replace ./models/mediapipe by ./models/detection, this aligns with the detection folder introduced by the popular custom node: https://github.com/kijai/ComfyUI-WanAnimatePreprocess
  • Rename "Face Landmarker" to a more generic "Face Detection Model" for future reuse with other face detection tasks.
  • Add search aliases
  • Add descriptions
  • Update node titles
    • "Load MediaPipe Face Landmarker" -> "Load Face Detection Model (MediaPipe)" for a more generic and reusable name if we want to introduce other face detection models.
    • "MediaPipe Face Landmarker" -> "Detect Face Landmarks (MediaPipe)", verb first
    • "MediaPipe Face Mesh Visualize" -> "Visualize Face Landmarks (MediaPipe)", verb first, remove "mesh" which can be confusing with 3D concepts
    • "MediaPipe Face Mask" -> "Draw Face Mask (MediaPipe)"
{7DE20EE7-726A-4445-B8E4-D332728F2EE8}
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

MediaPipe face detection nodes have been refactored to use a new FaceDetectionType custom IO payload, replacing the previous FaceLandmarkerType. The model folder configuration now includes a "detection/" directory mapping. The loader node outputs the new type after loading weights from that directory. The main detection node accepts the new payload type, calls detect_batch() on it, and exposes connection_sets to downstream visualization and mask nodes. Node metadata for visualization and mask nodes has been updated without functional changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately reflects the main objective: standardizing recently added MediaPipe nodes with the codebase, as evidenced by folder renaming, type renaming, metadata updates, and node title changes.
Description check ✅ Passed The description clearly explains all changes including the breaking folder rename, type renaming from Face Landmarker to Face Detection Model, and the specific node title updates, directly matching the changeset.
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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 win

Update module docstring to reflect the renamed custom IO type.

The module docstring still references FACE_LANDMARKER on line 4, but the custom IO type was renamed to FACE_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

📥 Commits

Reviewing files that changed from the base of the PR and between 95fdc6c and 5208356.

📒 Files selected for processing (2)
  • comfy_extras/nodes_mediapipe.py
  • comfy_extras/nodes_rtdetr.py
Comment thread comfy_extras/nodes_rtdetr.py Outdated
@alexisrolland alexisrolland changed the title Update MediaPipe nodes to standardize with existing code base May 21, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
folder_paths.py (1)

63-63: ⚡ Quick win

Consider 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5208356 and d07a24b.

📒 Files selected for processing (2)
  • folder_paths.py
  • models/detection/put_detection_models_here
@alexisrolland alexisrolland merged commit 7b7c5fe into master May 21, 2026
16 checks passed
@alexisrolland alexisrolland deleted the alexis/mediapipe branch May 21, 2026 10:51
simonri pushed a commit to simonri/ComfyUI-flash-attention-3 that referenced this pull request May 26, 2026
@essence25

essence25 commented Jun 3, 2026

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants