Draw KPS
Placing your own face keypoints when detection won't cooperate
- kps
- image_reference
- kps_data
This is the manual override for everything InstantID normally figures out automatically. Instead of running insightface's face detection to locate the five landmark points it needs (eyes, nose, mouth corners), you place them yourself, by hand, on a canvas. It exists for two situations: you keep hitting "No face detected in pose image" and detection just isn't going to work for your source, or you're not starting from a photo at all - you're generating a person purely from a text prompt and need to tell InstantID where the face should even go.
Why you'd want this over automatic detection
Face detection fails at extreme angles - insightface can't reliably find landmark positions on a face rotated far enough off-axis, and when that happens, whatever AngleFromFace or PreprocessImage tries to compute downstream will be wrong or simply error out. Drawing KPS yourself sidesteps that failure mode entirely, at the cost of doing it by hand. It's also the only way to do pure text-to-image generation with this pack - since v0.1.0 you're no longer required to swap a face into an existing photo; you can place KPS wherever you want a face to appear and generate from a prompt alone.
How you actually use it
Click and drag the five points around on the canvas. The shortcuts, straight from the README: Ctrl+drag to move a point, Ctrl+wheel to zoom the canvas, Alt+wheel to adjust how far the other four points sit from the blue point (the nose). Once you've placed them where you want, the node shows you the angle by which the image would need to rotate to align that face - useful context even if you're not feeding it into a rotation step.
One detail worth knowing: each keypoint's opacity is individually adjustable. Lowering a point's opacity weakens its influence on generation without removing it - the README's example is deliberately fading a point to make room for something like glasses, trading a little likeness for the accessory actually reading correctly.
The inputs and outputs that matter
image_reference(optional) - a background image to draw against, so you can align KPS visually to something real instead of guessing blind. If you provide this, the node's ownwidth/heightfields get disabled and the output takes the reference image's dimensions instead.width/height(both default 1024) - canvas size, only relevant when there's noimage_reference.
Output: kps_data (KPS_DATA), which goes to KpsMaker to become an actual control image, or through KpsRotate/KpsScale/KpsCrop first if you need to transform it further.
Install
ComfyUI Manager: search comfyui-instantId-faceswap, or git clone https://github.com/nosiu/comfyui-instantId-faceswap into custom_nodes/ and pip install -r requirements.txt. No model download needed for this node specifically - it's a pure UI/canvas tool, no insightface or InstantID weights required to use it.
Common issues & troubleshooting
You've hit "No face detected in pose image" repeatedly. This is exactly the situation this node solves. Rather than continuing to fight pad and mask size on PreprocessImage/AngleFromFace, switch to drawing KPS by hand here - it's slower per-image but deterministic.
Points feel finicky to position precisely. Use image_reference if you have any real photo to align against, even a rough one - dragging points against a blank canvas at the right proportions is much harder than eyeballing them against an actual face.
Old saved workflows don't carry KPS positions. As of v0.1.1, drawn KPS positions are saved into the workflow itself, which wasn't true before - if you're opening an older saved graph, you may need to redraw.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 10240–16384 | — |
| height | INT | 10240–16384 | — |
| kps | HIDDEN_STRING_JSON | — | |
| image_referenceopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| kps_data | KPS_DATA | — |