ComfyUI  >  Nodes  >  WAS Node Suite >  Image Paste Face

ComfyUI Node: Image Paste Face

Class Name

Image Paste Face

Category
WAS Suite/Image/Process
Author
WASasquatch (Account age: 4688 days)
Extension
WAS Node Suite
Latest Updated
8/25/2024
Github Stars
1.1K

How to Install WAS Node Suite

Install this extension via the ComfyUI Manager by searching for  WAS Node Suite
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter WAS Node Suite in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Image Paste Face Description

Seamlessly integrate cropped face images into target images with blending and sharpening options for realistic composite creations.

Image Paste Face:

The Image Paste Face node is designed to seamlessly integrate a cropped face image into another image, providing a powerful tool for AI artists to create composite images with precision. This node leverages advanced face detection techniques to identify and crop faces from an image, and then pastes the cropped face onto a target image with customizable blending and sharpening options. The primary goal of this node is to facilitate the creation of realistic and visually appealing composite images by ensuring that the pasted face blends naturally with the target image. This is achieved through the use of blending ratios and optional sharpening, which help to smooth the transition between the pasted face and the surrounding areas of the target image.

Image Paste Face Input Parameters:

image

This parameter represents the target image onto which the face will be pasted. It should be provided as a PIL Image object. The target image serves as the canvas for the composite image, and its dimensions and content will determine the placement and appearance of the pasted face.

crop_image

This parameter is the cropped face image that will be pasted onto the target image. It should be provided as a PIL Image object. The cropped face image is typically obtained from a face detection and cropping process, and it will be blended into the target image based on the specified parameters.

crop_data

This parameter contains the coordinates and dimensions of the cropped face within the original image. It is a tuple of the form (x, y, w, h), where x and y are the coordinates of the top-left corner of the face, and w and h are the width and height of the face, respectively. This data is used to accurately position the cropped face on the target image.

blend_amount

This parameter controls the blending ratio between the cropped face and the target image. It is a float value between 0 and 1, where 0 means no blending (the cropped face is pasted as-is) and 1 means full blending (the cropped face is fully blended with the target image). The default value is 0.25. Adjusting this parameter helps to achieve a natural transition between the pasted face and the target image.

sharpen_amount

This parameter controls the amount of sharpening applied to the pasted face. It is a float value, with higher values resulting in more sharpening. The default value is 1. Sharpening can enhance the details of the pasted face, making it stand out more against the target image.

Image Paste Face Output Parameters:

output_image

This parameter is the resulting composite image after the cropped face has been pasted and blended onto the target image. It is returned as a PIL Image object. The output image combines the content of the target image with the pasted face, creating a seamless composite.

output_mask

This parameter is the mask used during the blending process. It is returned as a PIL Image object in RGB mode. The mask helps to control the blending of the cropped face with the target image, ensuring a smooth transition between the two.

Image Paste Face Usage Tips:

  • To achieve a natural look, experiment with the blend_amount parameter. A value around 0.25 often provides a good balance between visibility and blending.
  • Use the sharpen_amount parameter to enhance the details of the pasted face, especially if the face appears too soft or blurry after blending.
  • Ensure that the crop_data accurately reflects the coordinates and dimensions of the cropped face to avoid misalignment when pasting onto the target image.

Image Paste Face Common Errors and Solutions:

Unable to find cascade XML file at <path>

  • Explanation: This error occurs when the face detection cascade file is missing or not found at the specified path.
  • Solution: Ensure that the cascade XML files are correctly placed in the specified directory. You may need to pull the latest files from the repository at https://github.com/WASasquatch/was-node-suite-comfyui.

No faces found in the image!

  • Explanation: This error indicates that the face detection algorithm did not find any faces in the provided image.
  • Solution: Verify that the image contains clear and visible faces. You may also try using a different face detection cascade or adjusting the parameters of the face detection algorithm.

Face found with: face_recognition model

  • Explanation: This message indicates that a face was found using the face recognition model, but it is not an error.
  • Solution: No action needed. This is an informational message confirming that a face was detected.

Misalignment of the pasted face

  • Explanation: This issue occurs when the crop_data does not accurately reflect the position and size of the cropped face.
  • Solution: Double-check the crop_data values to ensure they match the coordinates and dimensions of the cropped face in the original image. Adjust as necessary to align the pasted face correctly.

Image Paste Face Related Nodes

Go back to the extension to check out more related nodes.
WAS Node Suite
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.