ComfyUI_InstantID

1570

ApplyInstantID

ApplyInstantID Node Documentation

Overview

The ApplyInstantID node is part of the ComfyUI InstantID extension, which provides native support for InstantID integration within the ComfyUI ecosystem. This node allows users to apply InstantID features to an image, which can enhance or modify the generated images by leveraging the InstantID model and a reference image.

Functionality

The ApplyInstantID node processes images by utilizing the InstantID model's capabilities. It applies cross-attention techniques to integrate the characteristics of a reference image into the output, aiming for a seamless blend of the target style and preserve the identity or particular features of the reference image.

Inputs

The node requires several inputs to function correctly:

  • instantid: The InstantID model that is being used for processing.
  • insightface: The face analysis model that helps in feature extraction, especially for facial images.
  • control_net: A Control Net model that influences how the control over the image generation is applied.
  • image: The reference image whose features are to be applied to the output.
  • model: The base model used for processing.
  • positive: Conditioning data for positive direction in image processing.
  • negative: Conditioning data for negative direction in image processing.
  • weight: The strength of how much the InstantID effect should be applied, with a given default, minimum, and maximum values.
  • start_at: The commencement point in the process as a percentage.
  • end_at: The conclusion point in the process as a percentage.

Optional Inputs

  • image_kps: An image for keypoints if different from the reference image.
  • mask: An optional mask that could be applied to the image for targeted effects.

Outputs

The node produces three outputs:

  • MODEL: The modified model with applied InstantID attention changes.
  • positive: The conditioned output based on positive data.
  • negative: The conditioned output influenced by the negative data.

Usage in ComfyUI Workflows

In a ComfyUI workflow, the ApplyInstantID node can be used to achieve various effects such as identity blending, facial recognition enhancements, or applying specific features of a reference image to the target image. It's a robust tool for creative projects where maintaining certain image characteristics is crucial, like in character creation, style transfers, or compositional modifications where the likeness or theme of the original image should be preserved.

Example Workflow

  • Load InstantID Model: Begin by loading the InstantID model using the InstantIDModelLoader node.
  • Image Analysis: Use InstantIDFaceAnalysis for extracting facial features.
  • Face Keypoints Preprocessing: If needed, preprocess images using FaceKeypointsPreprocessor to identify key facial attributes.
  • Apply InstantID: Process the image with this node to apply the InstantID transformations.
  • Generate Output: Proceed with further image generation or adjustments using the enhanced model.

Special Features and Considerations

  • Noise Injection: The node automatically injects noise at a default rate of 35%, which helps mitigate over-strengthening of the identity effect and increases the resemblance to the reference image. Users can adjust this further with the ApplyInstantIDAdvanced node.

  • Interactive Use: The node can be used in conjunction with other nodes like RescaleCFG to fine-tune the configurations globally.

  • Resolution Consideration: It's recommended to work with resolutions slightly different from standard dimensions (e.g., use 1016×1016 instead of 1024×1024) to avoid unwanted watermarks from training data attributes.

  • Weight Tuning: Users are advised to fine-tune weights and other parameters to adapt to specific project needs, especially when different blending strengths between identity preservation and control nets are desired.

This node empowers users to infuse unique InstantID capabilities into their ComfyUI projects, enabling smoothly integrated identity transfers and more intricate aesthetic transformations.