Update mascot pose model URLs

This commit is contained in:
grmchn
2026-05-03 01:35:01 +09:00
parent 6cc0d36dbe
commit d3d8dc648b
11 changed files with 87 additions and 75 deletions
+11 -11
View File
@@ -4,27 +4,27 @@
> **Note**: This README was automatically generated using [Claude Code](https://claude.ai/code) AI-assisted development tools.
This custom node is created by decomposing and porting the WanVideo UniAnimate DWPose Detector node from [kijai's ComfyUI-WanVideoWrapper](https://github.com/kijai/ComfyUI-WanVideoWrapper). The key difference is that instead of using image inputs, it now accepts DWPose KeyPoint data as input, enabling manipulation of body types that cannot be estimated by DWPose alone.
This custom node is created by decomposing and porting the WanVideo UniAnimate pose detector node from [kijai's ComfyUI-WanVideoWrapper](https://github.com/kijai/ComfyUI-WanVideoWrapper). The key difference is that instead of using image inputs, it now accepts KeyPoint data as input, enabling manipulation of body types that cannot be estimated by the pose detector alone.
Additionally, the Openpose Editor node from [toyxyz/ComfyUI-ultimate-openpose-editor](https://github.com/toyxyz/ComfyUI-ultimate-openpose-editor) has been similarly decomposed and ported, enabling fine-tuning of individual parts.
## Features
### Node Overview
- **ProportionChanger DWPose Detector**: Detects DWPose KeyPoints from images
- **ProportionChanger Pose Detector**: Detects KeyPoints from images
- **ProportionChanger Reference**: Transforms proportions to reference poses
- **ProportionChanger DWPose Render**: Converts KeyPoints to images
- **ProportionChanger Pose Render**: Converts KeyPoints to images
- **ProportionChanger Params**: Adjusts parameters for individual KeyPoint parts
- **ProportionChanger Interpolator**: Interpolates KeyPoint videos with in-betweening
- **PoseData to pose_keypoint**: Converts WanAnimate `POSEDATA` into `POSE_KEYPOINT`
- **pose_keypoint resize**: Resizes `POSE_KEYPOINT` to a target size (pads then scales to avoid stretching when aspect differs)
- **pose_keypoint input**: Converts JSON text to KeyPoints
- **pose_keypoint preview**: Converts KeyPoints to JSON
- **(Down)Load Mascot DWPose Model**: Downloads and loads a mascot DWPose ONNX model from HuggingFace
- **(Down)Load Mascot Pose Model**: Downloads and loads a mascot pose ONNX model from HuggingFace
- **(Down)Load Mascot BBox Model**: Downloads and loads a mascot bbox ONNX model from HuggingFace
- **Mascot DWPose Detector**: Detects mascot body pose as `POSE_KEYPOINT`
- **Mascot Pose Detector**: Detects mascot body pose as `POSE_KEYPOINT`
- **Mascot BBox Detector**: Detects mascot part bounding boxes as `BOUNDING_BOX`
- **pose_keypoint to dw_poses**: Converts 25-point `POSE_KEYPOINT` to SCAIL-Pose `DWPOSES`
- **pose_keypoint to SCAIL-Pose**: Converts 25-point `POSE_KEYPOINT` to SCAIL-Pose data
## Installation
### Install via ComfyUI Manager
@@ -65,13 +65,13 @@ Please refer to example_workflows.
## Troubleshooting
### Common Issues
1. **Model Loading Errors**: Models should be automatically downloaded from HuggingFace. Please ensure DWPose models are in the correct directory.
1. **Model Loading Errors**: Models should be automatically downloaded from HuggingFace. Please ensure pose models are in the correct directory.
2. **Incorrect body proportions after transformation with reference image**: The `pose_keypoint` and `reference_pose_keypoint` aspect ratios (canvas width/height) may not match. **ProportionChanger Reference** has `auto_resize_reference` (default ON) to automatically align the reference to the pose canvas size. If needed, use **pose_keypoint resize** to explicitly align `width`/`height`. Fine-tune individual body parts using the "ProportionChanger Params" node.
3. **Nothing displays after transformation with reference image**: The reference image's pose estimation by DWPose has failed. Use OpenposeEditor or similar tools to input parameter values manually.
3. **Nothing displays after transformation with reference image**: The reference image's pose estimation has failed. Use OpenposeEditor or similar tools to input parameter values manually.
### Mascot OpenPose Models
### Mascot Pose Models
Mascot OpenPose nodes download model artifacts from `grmchn/mascot-openpose-detect-test` on HuggingFace into `ComfyUI/models/mascot_body_detect`. The current test model package is CC-BY-NC 4.0 because it includes the ViTPose-L variant derived from a non-commercial pretrained backbone. The node code remains part of this repository, but use of the downloaded test models is subject to that model license.
Mascot pose nodes download model artifacts from `grmchn/mascot-pose-detect` on HuggingFace into `ComfyUI/models/mascot_body_detect`. The official model package is Apache 2.0 and uses the `keypoint/dinov2_vitpose_l` variant. The node code remains part of this repository, and use of the downloaded models is subject to the model package license.
## Attribution and Credits
### Special Thanks
@@ -89,7 +89,7 @@ When combining code from Apache 2.0 and GPL 3.0 licensed projects, the resulting
### Copyright Notice
- Original WanVideo UniAnimate DWPose Detector: Copyright by kijai
- Original WanVideo UniAnimate pose detector: Copyright by kijai
- ProportionChanger Params functionality: Copyright by toyxyz
- Modifications and integration: This project's contributors
+11 -11
View File
@@ -4,27 +4,27 @@
> **注意**: このREADMEは[Claude Code](https://claude.ai/code) AI支援開発ツールを使用して自動生成されました。
このカスタムノードは、[kijai氏のComfyUI-WanVideoWrapper](https://github.com/kijai/ComfyUI-WanVideoWrapper)のWanVideo UniAnimate DWPose Detectorノードを分解してポーティングしたものです。違いは、画像で入力していたところをDWPoseのKeyPointで入力できるようになったことで、これによりDWPoseでKeyPointが推定できないような体型でも操作ができるようになっています。
このカスタムノードは、[kijai氏のComfyUI-WanVideoWrapper](https://github.com/kijai/ComfyUI-WanVideoWrapper)のWanVideo UniAnimate pose detectorノードを分解してポーティングしたものです。違いは、画像で入力していたところをKeyPointで入力できるようになったことで、これによりpose detectorでKeyPointが推定できないような体型でも操作ができるようになっています。
さらに、[toyxyz/ComfyUI-ultimate-openpose-editor](https://github.com/toyxyz/ComfyUI-ultimate-openpose-editor)のOpenpose Editorノードも同様に分解してポーティングしています。これにより、各パーツ微調整が可能になっています。
## 機能
### ノード紹介
- **ProportionChanger DWPose Detector**: 画像からDWPoseのKeyPointを検出する
- **ProportionChanger Pose Detector**: 画像からKeyPointを検出する
- **ProportionChanger Reference**: 参照用ポーズにプロポーションを変換する
- **ProportionChanger DWPose Render**: KeyPointを画像に変換する
- **ProportionChanger Pose Render**: KeyPointを画像に変換する
- **ProportionChanger Params**: KeyPointの各パーツのパラメータを調整する
- **ProportionChanger Interpolator**: KeyPoint動画を中割りして補間する
- **PoseData to pose_keypoint**: WanAnimateの`POSEDATA`を`POSE_KEYPOINT`に変換する
- **pose_keypoint resize**: `POSE_KEYPOINT`を指定サイズにリサイズ(アスペクト比が違う場合はパディング→スケールで歪みを防ぐ)
- **pose_keypoint input**: JSONテキストからKeyPointに変換する
- **pose_keypoint preview**: KeyPointからJSONに変換する
- **(Down)Load Mascot DWPose Model**: HuggingFaceからマスコット用DWPose ONNXモデルをダウンロードして読み込む
- **(Down)Load Mascot Pose Model**: HuggingFaceからマスコット用pose ONNXモデルをダウンロードして読み込む
- **(Down)Load Mascot BBox Model**: HuggingFaceからマスコット用bbox ONNXモデルをダウンロードして読み込む
- **Mascot DWPose Detector**: マスコットの姿勢を`POSE_KEYPOINT`として検出する
- **Mascot Pose Detector**: マスコットの姿勢を`POSE_KEYPOINT`として検出する
- **Mascot BBox Detector**: マスコットのパーツbboxを`BOUNDING_BOX`として検出する
- **pose_keypoint to dw_poses**: 25点`POSE_KEYPOINT`をSCAIL-Pose用`DWPOSES`に変換する
- **pose_keypoint to SCAIL-Pose**: 25点`POSE_KEYPOINT`をSCAIL-Pose用データに変換する
## インストール
### ComfyUI Managerでインストール
@@ -66,13 +66,13 @@ example_workflowsを参照してください。
## トラブルシューティング
### よくある問題
1. **モデル読み込みエラー**: HuggingFaceから自動ダウンロードされるはずです。DWPoseモデルが正しいディレクトリにあることを確認してください。
1. **モデル読み込みエラー**: HuggingFaceから自動ダウンロードされるはずです。poseモデルが正しいディレクトリにあることを確認してください。
2. **リファレンス画像ありでプロポーション変換した後の体型がおかしい**: `pose_keypoint`と`reference_pose_keypoint`の縦横比(canvas幅/高さ)が一致していない可能性があります。**ProportionChanger Reference**の`auto_resize_reference`(デフォルトON)でリファレンス側を自動で揃えます。必要に応じて**pose_keypoint resize**ノードで明示的に`width`/`height`を揃えてください。体の各パーツの微調整は「ProportionChanger Params」ノードで行ってください。
3. **リファレンス画像ありでプロポーション変換した後に何も表示されない**:リファレンス画像のDWPoseによる姿勢推定が失敗しています。OpenposeEditorなどを利用してパラメータの数値を入力してください。
3. **リファレンス画像ありでプロポーション変換した後に何も表示されない**:リファレンス画像の姿勢推定が失敗しています。OpenposeEditorなどを利用してパラメータの数値を入力してください。
### Mascot OpenPoseモデル
### Mascot Poseモデル
Mascot OpenPoseノードは、HuggingFaceの`grmchn/mascot-openpose-detect-test`から`ComfyUI/models/mascot_body_detect`へモデルをダウンロードします。現在のtestモデルパッケージは、非商用のpretrained backboneに由来するViTPose-L variantを含むため、CC-BY-NC 4.0です。ノードコードはこのリポジトリの一部ですが、ダウンロードされたtestモデルの利用はモデル側のライセンスに従います。
Mascot Poseノードは、HuggingFaceの`grmchn/mascot-pose-detect`から`ComfyUI/models/mascot_body_detect`へモデルをダウンロードします。公式モデルパッケージはApache 2.0で、`keypoint/dinov2_vitpose_l` variantを使用します。ノードコードはこのリポジトリの一部であり、ダウンロードされたモデルの利用はモデル側のライセンスに従います。
## 帰属とクレジット
### Special Thanks
@@ -90,7 +90,7 @@ Apache 2.0とGPL 3.0ライセンスのプロジェクトからコードを組み
### 著作権表示
- オリジナルWanVideo UniAnimate DWPose Detector: Copyright by kijai
- オリジナルWanVideo UniAnimate pose detector: Copyright by kijai
- ProportionChanger Params機能: Copyright by toyxyz
- 修正・統合: このプロジェクトの貢献者
+9 -9
View File
@@ -206,7 +206,7 @@ class PoseKeypointPreview:
NODE_CLASS_MAPPINGS = {
# Main DWPose detector nodes
# Main pose detector nodes
"ProportionChangerDWPoseRender": ProportionChangerDWPoseRender,
"ProportionChangerDWPoseDetector": ProportionChangerDWPoseDetector,
"ProportionChangerReference": ProportionChangerReference,
@@ -224,7 +224,7 @@ NODE_CLASS_MAPPINGS = {
"PoseJSONToPoseKeypoint": PoseJSONToPoseKeypoint,
"PoseKeypointPreview": PoseKeypointPreview,
# Mascot OpenPose nodes
# Mascot pose nodes
"DownloadAndLoadMascotDWPoseModel": DownloadAndLoadMascotDWPoseModel,
"DownloadAndLoadMascotBBoxModel": DownloadAndLoadMascotBBoxModel,
"MascotDWPoseDetector": MascotDWPoseDetector,
@@ -233,9 +233,9 @@ NODE_CLASS_MAPPINGS = {
}
NODE_DISPLAY_NAME_MAPPINGS = {
# Main DWPose detector nodes
"ProportionChangerDWPoseRender": "ProportionChanger DWPose Render",
"ProportionChangerDWPoseDetector": "ProportionChanger DWPose Detector",
# Main pose detector nodes
"ProportionChangerDWPoseRender": "ProportionChanger Pose Render",
"ProportionChangerDWPoseDetector": "ProportionChanger Pose Detector",
"ProportionChangerReference": "ProportionChanger Reference",
"ProportionChangerParams": "ProportionChanger Params",
"ProportionChangerInterpolator": "ProportionChanger Interpolator",
@@ -250,10 +250,10 @@ NODE_DISPLAY_NAME_MAPPINGS = {
"PoseJSONToPoseKeypoint": "pose_keypoint input",
"PoseKeypointPreview": "pose_keypoint preview",
# Mascot OpenPose nodes
"DownloadAndLoadMascotDWPoseModel": "(Down)Load Mascot DWPose Model",
# Mascot pose nodes
"DownloadAndLoadMascotDWPoseModel": "(Down)Load Mascot Pose Model",
"DownloadAndLoadMascotBBoxModel": "(Down)Load Mascot BBox Model",
"MascotDWPoseDetector": "Mascot DWPose Detector",
"MascotDWPoseDetector": "Mascot Pose Detector",
"MascotBBoxDetector": "Mascot BBox Detector",
"ConvertToSCAILPose": "pose_keypoint to dw_poses",
"ConvertToSCAILPose": "pose_keypoint to SCAIL-Pose",
}
+1 -1
View File
@@ -1,6 +1,6 @@
"""
ProportionChanger nodes package
Provides organized node classes for DWPose detection and rendering
Provides organized node classes for pose detection and rendering
"""
# Import detector node classes
+4 -4
View File
@@ -1,6 +1,6 @@
"""
ProportionChanger detector node classes
Contains the main DWPose detector nodes for pose estimation
Contains the main pose detector nodes for pose estimation
"""
import os
@@ -19,7 +19,7 @@ from ..utils import log
class ProportionChangerDWPoseDetector:
"""
DWPose detector node that extracts pose keypoints from image and outputs POSE_KEYPOINT format.
Pose detector node that extracts pose keypoints from image and outputs POSE_KEYPOINT format.
This node is designed to work with ProportionChangerReference.
Includes toe keypoints (19-24) which are essential for full pose estimation.
"""
@@ -82,7 +82,7 @@ class ProportionChangerDWPoseDetector:
for i, img in enumerate(image_np):
try:
# Use the high-level DWPose detector call (same as working UniAnimate version)
# Use the high-level pose detector call (same as working UniAnimate version)
pose = self.dwpose_detector(img, score_threshold=score_threshold)
# Convert to POSE_KEYPOINT format using actual canvas dimensions
@@ -152,4 +152,4 @@ class ProportionChangerDWPoseDetector:
hand_kpts[i] = hand_kpts[i] / canvas_width
hand_kpts[i+1] = hand_kpts[i+1] / canvas_height
return pose_keypoint
return pose_keypoint
+35 -19
View File
@@ -1,5 +1,5 @@
"""
Mascot OpenPose nodes for ProportionChanger.
Mascot pose nodes for ProportionChanger.
The model artifacts are downloaded from HuggingFace and executed with
ONNXRuntime. This module intentionally has no runtime dependency on the
@@ -33,18 +33,16 @@ except ImportError: # pragma: no cover
log = logging.getLogger(__name__)
DEFAULT_REPO_ID = "grmchn/mascot-openpose-detect-test"
DEFAULT_REPO_ID = "grmchn/mascot-pose-detect"
HF_BASE_URL = f"https://huggingface.co/{DEFAULT_REPO_ID}/resolve/main"
MASCOT_BBOX_MODEL_URLS = [
f"{HF_BASE_URL}/bbox/model.onnx",
]
MASCOT_DWPOSE_MODEL_URLS = [
f"{HF_BASE_URL}/keypoint/vitpose_l/model.onnx",
f"{HF_BASE_URL}/keypoint/rtmpose_s/model.onnx",
f"{HF_BASE_URL}/keypoint/dinov2_vitpose_l/model.onnx",
]
POSE_URL_TO_VARIANT = {
f"{HF_BASE_URL}/keypoint/vitpose_l/model.onnx": "vitpose_l",
f"{HF_BASE_URL}/keypoint/rtmpose_s/model.onnx": "rtmpose_s",
f"{HF_BASE_URL}/keypoint/dinov2_vitpose_l/model.onnx": "dinov2_vitpose_l",
}
BBOX_KEYS = (
"full",
@@ -101,11 +99,28 @@ def _read_json(path: str) -> Any:
return json.load(handle)
def _repo_marker_path(base: str) -> str:
return os.path.join(base, ".repo_id")
def _local_repo_matches(base: str) -> bool:
try:
with open(_repo_marker_path(base), "r", encoding="utf-8") as handle:
return handle.read().strip() == DEFAULT_REPO_ID
except FileNotFoundError:
return False
def _write_repo_marker(base: str) -> None:
with open(_repo_marker_path(base), "w", encoding="utf-8") as handle:
handle.write(DEFAULT_REPO_ID)
def _download_artifacts(url: str, *, include_bbox: bool, keypoint_variant: str | None = None) -> str:
if include_bbox and url not in MASCOT_BBOX_MODEL_URLS and keypoint_variant is None:
raise ValueError(f"URL {url} is not in the list of allowed Mascot BBox models.")
if keypoint_variant is not None and url not in MASCOT_DWPOSE_MODEL_URLS:
raise ValueError(f"URL {url} is not in the list of allowed Mascot DWPose models.")
raise ValueError(f"URL {url} is not in the list of allowed Mascot Pose models.")
from huggingface_hub import snapshot_download
@@ -131,13 +146,14 @@ def _download_artifacts(url: str, *, include_bbox: bool, keypoint_variant: str |
]
)
if not all(os.path.exists(path) for path in required_paths):
if not _local_repo_matches(base) or not all(os.path.exists(path) for path in required_paths):
snapshot_download(
repo_id=DEFAULT_REPO_ID,
repo_type="model",
allow_patterns=allow_patterns,
local_dir=base,
)
_write_repo_marker(base)
return base
@@ -538,7 +554,7 @@ def infer_keypoints_pixel(
if outputs is None or matrix is None:
return [[0.0, 0.0, 0.0] for _ in range(25)]
if variant == "vitpose_l":
if variant in {"vitpose_l", "dinov2_vitpose_l"}:
scale = float(kp_meta.get("heatmap_to_input_scale", 4.0))
kp_crop = decode_heatmap(outputs[0][0], scale)
kp_image_17 = crop_to_image_points(kp_crop, matrix)
@@ -686,7 +702,7 @@ class DownloadAndLoadMascotDWPoseModel:
"required": {
"url": (
MASCOT_DWPOSE_MODEL_URLS,
{"default": f"{HF_BASE_URL}/keypoint/vitpose_l/model.onnx"},
{"default": f"{HF_BASE_URL}/keypoint/dinov2_vitpose_l/model.onnx"},
),
"cuda": (
"BOOLEAN",
@@ -705,7 +721,7 @@ class DownloadAndLoadMascotDWPoseModel:
RETURN_NAMES = ("mascot_pose_model",)
FUNCTION = "loadmodel"
CATEGORY = "ProportionChanger"
DESCRIPTION = "Download and load a mascot DWPose ONNX model from HuggingFace."
DESCRIPTION = "Download and load a mascot pose ONNX model from HuggingFace."
def loadmodel(self, url: str, cuda: bool, warmup: bool = True):
if folder_paths is None:
@@ -715,10 +731,10 @@ class DownloadAndLoadMascotDWPoseModel:
keypoint_variant = POSE_URL_TO_VARIANT.get(url)
if keypoint_variant is None:
raise ValueError(f"URL {url} is not in the list of allowed Mascot DWPose models.")
raise ValueError(f"URL {url} is not in the list of allowed Mascot Pose models.")
# The current top-down DWPose ONNX still needs a body ROI. Keep the bbox
# sidecar inside this handle so the DWPose detector remains a single-input
# The current top-down keypoint ONNX still needs a body ROI. Keep the bbox
# sidecar inside this handle so the pose detector remains a single-input
# node while exposing a separate bbox loader for bbox-only workflows.
base = _download_artifacts(url, include_bbox=True, keypoint_variant=keypoint_variant)
bbox_onnx = os.path.join(base, "bbox", "model.onnx")
@@ -728,14 +744,14 @@ class DownloadAndLoadMascotDWPoseModel:
kp_session = ort.InferenceSession(kp_onnx, providers=providers)
if warmup:
log.info("Warming up Mascot DWPose model...")
log.info("Warming up Mascot Pose model...")
bbox_input = bbox_session.get_inputs()[0]
kp_input = kp_session.get_inputs()[0]
bbox_shape = [1 if not isinstance(dim, int) else dim for dim in bbox_input.shape]
kp_shape = [1 if not isinstance(dim, int) else dim for dim in kp_input.shape]
bbox_session.run(None, {bbox_input.name: np.zeros(bbox_shape, dtype=np.float32)})
kp_session.run(None, {kp_input.name: np.zeros(kp_shape, dtype=np.float32)})
log.info("Mascot DWPose model warmed up")
log.info("Mascot Pose model warmed up")
return (
{
@@ -812,7 +828,7 @@ class MascotDWPoseDetector:
def INPUT_TYPES(cls):
return {
"required": {
"mascot_pose_model": ("MASCOT_POSE_MODEL", {"tooltip": "Output of (Down)Load Mascot DWPose Model"}),
"mascot_pose_model": ("MASCOT_POSE_MODEL", {"tooltip": "Output of (Down)Load Mascot Pose Model"}),
"image": ("IMAGE", {"tooltip": "Input image, RGB float [0,1]."}),
"width": ("INT", {"default": 1024, "min": 64, "max": 8192, "step": 8}),
"height": ("INT", {"default": 1024, "min": 64, "max": 8192, "step": 8}),
@@ -925,10 +941,10 @@ class ConvertToSCAILPose:
}
RETURN_TYPES = ("DWPOSES",)
RETURN_NAMES = ("dw_poses",)
RETURN_NAMES = ("scail_pose",)
FUNCTION = "convert"
CATEGORY = "ProportionChanger"
DESCRIPTION = "Convert 25-point POSE_KEYPOINT to SCAIL-Pose DWPOSES."
DESCRIPTION = "Convert 25-point POSE_KEYPOINT to SCAIL-Pose data."
def convert(self, keypoints):
num_body = 18
+1 -1
View File
@@ -272,7 +272,7 @@ class ProportionChangerParams:
original = keypoints.copy()
adjusted = keypoints.copy()
# DWPose keypoint definitions (corrected based on actual data structure)
# Pose keypoint definitions (corrected based on actual data structure)
KP = {
"Nose": 0, "Neck": 1, "RShoulder": 2, "RElbow": 3, "RWrist": 4,
"LShoulder": 5, "LElbow": 6, "LWrist": 7, "LHip": 8, "LKnee": 9,
+6 -6
View File
@@ -1,6 +1,6 @@
"""
ProportionChanger render node classes
Contains nodes for rendering POSE_KEYPOINT data using DWPose styling
Contains nodes for rendering POSE_KEYPOINT data
"""
import numpy as np
@@ -23,8 +23,8 @@ def debug_log(message):
class ProportionChangerDWPoseRender:
"""
DWPose Render Node with 25-point keypoint support including toe keypoints.
Compatible with ultimate-openpose-render parameters but using DWPose rendering algorithms.
Pose render node with 25-point keypoint support including toe keypoints.
Compatible with ultimate-openpose-render parameters.
Resolves coordinate misalignment issues when displaying ProportionChanger outputs.
"""
@@ -38,7 +38,7 @@ class ProportionChangerDWPoseRender:
"show_body": ("BOOLEAN", {"default": True, "tooltip": "Draw body keypoints"}),
"show_face": ("BOOLEAN", {"default": False, "tooltip": "Draw face keypoints"}),
"show_hands": ("BOOLEAN", {"default": True, "tooltip": "Draw hand keypoints"}),
"show_feet": ("BOOLEAN", {"default": True, "tooltip": "Draw toe keypoints (DWPose 25-point feature)"}),
"show_feet": ("BOOLEAN", {"default": True, "tooltip": "Draw toe keypoints"}),
"resolution_x": ("INT", {"default": -1, "min": -1, "max": 12800, "tooltip": "Output width (-1 for original)"}),
"pose_marker_size": ("INT", {"default": 4, "min": 0, "max": 100, "tooltip": "Body keypoint marker size"}),
"face_marker_size": ("INT", {"default": 3, "min": 0, "max": 100, "tooltip": "Face keypoint marker size"}),
@@ -78,7 +78,7 @@ class ProportionChangerDWPoseRender:
elif isinstance(pose_keypoint, dict):
debug_log(f"Debug single frame keys: {pose_keypoint.keys()}")
# Render using DWPose algorithms
# Render using the local pose renderer.
pose_imgs = draw_dwpose_render(
pose_keypoint, resolution_x, show_body, show_face, show_hands, show_feet,
pose_marker_size, face_marker_size, hand_marker_size
@@ -89,4 +89,4 @@ class ProportionChangerDWPoseRender:
pose_imgs_np = np.array(pose_imgs).astype(np.float32) / 255
return (torch.from_numpy(pose_imgs_np),)
else:
raise ValueError("Invalid input type. Expected an input to give an output.")
raise ValueError("Invalid input type. Expected an input to give an output.")
+3 -3
View File
@@ -72,7 +72,7 @@ class ProportionChangerReference:
# Convert reference using its own canvas dimensions
ref_data = pose_keypoint_to_dwpose_format(reference_pose_keypoint, ref_canvas_width, ref_canvas_height)
# Convert all frames to DWPose format for batch processing
# Convert all frames to the internal pose format for batch processing
batch_pose_data = []
for frame in pose_keypoint:
single_frame_data = [frame]
@@ -803,10 +803,10 @@ class ProportionChangerReference:
def apply_proportion_changes(self, pose_data, ref_data,
canvas_width, canvas_height, ref_canvas_width, ref_canvas_height):
"""
Apply proportion changing algorithms from the original DWPose detector
Apply proportion changing algorithms from the original pose detector
Complete 1:1 port from pose_extract function (lines 241-500+) in WanVideoWrapper
DWPose Body Keypoint Structure:
Body Keypoint Structure:
0: Nose, 1: Left Eye, 2: Right Eye, 3: Left Ear, 4: Right Ear,
5: Left Shoulder, 6: Right Shoulder, 7: Left Elbow, 8: Right Elbow,
9: Left Wrist, 10: Right Wrist, 11: Left Hip, 12: Right Hip,
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "ComfyUI-ProportionChanger"
description = "Advanced DWPose-based body proportion changer for ComfyUI"
description = "Advanced pose-based body proportion changer for ComfyUI"
version = "1.0.1"
license = {file = "LICENSE"}
dependencies = ["torch", "numpy", "opencv-python", "tqdm"]
+5 -9
View File
@@ -1410,8 +1410,8 @@ def draw_hands_dwpose_render(canvas, person, orig_w, orig_h, scaled_w, scaled_h,
class ProportionChangerDWPoseRender:
"""
DWPose Render Node with 25-point keypoint support including toe keypoints.
Compatible with ultimate-openpose-render parameters but using DWPose rendering algorithms.
Pose render node with 25-point keypoint support including toe keypoints.
Compatible with ultimate-openpose-render parameters.
Resolves coordinate misalignment issues when displaying ProportionChanger outputs.
"""
@@ -1460,11 +1460,7 @@ class ProportionChangerDWPoseRender:
NODE_CLASS_MAPPINGS = {
"ProportionChangerDWPoseRender": ProportionChangerDWPoseRender,
}
}
NODE_DISPLAY_NAME_MAPPINGS = {
"ProportionChangerDWPoseRender": "ProportionChanger DWPose Render",
}
"ProportionChangerDWPoseRender": "ProportionChanger Pose Render",
}