Visit ComfyUI Online for ready-to-use ComfyUI environment
Detects face rotation in images for inpainting masks, aiding AI artists in facial feature manipulation with manual override.
NegiTools_DetectFaceRotationForInpainting is a specialized node designed to detect the rotation of a face within an image and generate a mask for inpainting purposes. This node is particularly useful for AI artists who need to correct or manipulate facial features in their artwork. By analyzing key facial landmarks such as the nose, eyes, and ears, the node calculates the face's orientation and creates a mask that highlights the area of interest. This mask can then be used to apply various inpainting techniques, ensuring that the modifications blend seamlessly with the rest of the image. The node also allows for manual override of the detected rotation, providing flexibility and control over the final output.
This parameter expects a JSON string that contains the coordinates of key facial landmarks. These landmarks include the nose, right eye, left eye, right ear, and left ear. The node uses these coordinates to calculate the face's center and orientation. The accuracy of the face detection and rotation calculation heavily depends on the precision of these coordinates. The default value is an empty string.
This parameter accepts an image input that contains the face to be analyzed. The image should be in a format that the node can process, such as a tensor or a NumPy array. The dimensions of the image are used to scale the coordinates of the facial landmarks appropriately.
This parameter is a float that determines the scaling factor for the radius of the detected face area. It affects the size of the mask generated for inpainting. A higher value will result in a larger mask, while a lower value will produce a smaller mask. The default value is 1.0, with a minimum of 0.1 and a maximum of 5.0. The step size for adjustments is 0.01, and the value is rounded to three decimal places.
This parameter allows you to manually override the detected face rotation. It accepts specific values: "None", "0", "90", "180", and "270". If set to "None", the node will use the automatically detected rotation. Otherwise, it will use the specified rotation value. This feature provides additional control over the face orientation in the final output.
This output parameter provides the inverse of the detected or specified face rotation. It is an integer value that represents the angle in degrees. The inverse rotation is useful for aligning the face correctly in the image.
This output parameter is a mask that highlights the detected face area. The mask is a tensor with the same dimensions as the input image, where the face area is marked for inpainting. The mask helps in isolating the face for further processing or modifications.
This output parameter provides the detected or specified face rotation. It is an integer value that represents the angle in degrees. This value indicates the orientation of the face in the input image.
parts
parameter is accurate and contains all necessary facial landmarks for optimal face detection and rotation calculation.radius_scale
parameter to fine-tune the size of the mask according to your inpainting needs. A larger radius may be useful for broader modifications, while a smaller radius can be used for more precise edits.overwrite_rotation
parameter to manually set the face rotation if the automatic detection does not yield the desired results. This can be particularly useful for images with unusual angles or poses.parts
parameter is not correctly formatted or is missing required facial landmarks.radius_scale
parameter is outside the allowed range.radius_scale
value to be within the range of 0.1 to 5.0.overwrite_rotation
parameter is not one of the accepted options.overwrite_rotation
parameter to one of the following values: "None", "0", "90", "180", or "270".© Copyright 2024 RunComfy. All Rights Reserved.