{"record":{"id":"c4d220c6f40d8493","repo":"Comfy-Org/ComfyUI","slug":"the-provided-model-does-not-have-a-heatmap-head-p","errorCode":null,"errorMessage":"The provided model does not have a heatmap_head. Please use SDPose model from here https://huggingface.co/Comfy-Org/SDPose/tree/main/checkpoints.","messagePattern":"The provided model does not have a heatmap_head\\. Please use SDPose model from here https://huggingface\\.co/Comfy-Org/SDPose/tree/main/checkpoints\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_sdpose.py","lineNumber":477,"sourceCode":"\n    @classmethod\n    def execute(cls, model, vae, image, batch_size, bboxes=None) -> io.NodeOutput:\n\n        height, width = image.shape[-3], image.shape[-2]\n        context = LotusConditioning().execute().result[0]\n\n        # Use output_block_patch to capture the last 640-channel feature\n        def output_patch(h, hsp, transformer_options):\n            nonlocal captured_feat\n            if h.shape[1] == 640:  # Capture the features for wholebody\n                captured_feat = h.clone()\n            return h, hsp\n\n        model_clone = model.clone()\n        model_clone.model_options[\"transformer_options\"] = {\"patches\": {\"output_block_patch\": [output_patch]}}\n\n        if not hasattr(model.model.diffusion_model, 'heatmap_head'):\n            raise ValueError(\"The provided model does not have a heatmap_head. Please use SDPose model from here https://huggingface.co/Comfy-Org/SDPose/tree/main/checkpoints.\")\n\n        head = model.model.diffusion_model.heatmap_head\n        total_images = image.shape[0]\n        captured_feat = None\n\n        model_w = int(head.heatmap_size[0]) * 4   # 192 * 4 = 768\n        model_h = int(head.heatmap_size[1]) * 4   # 256 * 4 = 1024\n\n        def _resize_to_model(imgs):\n            \"\"\"Stretch BHWC images to (model_h, model_w), model expects no aspect preservation.\"\"\"\n            h, w = imgs.shape[-3], imgs.shape[-2]\n            method = \"area\" if (model_h <= h and model_w <= w) else \"bilinear\"\n            chw = imgs.permute(0, 3, 1, 2).float()\n            scaled = comfy.utils.common_upscale(chw, model_w, model_h, upscale_method=method, crop=\"disabled\")\n            return scaled.permute(0, 2, 3, 1), model_w / w, model_h / h\n\n        def _remap_keypoints(kp, scale_x, scale_y, offset_x=0, offset_y=0):\n            \"\"\"Remap keypoints from model space back to original image space.\"\"\"","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_sdpose.py#L459-L495","documentation":"Raised by the SDPose node when the loaded diffusion model's diffusion_model lacks a heatmap_head attribute. SDPose checkpoints ship with an extra heatmap head attached to the DiT; a plain checkpoint of the same family will not have it, and the node cannot extract the 640-channel features it needs via the output_block_patch hook.","triggerScenarios":"Loading a non-SDPose checkpoint (or a base model without the auxiliary head) into the SDPose node; a custom/fine-tuned variant where heatmap_head was stripped; converting a checkpoint with a script that drops non-standard keys.","commonSituations":"Pointing the loader at the wrong local checkpoint; using a quantized/reforged SDPose whose converter dropped the head; assuming any Flux-architecture model works because input shapes match.","solutions":["Download and load the official SDPose checkpoint from https://huggingface.co/Comfy-Org/SDPose/tree/main/checkpoints.","Verify the checkpoint actually contains heatmap_head weights (inspect state dict keys before loading).","If converting/quantizing SDPose yourself, keep the heatmap_head module and its keys intact."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Before running, confirm the loaded model carries the SDPose head\nif not hasattr(model.model.diffusion_model, 'heatmap_head'):\n    raise ValueError(\"loaded checkpoint is not SDPose; use Comfy-Org/SDPose checkpoints\")","typeGuard":"def is_sdpose_model(model) -> bool:\n    dm = getattr(getattr(model, 'model', None), 'diffusion_model', None)\n    return dm is not None and hasattr(dm, 'heatmap_head')","tryCatchPattern":null,"preventionTips":["Download checkpoints only from the Comfy-Org/SDPose HF repo for this node.","When converting/quantizing, verify heatmap_head keys survive the conversion."],"tags":["sdpose","pose-estimation","model-loading","checkpoint"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}