Nodes/tri3d-comfyui-nodes/Pose to Image v5.1.0
ComfyUI Node

Pose to Image v5.1.0

Render a pose skeleton back into an image (without fighting the preprocessor stack)

By TRI3D-LC·Created 3 years ago·Updated about a year ago· 27
Pose to Image v5.1.0
    • IMAGE
    pose_json_filedwpose/keypoints

    Every pose-driven workflow has the same boring middle step: you detect a pose, you turn those keypoints into an image, you feed that image to a ControlNet. tri3d-pose-to-image is the boring middle step, packaged on purpose. It takes a pose JSON in TRI3D's flattened format and paints the classic black-background skeleton canvas that OpenPose/DWPose ControlNets expect. If you're already using this pack's DWPose node or SaveFlattenedPoseKpsAsJsonFile, this is the node that closes the loop.

    The pack comes from TRI3D, the virtual try-on outfit (they also ship the standalone tri3d-openpose-editor), so this node exists to feed their VTON pipelines - adapted poses, garment-locked poses, mannequin poses. But it's useful for any OpenPose-format ControlNet workflow once you have a flattened pose JSON sitting on disk.

    What it actually does

    One input, one output. pose_json_file is a string path to the flattened pose JSON - the {"height": ..., "width": ..., "keypoints": [...]} format this pack writes (130 keypoints: 18 body, 70 face, 21 left hand, 21 right hand, missing points as [-1, -1]). It reads that file, creates an empty canvas at the JSON's dimensions, and draws the body pose with OpenCV-style lines and dots, then the hands (keypoints[88:109] and [109:]) on top. Out comes an IMAGE at the exact size the pose was detected at, ready to wire into your OpenPose ControlNet.

    A couple of honest gotchas:

    • The default pose_json_file value is dwpose/keypoints - a directory, not a file. You'll generally want to point this at the actual JSON, e.g. dwpose/keypoints/input.json after running the pack's DWPose node. Paths are resolved relative to the pack folder, so defaults like that work without fiddling.
    • This node draws only body + hands. Faces aren't rendered, so if you need face-control you're pairing this with a face-oriented condition anyway.

    Where it fits

    The happy path looks like this:

    1. tri3d-dwpose on your reference image, which writes the flattened JSON and hands you its path.
    2. Optionally tri3d-adjust-neck or tri3d-pose-adaption to edit that JSON (VTON pose locks, neck scaling, that kind of thing).
    3. tri3d-pose-to-image to render the final skeleton.
    4. That IMAGE into an OpenPose ControlNet alongside your sampler.

    The STRING path output of the other nodes plugs straight into this one's pose_json_file, so you can keep the whole chain on wires instead of typing paths.

    Installing

    Through ComfyUI Manager (search "tri3d"), or:

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

    Then restart ComfyUI. Manager installs requirements.txt for you; if you cloned by hand, run pip install -r custom_nodes/tri3d-comfyui-nodes/requirements.txt in ComfyUI's Python environment. The heavyweight bits (opencv, transparent-background, facer) install with it - this pack assumes the whole kitchen sink.

    Troubleshooting

    • "No such file or directory" on the JSON path - the path is resolved relative to the pack's install folder, so dwpose/keypoints/input.json means inside the pack directory. If you've moved things, check the file actually exists there.
    • Blank black output - the JSON has no usable keypoints (all [-1, -1], meaning nothing was detected). Re-run DWPose with body detection on.
    • **pose has no key 'height'** - you fed it the wrong JSON format. It wants TRI3D's flattened format, not the raw OpenPose peopledict. Run it throughSaveFlattenedPoseKpsAsJsonFile` first.

    The name undersells it: this is the "pose JSON back to ControlNet input" glue, and for TRI3D's pose pipeline it's the piece everything else feeds.

    CategoryTRI3D

    Inputs (1)

    NameTypeDefaultDescription
    pose_json_fileSTRINGdwpose/keypoints

    Outputs (1)

    NameTypeDescription
    IMAGEIMAGE