ComfyUI  >  Nodes  >  ComfyUI-AniPortrait >  AniPortraitLoader

ComfyUI Node: AniPortraitLoader

Class Name


chaojie (Account age: 4831 days)
Latest Updated
Github Stars

How to Install ComfyUI-AniPortrait

Install this extension via the ComfyUI Manager by searching for  ComfyUI-AniPortrait
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-AniPortrait 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

AniPortraitLoader Description

Specialized node for loading and processing animated portrait images in ComfyUI, streamlining image conversion and preparation for AI artists.


AniPortraitLoader is a specialized node designed to facilitate the loading and processing of animated portrait images within the ComfyUI framework. This node is particularly useful for AI artists who work with animated portraits, as it streamlines the process of converting and preparing images for further manipulation and analysis. By leveraging advanced image processing techniques, AniPortraitLoader ensures that the input images are correctly formatted and optimized for subsequent operations, such as face detection and landmark extraction. This node is essential for achieving high-quality results in animated portrait projects, providing a seamless and efficient workflow for artists.

AniPortraitLoader Input Parameters:


The ref_image_path parameter specifies the file path to the reference image that will be loaded and processed. This image serves as the basis for the animated portrait and must be in a compatible format (e.g., JPEG, PNG). The quality and resolution of the reference image can significantly impact the final output, so it is recommended to use high-quality images. There are no strict minimum or maximum values for this parameter, but the default value should be a valid file path.


The config parameter refers to the configuration file that contains various settings and parameters for the image processing pipeline. This file is typically in YAML format and includes details such as model paths, detection thresholds, and other relevant options. The configuration file ensures that the node operates with the correct settings, allowing for customization and fine-tuning of the processing steps. The default value should be a valid path to a configuration file.


The min_face_detection_confidence parameter sets the minimum confidence threshold for the face detection algorithm. This value determines how confident the algorithm must be in detecting a face before it is considered valid. A higher value results in fewer false positives but may miss some faces, while a lower value increases the likelihood of detecting all faces but may include false positives. The typical range for this parameter is between 0.0 and 1.0, with a default value around 0.5.


The args parameter is a collection of additional arguments that can be passed to the node for further customization. These arguments may include settings such as image dimensions (W and H), seed values for randomization, and other relevant options. The exact nature of these arguments can vary depending on the specific requirements of the project. There are no strict minimum or maximum values, but the default values should be appropriate for the intended use case.

AniPortraitLoader Output Parameters:


The ref_image_pil output parameter provides the reference image in PIL (Python Imaging Library) format. This format is widely used in image processing tasks and allows for easy manipulation and analysis of the image. The ref_image_pil output is essential for subsequent steps in the animated portrait pipeline, such as face detection and landmark extraction.


The ref_image_np output parameter provides the reference image in NumPy array format. This format is useful for numerical operations and integration with other libraries, such as OpenCV. The ref_image_np output is crucial for tasks that require direct access to the pixel data, such as resizing and color conversion.


The lmks output parameter contains the facial landmarks extracted from the reference image. These landmarks are represented as a NumPy array of coordinates, which indicate the positions of key facial features. The lmks output is vital for tasks that involve facial analysis and manipulation, such as animation and expression transfer.


The ref_pose output parameter provides a visualization of the facial landmarks overlaid on the reference image. This visualization helps in verifying the accuracy of the landmark extraction and serves as a useful reference for further processing steps. The ref_pose output is typically in image format and can be displayed or saved for inspection.

AniPortraitLoader Usage Tips:

  • Ensure that the reference image is of high quality and resolution to achieve the best results in the animated portrait pipeline.
  • Customize the configuration file to match the specific requirements of your project, including model paths and detection thresholds.
  • Adjust the min_face_detection_confidence parameter to balance between accuracy and false positives in face detection.
  • Use the args parameter to specify additional settings, such as image dimensions and seed values, to fine-tune the processing steps.

AniPortraitLoader Common Errors and Solutions:

No face detected.

  • Explanation: This error occurs when the face detection algorithm fails to identify any faces in the reference image.
  • Solution: Ensure that the reference image contains a clear and unobstructed view of a face. Adjust the min_face_detection_confidence parameter to a lower value to increase the likelihood of detecting faces.

Invalid file path.

  • Explanation: This error occurs when the specified file path for the reference image or configuration file is invalid or does not exist.
  • Solution: Verify that the file paths provided for the ref_image_path and config parameters are correct and point to existing files.

Configuration file error.

  • Explanation: This error occurs when there is an issue with the configuration file, such as incorrect formatting or missing parameters.
  • Solution: Check the configuration file for any syntax errors or missing parameters. Ensure that all required settings are correctly specified.

Image processing error.

  • Explanation: This error occurs when there is an issue during the image processing steps, such as color conversion or resizing.
  • Solution: Ensure that the reference image is in a compatible format and that all required libraries (e.g., OpenCV, NumPy) are correctly installed and configured.

AniPortraitLoader Related Nodes

Go back to the extension to check out more related nodes.

© 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.