Nodes/tri3d-comfyui-nodes/Adjust Neck v5.1.0
ComfyUI Node

Adjust Neck v5.1.0

Fix a mannequin's neck so the garment model's head doesn't float

By TRI3D-LC·Created 3 years ago·Updated about a year ago· 27
Adjust Neck v5.1.0
    • IMAGE
    • STRING
    posemap_json_file_pathdwpose/keypoints/input.json
    neck_shoulder_ratio0.70
    save_json_file_pathdwpose/keypoints/output.json

    If you've ever tried virtual try-on with a mannequin you've met this problem: the mannequin's neck is too short or too long, so the real model's head sits at the wrong height and the garment ControlNet looks off. tri3d-adjust-neck is TRI3D's fix - it scales the neck on a flattened pose JSON by re-positioning the nose (and the face points that hang off it) so the neck-to-shoulder ratio lands where you want it.

    What it does

    Three inputs, all plain values - no images:

    • posemap_json_file_path - the flattened pose JSON (default dwpose/keypoints/input.json).
    • neck_shoulder_ratio - the target ratio, 0.0 to 1.0, default 0.7. This is the ratio of neck length (neck-to-nose distance) to shoulder width. Lower means a shorter neck, higher a longer one.
    • save_json_file_path - where the adjusted pose gets written (default dwpose/keypoints/output.json).

    Under the hood it reads the pose, measures the current neck-to-shoulder ratio from the keypoints, computes a scale factor from your target, moves the nose point along the neck direction, then repositions the four face points (14–17, the ears and cheeks) to follow. It renders the adjusted skeleton onto a canvas and writes the new JSON.

    You get two outputs: an IMAGE (the rendered skeleton of the adjusted pose, ready for your ControlNet) and a STRING (the path the adjusted JSON was saved to). That string is designed to flow into tri3d-pose-to-image if you want to keep the chain on wires.

    When you'd actually use this

    This is a VTON-adjacent tool, and it makes sense in a narrow slot: you've detected a pose on a mannequin, and you need the neck geometry to match the person whose garment you're fitting. The ratio is set by eye - render, look, tweak, re-run. Since it's pure JSON manipulation plus a skeleton render, iterations are cheap; no model inference involved.

    It does not change the shoulders or body - only the neck length and the face points that move with the nose. If you want bigger structural pose changes, that's tri3d-pose-adaption's job; this node is the fine adjustment knob.

    Installing

    Same pack as everything else here - ComfyUI Manager (search "tri3d"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes
    

    Restart and install requirements (pip install -r custom_nodes/tri3d-comfyui-nodes/requirements.txt if you cloned by hand). No model downloads for this node.

    Troubleshooting

    • Output looks unchanged - the source pose's ratio was already close to your target, or the neck keypoints weren't detected. Check the console's "neck to shoulder ratio found" print to see the measured value.
    • JSON path errors - remember paths resolve relative to the pack's folder, so dwpose/keypoints/input.json lives inside custom_nodes/tri3d-comfyui-nodes/. The default only works if the DWPose node (or SaveFlattenedPoseKpsAsJsonFile) wrote there first.
    • Face points don't follow the nose - if the face keypoints were all [-1, -1] (no face detected), there's nothing to move, and only the nose shifts.

    A small, single-purpose node - and for mannequin-based garment workflows it's the difference between a convincing try-on and one where the head hovers at the wrong height.

    CategoryTRI3D

    Inputs (3)

    NameTypeDefaultDescription
    posemap_json_file_pathSTRINGdwpose/keypoints/input.json
    neck_shoulder_ratioFLOAT0.700–1
    save_json_file_pathSTRINGdwpose/keypoints/output.json

    Outputs (2)

    NameTypeDescription
    IMAGEIMAGE
    STRINGSTRING