KeypointScaler Node Documentation
Overview
The KeypointScaler
node is a component of the ComfyUI-LivePortraitKJ repository. It is used to adjust the scale and position of keypoints extracted from image data, primarily utilized in the context of live portraits or animated character representations. This node processes keypoint information, scales it, and applies positional offsets, allowing for fine-tuning of facial landmark placements on images.
Functionality
The primary function of the KeypointScaler
node is to modify the scale and location of keypoints contained within a given crop information object. Keypoints are coordinates representing the position of specific facial landmarks. By altering these keypoints, users can achieve desired visual effects or corrections in animations or portrait compositions.
Inputs
The KeypointScaler
node accepts the following inputs:
- Crop Info (required): This is the main input containing keypoint information. It is a dictionary object that includes details such as facial landmarks.
- Scale (required): A floating-point value that determines how much the keypoints should be scaled. A scale of 1.0 signifies no scaling, while values greater than or less than 1.0 increase or decrease the size, respectively.
- Offset X (required): An integer value that shifts the keypoints horizontally. Positive values move the keypoints to the right, while negative values move them to the left.
- Offset Y (required): An integer value that shifts the keypoints vertically. Positive values move the keypoints downward, while negative values move them upward.
Outputs
The KeypointScaler
node generates the following outputs:
- Crop Info: The modified crop information with updated keypoint positions, reflecting the applied scaling and offsets.
- Keypoints Image: An image representation of the modified keypoints. This visual output can be used for verification or debugging purposes to see how keypoints have been adjusted.
Usage in ComfyUI Workflows
In ComfyUI workflows, the KeypointScaler
node is primarily used in projects involving facial animations, live portrait creation, or any application requiring manipulation of facial landmarks. By refining keypoint positions, users can ensure that animations or transformations align correctly with the desired aesthetic or technical requirements.
Typical usage might involve:
- Preparing keypoint data for use in a live portrait synthesis or animation process.
- Adjusting facial landmarks to account for changes in perspective or to better fit within a compositional framework.
- Testing and visualizing shifts in facial landmark placement as part of a broader creative workflow.
Special Features and Considerations
- Precision: The node allows precise control over keypoint scaling and positioning, which is crucial for detailed facial animations.
- Flexibility: By offering both scaling and offset options, users can achieve complex transformations that involve resizing and relocating keypoints.
- Visualization: The output image depicting keypoints helps users verify the transformations and ensure they meet the intended artistic or functional objectives.
When using the KeypointScaler
, it's important to consider the scale and offsets carefully, especially in workflows where minute adjustments can significantly impact the final visual output.