ConsistentID: Portrait Generation with Multimodal Fine-Grained Identity Preserving
Jiehui Huang Xiao Dong Wenhui Song Hanhui Li Jun Zhou Yuhao Cheng Shutao Liao Long Chen Yiqiang Yan Shengcai Liao Xiaodan Liang




 



ConsistentID








Huang et al.














1Shenzhen Campus of Sun Yat-sen University, 
2Zhuhai Campus of Sun Yat-sen University,
3Lenovo Research, 
4Inception Institute of Artificial Intelligence 
 

{xdliang328}@gmail.com 

<https://ssugarwh.github.io/consistentid.github.io/>















ConsistentID
    < g r a p h i c s >
: Portrait Generation with Multimodal Fine-Grained Identity Preserving
    Jiehui Huang1 Xiao Dong2 Wenhui Song1 Hanhui Li1 Jun Zhou1 Yuhao Cheng3 Shutao Liao1 Long Chen3 Yiqiang Yan3 Shengcai Liao4 Xiaodan Liang1*
    April 29, 2024
===============================================================================================================================================



Xiaodan Liang is the corresponding author. 




type=figure


    < g r a p h i c s >


figure Given some images of input IDs, our ConsistentID can generate diverse personalized ID images based on text prompts using only a single image.



 






















Diffusion-based technologies have made significant strides, particularly in personalized and customized facial generation.  
However, existing methods face challenges in achieving high-fidelity and detailed identity (ID) consistency, primarily due to insufficient fine-grained control over facial areas and the lack of a comprehensive strategy for ID preservation by fully considering intricate facial details and the overall face. 
To address these limitations, we introduce ConsistentID, an innovative method crafted for diverse identity-preserving portrait generation under fine-grained multimodal facial prompts, utilizing only a single reference image.  
ConsistentID comprises two key components: a multimodal facial prompt generator that combines facial features, corresponding facial descriptions and the overall facial context to enhance precision in facial details, and an ID-preservation network optimized through the facial attention localization strategy, aimed at preserving ID consistency in facial regions.  
Together, these components significantly enhance the accuracy of ID preservation by introducing fine-grained multimodal ID information from facial regions.  
To facilitate training of ConsistentID, we present a fine-grained portrait dataset, FGID, with over 500,000 facial images, offering greater diversity and comprehensiveness than existing public facial datasets. 
Experimental results substantiate that our ConsistentID achieves exceptional precision and diversity in personalized facial generation, surpassing existing methods in the MyStyle dataset.  
Furthermore, while ConsistentID introduces more multimodal ID information, it maintains a fast inference speed during generation. 

Our codes and pre-trained checkpoints will be available at
https://github.com/JackAILab/ConsistentID.


  







§ INTRODUCTION





Recently, image-generation technology  <cit.> has undergone significant evolution, driven by the emergence and advancement of diffusion-based <cit.> text-to-image large models like GLIDE <cit.>, DALL-E 2 <cit.>, Imagen<cit.>, Stable Diffusion (SD) <cit.>, eDiff-I <cit.> and RAPHAEL <cit.>. 
This progress has given rise to a multitude of application approaches across diverse scenarios.  
 Positioned as the central focus of these application approaches, personalized and customized portrait generation has attracted widespread attention in both academic and industrial domains, owing to its extensive applicability in downstream tasks such as E-commerce advertising,  personalized gift customization and virtual try-ones. 
 
 
 








The primary challenge in customized facial generation lies in maintaining facial image consistency across different attributes based on one or multiple reference images, leading to two key issues: ensuring accurate identity (ID) consistency and achieving high-fidelity, diverse facial details.  
Current text-to-image models <cit.>, despite incorporating structural and content guidance, face limitations in accurately controlling personalized and customized generation, particularly concerning the fidelity of generated images to reference images. 

To improve the precision and diversity of personalized portrait generation with reference images, numerous customized methodologies have emerged, meeting users' demands for high-quality customized images.  
These personalized approaches are categorized based on whether fine-tuning occurs during inference, resulting in two distinct types: test-time fine-tuning and direct inference.  
Test-time fine-tuning:  This category includes methods such as Textual Inversion <cit.>, HyperDreambooth<cit.>, and CustomDiffusion<cit.>. 
Users can achieve personalized generation by providing a set of target ID images for post-training. 
Despite achieving commendable high-fidelity results, the quality of the generated output depends on the quality of manually collected data.  
Additionally, the manual collection of customized data for fine-tuning introduces a labor-intensive and time-consuming aspect, limiting its practicality.
Direct inference: Another category of models, including IP-Adapter <cit.>, Fastcomposer<cit.>, Photomaker<cit.>, and InstantID<cit.>, adopts a single-stage inference approach.  
These models enhance global ID consistency by either utilizing the image as a conditional input or manipulating image-trigger words. 
 However, most methods frequently overlook fine-grained information, such as landmarks and facial features.  
 Although InstantID improves ID consistency to some extent by introducing landmarks, the visual prompt landmark restricts the diversity and variability of key facial regions, leading to stiff generated facial features. 
In summary, two pivotal challenges requiring meticulous consideration persist in personalized portrait generation: 1) neglect of fine-grained facial information and 2) identity inconsistency between facial areas and the whole face, as illustrated in Figure <ref>. 






To address these challenges, we introduce a novel method, ConsistentID, crafted to maintain identity consistency and capture diverse facial details through multimodal fine-grained ID information, employing only a single facial image while ensuring high fidelity.  
Figure <ref> provides the overview of our ConsistentID. 
ConsistentID comprises two key modules: 1) a multimodal facial prompt generator  and 2) an ID-preservation network.  
 The former component includes a fine-grained multimodal feature extractor and a facial ID feature extractor, enabling the generation of more detailed facial ID features using multi-conditions, incorporating facial images, facial regions, and their corresponding textual descriptions extracted from the multimodal large language model LLaVA1.5<cit.>.  
Utilizing the facial ID features obtained from the initial module, we feed them into the latter module, promoting ID consistency across each facial region via the facial attention localization strategy.  
 Additionally, we recognize the limitations of existing portrait datasets<cit.>, particularly in capturing diverse and fine-grained identity-preserving facial details, crucial for the effectiveness of ConsistentID.  
 To address this, we introduce the inaugural Fine-Grained ID Preservation (FGID) dataset, along with a fine-grained identity consistency metric, providing a unique and comprehensive evaluation approach to enhance our training and performance evaluation in facial details. 
 



In summary, our contributions are as follows. 


  ∙  We introduce ConsistentID to improve fine-grained customized facial generation by incorporating detailed descriptions of facial regions and local facial features. 
Experimental results showcase the superiority of ConsistentID in terms of ID consistency and high fidelity, even with just one reference image. 
Simultaneously, despite the introduction of more detailed multimodal fine-grained ID information in ConsistentID, the inference speed remains relatively efficient, as shown in Table  <ref>






  ∙  We devise an ID-preservation network optimized by facial attention localization strategy, enabling more accurate ID preservation and more vivid facial generation. 
This mechanism ensures the preservation of ID consistency within each facial region by preventing the blending of ID information from different facial regions. 




  ∙ 

We introduce the inaugural fine-grained facial generation dataset, FGID, addressing limitations in existing datasets for capturing diverse identity-preserving facial details.  
This dataset includes facial features and descriptions of both facial regions and the entire face, complemented by a novel fine-grained identity consistency metric, establishing a comprehensive evaluation framework for fine-grained facial generation performance.




§ RELATED WORK


Text-to-image Diffusion Models. Diffusion models have made notable advancements, garnering significant attention from both industry and academia, primarily due to their exceptional semantic precision and high fidelity.  
The success of these models can be attributed to the utilization of high-quality image-text datasets, continual refinement of foundation modality encoders, and the iterative enhancement of controlled modules. 
In the domain of text-to-image generation, the encoding of text prompts involves utilizing a pretrained language encoder, such as CLIP<cit.>, to transform it into a latent representation, subsequently inserted into the diffusion model through the cross-attention mechanism.
Pioneering models in this realm encompass GLIDE <cit.>, SD <cit.>, DiT <cit.>, among others, with further developments and innovations continuing to emerge <cit.>.  
A notable advancement in this lineage is SDXL <cit.>, which stands out as the most powerful text-to-image generation model. 
It incorporates a larger Unet <cit.> model and employs two text encoders for enhanced semantic control and refinement.  
As a follow-up, we use SD <cit.> model as our base model to achieve personalized portrait generation. 



Personalization in Diffusion Models. 
Due to the potent generative capability of the text-to-image diffusion model, many personalized generation models are constructed based on it.  
The mainstream personalized image synthesis methods are categorized into two groups based on whether fine-tuning occurs during test time.  
One group relies on optimization during test-time, with typical methods including Dreambooth<cit.>, Textual Inversion<cit.>, IP-Adapter<cit.>, ControlNet<cit.>, Custom Diffusion<cit.>, and LoRA<cit.>. Dreambooth and Textual Inversion fine-tune a special token S* to learn the concept during the fine-tuning stage.  
In contrast, IP-Adapter, ControlNet, and LoRA insert image semantics using an additional learned module, such as cross-attention, to imbue a pre-trained model with visual reasoning understanding ability.  

Despite their advancements, these methods necessitate resource-intensive backpropagation during each iteration, making the learning process time-consuming and limiting their practicality.    
Recently, researchers have focused more on methods bypassing additional fine-tuning or inversion processes, mainly including IP-Adapter <cit.>, FastComposer<cit.>, PhotoMaker<cit.>, and InstantID<cit.>.  
This type of method performs personalized generation using only an image with a single forward process, which is more advantageous in calculation efficiency compared to the former type.  
However, we observe that fine-grained facial features are not fully considered in the training process, easily leading to ID inconsistency or lower image quality, as shown in Figure <ref>.  
To address these limitations, we introduce ConsistentID, aiming to mitigate the ID-preserving issue and enhance fine-grained control capabilities while reducing data dependency.  
Our approach incorporates a specially designed facial encoder using detailed descriptions of facial features and local image conditions as inputs.   
Additionally, we contribute to a new landmark in the facial generation field by proposing: 1) the introduction of the first fine-grained facial generation datasets and 2) the presentation of a new metric that redefines the performance evaluation of facial generation.  




§ METHOD


















    













 §.§ Multimodal Facial Prompt Generator





Fine-grained Multimodal Feature Extractor. In this module, we independently learn fine-grained facial visual and textual embeddings and feed them into the designed lightweight facial encoder to generate fine-grained multi-modal facial features. 
Three key components are used in the module, including text embedding, facial embedding and facial encoder. 


1) Text Embedding.
Motivated by recent works<cit.> in personalized facial generation, our goal is to introduce more detailed and accurate facial descriptions.  
To achieve this, we input the entire facial image into the Multimodal Large Language Model (MLLM) LLaVA1.5 <cit.> using the command prompt `Describe this person's facial features, including face, ears, eyes, nose, and mouth' to obtain a description at the facial feature level.  

Subsequently, we replace the words `face, ears, eyes, nose, and mouth' in these feature-level descriptions with the delimiter `<facial>' and concatenate them with the captions of the entire facial image. 
Finally, the concatenated descriptions are fed into the pre-trained text encoder to learn fine-grained multimodal facial features.  
With both visual and textual descriptions containing more precise ID information, our ConsistentID effectively mitigates ID inconsistency issues in facial details. 





2) Facial Embedding. In contrast to existing methods <cit.>, <cit.>. that rely on brief textual descriptions or coarse-grained visual prompts, our goal is to integrate more fine-grained multimodal control information at the facial region level. 
This aims to achieve improved accuracy in identity (ID) consistency and diverse facial generation. 
To enrich the ID-preservation information, we delve into more fine-grained facial features, including eye gaze, earlobe characteristics, nose shape, and others.  
Following the previous method <cit.>,we employ the pre-trained face model BiSeNet <cit.> to extract segmentation masks of facial areas, encompassing eyes, nose, ears, mouth, and other regions, from the entire face.  
Subsequently, the facial region images obtained from these masks are fed into the pre-trained image encoder to learn fine-grained facial embeddings. 
The inclusion of facial regions' features results in fine-grained facial embeddings containing more abundant ID-preservation information compared to features learned from the entire face.  
More detailed processes are outlined in the supplementary materials. 







3) Facial Encoder. Previous studies <cit.> have demonstrated that relying solely on visual or textual prompts cannot comprehensively maintain ID consistency both in appearance and semantic details.   
While IP-Adapter makes the initial attempt to simultaneously inject multimodal information through two distinct decoupled cross-attention mechanisms, it overlooks  ID information from crucial facial regions, rendering it susceptible to ID inconsistency in facial details. 




To cultivate the potential of image and text prompts, inspired by the token fusion approach of multimodal large language models, we design a facial encoder to seamlessly integrate visual prompts with text prompts along the dimension of the text sequence, as depicted in Figure <ref>.  
Specifically, given a facial embedding and a caption embedding, the facial encoder initially employs a self-attention mechanism to align the entire facial features with facial areas' features, resulting in aligned features denoted as f^i∈ℝ^N × D, where N=5 represents the number of facial feature areas, including eyes, mouth, ears, nose, and other facial regions, and D represents the dimension of text embeddings.  
In cases where face images lack a complete set of N facial features, the missing features are padded using an all-zero matrix.  
Subsequently, we replace the text features at the position of the delimiter `<facial>' with f^i, and then employ two multi-layer perceptron (MLP) to learn the text conditional embeddings.

Facial ID Feature Extractor. 
Except for the input condition of fine-grained facial features, we also inject the character's overall ID information into our ConsistentID as a visual prompt.  
This process relies on the pre-trained CLIP image encoder and the pre-trained face model from the specialized version of the IP-Adapter <cit.> model, IPA-FaceID-Plus <cit.>. 
Specifically, the complete facial images are concurrently fed into both encoders for visual feature extraction. 
After these two encoders, a lightweight projection module, with parameters initialized by IPA-FaceID-Plus, is used to generate the face embedding of the whole image.  












 §.§ ID-Preservation network














The effectiveness of image prompts in pre-trained text-to-image diffusion models <cit.> significantly enhances textual prompts, especially for content that is challenging to describe textually.  
However, visual prompts alone often provide only coarse-grained control due to the semantic fuzziness of visual tokens. 
To solve this, we follow the IP-Adapter and integrate fine-grained multimodal ID prompts and overall ID prompts into the UNet model through the cross-attention module to achieve precise ID preservation.  

Motivated by Fastcomposer <cit.>, we introduce an ID-consistent network to maintain consistency in local ID features by directing the attention of facial features to align with the corresponding facial regions. 
This optimization strategy is derived from the observation that traditional cross-attention maps tend to simultaneously focus on the entire image, posing a challenge in maintaining ID features during the generation of facial regions.  
To address this issue, we introduce facial segmentation masks during training to obtain attention scores learned from the enhanced text cross-attention module for facial regions.



Let P ∈ [0, 1]^h × w × n represent the cross-attention map that connects latent pixels to multimodal conditional embeddings at each layer, where P[i, j, k] signifies the attention map from the k-th conditional token to the (i, j) latent pixel.  
Ideally, the attention maps of facial region tokens should focus exclusively on facial feature areas, preventing the blending of identities between facial features and averting propagation to the entire facial image.  
To achieve this goal, we propose localizing the cross-attention map using the segmentation mask of reference facial regional features. 


Let M = {m_1, m_2, m_3, ..., m_N} represent the segmentation masks of the reference portrait, I = {i_1, i_2, i_3, ..., i_N} as the index list indicating which facial feature corresponds to visual and textual tokens in the multimodal prompt, and P_i = P[:, :, i] ∈ [0, 1]^h × w denote the cross-attention map of the i-th facial region's token, where I is generated using the special token `<facial>'.  


Given the cross-attention map P_i_j, it should closely correspond to the facial region identified by the j-th multimodal token, segmented by m_j.  
To achieve this, we introduce m_j and apply it to P_i_j to obtain its corresponding activation region, aligning with the segmentation mask m_j of the j-th facial feature token. 
For achieving this correspondence, a balanced L1 loss is employed to minimize the distance between the cross-attention map and the segmentation mask:

    ℒ_loc =1/N∑_j=1^N(mean(P_i_j[1-m_j])-mean(P_i_j[m_j])),

where N denotes the number of the segmentaion masks. This loss formulation aims to ensure that each facial feature token's attention map aligns closely with its corresponding segmentation mask, promoting precise and localized attention during the generation process.







 §.§ Training and Inference Details







During the training process, we optimize only the parameters of the facial encoder and the projection module within the overall facial ID feature extractor, while maintaining the parameters of the pre-trained diffusion model in a frozen state. 
The training data for ConsistentID consists of facial image-text pairs.  
In ConsistentID, to enhance text controllability, we prioritize the caption as the primary prompt and concatenate it with more detailed descriptions of facial regions extracted from LLaVA1.5, forming the ultimate textual input.  
Regarding training loss functions, they align with those used in the original stable diffusion models and are expressed as:

    ℒ_noise=𝔼_z_t, t, C_f, C_l, ϵ∼𝒩(0,1)[ϵ-ϵ_θ(z_t, t, C_f, C_i)_2^2],

where C_l denotes the facial ID feature, and C_f is the fine-grained multimodal facial feature.  

The total loss function is ℒ_total = ℒ_noise + ℒ_loc.




During the inference process,  we employ a straightforward delayed primacy condition as similar to Fastcomposer.  
This allows the use of a separate text representation initially, followed by enhanced text representation after a specific step, effectively balancing identity preservation and editability.  
More discussions are provided in the supplementary materials. 








 §.§ Fine-grained Human Dataset Construction










Our ConsistentID necessitates detailed facial features and corresponding textual prompts to address issues like deformation, distortion, and blurring prevalent in current facial generation methods.  
However, existing datasets <cit.> predominantly focus on local facial areas and lack fine-grained ID annotations for specific features such as the nose, mouth, eyes, and ears.

To tackle this issue, we introduce a dataset pipeline outlined in the supplementary materials to create our dataset FGID. 
This dataset encompasses comprehensive fine-grained ID information and detailed facial descriptions, which are crucial for training the ConsistentID model. 
 

Our FGID dataset, comprising 525,258 images is a compilation from diverse public datasets such as FFHQ <cit.>, CelebA<cit.>, SFHQ<cit.>, etc, including about 524,000 training data. 


This dataset is tailored to encompass both whole-face and facial feature information, providing richer textual and visual details for model training[In the future, we intend to introduce additional datasets, including higher-level datasets like LAION-Face<cit.> and self-collected multi-ID data, to further augment diversity and information content.].  
More details about the FGID dataset are available in the supplementary materials, providing information on its statistics, characteristics, and related ethical considerations. 
In the following, we elaborate on the multi-modal data handling process.  Textual Data: For textual facial descriptions, MLLM LLaVA1.5 is utilized to extract detailed information using an embedded prompt `Please describe the people in the image, including their gender, age, clothing, facial expressions, and any other distinguishing features'.  Visual Data: BiSeNet <cit.> and InsightFace<cit.> models are deployed to capture both whole-face ID information and facial feature information, ensuring comprehensive identity details. 






§ EXPERIMENT


Experimental Implements. In ConsistentID, we employ the SD1.5 model as the foundational text-to-image model.  
 
For the fine-grained multimodal feature extractor, we initialize the parameters of all text encoders and image encoders with CLIP-ViT-H <cit.> and utilize its image projection layers to initialize the learnable projection in the overall facial ID feature extractor.  
The entire framework is optimized using Adam <cit.> on 8 NVIDIA 3090 GPUs, with a batch size of 16.  
We set the learning rate for all trainable modules to  1 × 10^-4. 
During training, we probabilistically remove 50% of the background information from the characters with a 50% probability to mitigate interference.    
Additionally, to enhance generation performance through classifier guidance, there is a 10% chance of replacing the original updated text embedding with a zero text embedding.  
In inference, we employ delayed topic conditioning <cit.> to resolve conflicts between text and ID conditions.  
We utilize a 50-step DDIM <cit.> sampler, and the scale for classifier-guided settings is set to 5. 











Experimental Metrics.  To assess the effectiveness and efficiency of ConsistentID, we employ six widely used metrics <cit.>: CLIP-I <cit.>, CLIP-T <cit.>, DINO <cit.>, FaceSim <cit.>, FID <cit.>, and inference speed. 
CLIP-T measures the average cosine similarity between prompt and image CLIP embeddings, evaluating ID fidelity.  
CLIP-I calculates the average pairwise cosine similarity between CLIP embeddings of generated and real images, assessing prompt fidelity.  
DINO represents the average cosine similarity between ViT-S/16 embeddings of generated and real images, indicating fine-grained image-level ID quality.  
FaceSim determines facial similarity between generated and real images using FaceNet <cit.>.  
FID gauges the quality of the generated images <cit.>.  
Inference speed denotes the calculation time under the same running environment.  
Additionally, we introduce a novel metric, FGIS (fine-grained identity similarity), to assess ID quality at the region level.  
FGIS is computed as the average cosine similarity between DINO embeddings of the generated facial regions in reference and generated images.  
A higher FGIS value indicates increased ID fidelity in the generated facial regions. 












 



 §.§ Comparation Results

To demonstrate the effectiveness of ConsistentID, we conduct a comparative analysis against state-of-the-art methods, including Fastcomposer <cit.>, IP-Adapter<cit.>, Photomaker <cit.>, and InstantID <cit.>.  
Our focus is on personalized generation utilizing only one reference image. 
We utilize the officially provided models, use the default parameters for each method, and restrict the inference to a single reference image. 
In alignment with the Photomaker methodology, we employ the Mystyle <cit.> dataset for quantitative assessment and incorporate over ten identity datasets for visualization. 

Quantitative results: 
Following Photomaker <cit.>, we use the test dataset from Mystyle <cit.>, using MLLM LLaVA1.5 to obtain facial descriptions during inference.  
The quantitative comparison is conducted under the universal recontextualization setting, utilizing a set of metrics to benchmark various aspects.  




The results are showcased in Table <ref>. 
A thorough analysis of the table demonstrates that ConsistentID consistently outperforms other methods across most evaluated metrics, and surpasses other IP-Adapter-based methods in terms of generation efficiency.  
This is attributed to ConsistentID's fine-grained ID preservation capability and the efficiency of the lightweight multimodal facial prompt generator. Regarding the FID metric, the lower performance could be primarily attributed to the limited generative capability of the base model SD1.5.

Visualized comparisons under different scenarios: To visually demonstrate the advantages of ConsistentID, we present the text-edited generation results of all methods using reference images of five distinct identities in Figure <ref>.  
This visualization highlights ConsistentID's capability to produce vibrant and realistic images, with a particular emphasis on facial features.  
To further elucidate this observation, we selectively magnify and compare specific facial details across all methods in four identities, as depicted in Figure <ref>.   
Our model showcases exceptional ID preservation capabilities in facial details, especially in the eyes and nose, attributed to fine-grained multimodal prompts and facial regions' ID information. 







 
 





 
 

To validate the accurate text understanding capability, we additionally show style-based and action-based text-edited results in Figure <ref>.  
We observe that the generated images from InstantID lack sufficient flexibility in facial poses.  
This limitation is likely attributed to Controlnet-based prompt insertion methods, which may easily overlook textual prompts. 
Simultaneously, we notice that, while Photomaker can accurately comprehend textual and visual prompts, it lacks the ID consistency of facial regions. 
In contrast, our ConsistentID achieves optimal generation results due to its precise understanding of textual and visual prompts.
This further emphasizes the significance of multimodal fine-grained ID information. 
To fully show the advantages of our ConsistentID, more visualized comparisons are provided in the supplementary materials, including comparative experiments with fine-tuning-based models Dreambooth <cit.>, Textual Inversion <cit.>, and CustomDiffusion <cit.>. 

Moreover, we compare ConsistentID with models specifically designed using IP-Adapter as the base model in Figure <ref>. 
From the figure, it is evident that this series of works currently falls short in achieving highly detailed ID preservation in facial areas without fine-grained textual and visual prompts. 
In contrast, ConsistentID exhibits a robust capability to preserve the integrity of facial ID and seamlessly blend it into various styles, utilizing multimodal fine-grained prompts. 
This comparison emphasizes the superiority of ConsistentID in retaining identity while simultaneously maintaining flexibility and control over style.  










  

  

















































 §.§ Human Study

  

We also investigate user preferences regarding image fidelity, fine-grained ID fidelity, and overall ID fidelity through surveys.  In Figure <ref>, we present a visualization of the proportion of total votes received by each method.  
Across all three metric dimensions, ConsistentID holds the most significant share.

















 §.§ Ablation Study



















































































Facial ID Types: 
We conducted an ablation study on facial ID, considering three variations: using solely overall facial ID, incorporating our designed fine-grained ID, and concurrently leveraging both facial ID and our designed fine-grained ID.  
Results in Table <ref> show that using fine-grained ID features alone enhances ID consistency in facial regions, indicated by an increased DINO value.  
However, overall ID preservation, assessed by FaceSim, cannot be adequately maintained. 
Utilizing only overall facial ID enhances facial similarity, but facial feature consistency diminishes, performing significantly worse in CLIP-I and DINO metrics compared to using only facial features.  
Combining both overall facial ID and fine-grained ID leads to a balanced improvement in the model's overall ID fidelity compared to using only overall facial ID and fine-grained ID. 





Facial attention localization strategy: We investigated the effectiveness of facial attention localization strategies during training.  
The first strategy involves ℒ_noise, while the second strategy adds attention loss ℒ_loc.   
From Table <ref>, we observe that ConsistentID experiences a clear improvement in metrics related to facial feature consistency and fine-grained ID preservation when ℒ_loc is considered.  
This confirms the effectiveness of maintaining ID consistency between facial regions and the entire face during the training process. 

Image projection module: Additionally, we compared two training strategies.  
The first involves frozen weights of the image projection model and only training our designed FacialEncoder.  
The second strategy involves training both simultaneously. The results from Table <ref> indicate that concurrently training ImageProjection brings the maximum benefits to the model. 
This is attributed to our model being an ID preservation method of cooperative training with multimodal text and image information. 

The LLaVA1.5 usage: In Table <ref> (bottom), we present comparative results conducted with textual descriptions using and not using LLaVA 1.5.  
When LLaVA1.5 is not utilized, we use the prompt `The person has one nose, two eyes, two ears, and a mouth' to replace detailed descriptions of facial regions.  
We observe an improvement in the generated quality with the introduction of LLaVA1.5 in most metrics, with only CLIP-I showing degradation.  
This degradation is attributed to the local attention of CLIP, which tends to overlook finer facial details. 

Different Facial Areas' Number: To explore the influence of different numbers of facial areas, we adhere to the sequence `face, nose, eyes, ears, and mouth' and incrementally introduce the selected facial areas, as depicted in Figure <ref>.   
 We note a progressive enhancement in image quality as the number of facial regions increases, attributed to the richer multi-modal prompts.  
 However, with regard to the CLIP-T metric, detailed textual descriptions encompass a greater variety of objects, potentially leading to oversight by the CLIP model.












































 §.§ Applications

Following the approach proposed in Photomaker <cit.>, we verify facial high-fidelity and naturalness through two downstream applications presented in Figure <ref>.  
These applications involve `Change Age & Gender' and `Bringing a person in an old photo into reality'. 
Compared to Photomaker and InstantID, our ConsistentID demonstrates robust capabilities in maintaining ID consistency, facial high-fidelity, and natural expressions. 
This superiority is attributed to the effective fine-grained ID preservation of facial features. 
















































































§ CONCLUSION AND LIMITATION








In this work, we introduce ConsistentID, an innovative method designed to maintain identity consistency and capture diverse facial details.  
We have developed two novel modules: a multimodal facial prompt generator and an identity preservation network.  
The former is dedicated to generating multimodal facial prompts by incorporating both visual and textual descriptions at the facial region level.  
The latter aims to ensure ID consistency in each facial area through a facial attention localization strategy, preventing the blending of ID information from different facial regions.  
By leveraging multimodal fine-grained prompts, our approach achieves remarkable identity consistency and facial realism using only a single facial image.  
Additionally, we present the FGID dataset, a comprehensive dataset containing fine-grained identity information and detailed facial descriptions essential for training the ConsistentID model.   Experimental results demonstrate outstanding accuracy and diversity in personalized facial generation, surpassing existing methods on the MyStyle dataset. 

Limitations: The utilization of MLLM in our approach may introduce limitations that could affect specific facets of model performance.  
The constraints posed by limited pose and expression may restrict the diversity of our method, impacting its capability to handle facial variations.  
These limitations underscore the necessity for in-depth discussion and exploration, specifically in addressing challenges related to pose, expression, and the integration of GPT-4V. 






















































splncs04





 



ℒ_loc






Huang et al.




1Shenzhen Campus of Sun Yat-sen University, 
2Zhuhai Campus of Sun Yat-sen University,
3Lenovo Research, 
4Inception Institute of Artificial Intelligence 
 




Appendix Materials of ConsistentID
    Jiehui Huang1 Xiao Dong1 Wenhui Song1 Hanhui Li1 Jun Zhou2 Yuhao Cheng3 Shutao Liao1 Long Chen3 Yiqiang Yan3 Shengcai Liao4 Xiaodan Liang1
    April 29, 2024
==============================================================================================================================================


















§ COMPARE WITH MORE FINE-TUNING-BASED MODELS




We individually fine-tune CustomDiffusion <cit.>, Dreambooth<cit.>, and LoRA <cit.> using 192 face images of Obama and 158 of Taylor Swift. 
These fine-tuned models are then utilized for text-to-image inference. 
To ensure a fair comparison, all models are based on Stable Diffusion v1.5 <cit.>. 


In Figure <ref>, we compare the proposed ConsistentID with these fine-tuned models. 
It is noteworthy that our training of ConsistentID relies solely on a single reference image, yet it achieves comparable quality in synthesized images to methods trained with hundreds of reference images. 

 







§ MORE ABLATION




Attention loss ℒ_loc: 
To further validate the effectiveness of our ℒ_loc, we present several comparisons using two different identities in Figure <ref>. 
From the figure, we draw the following conclusions:
1) The details of key facial areas, such as Li Feifei's eye shape, are well preserved. 
2) The appearances of facial regions are highly consistent with the reference images, like eyes, ears, and mouths. 




















Delay control: 
In Figure <ref>, we provide visualized results to evaluate the impact of delay control during inference.  
The term `merge step' denotes the first time step in which we incorporate fine-grained facial image features. It helps to control the balance between text prompts and face images. In general, as the `merge step' increases, the influence of fine-grained facial image features gradually diminishes. 


For example, if the `merge step' is set to 0, it indicates that fine-grained facial image features are dominant in the generation process and might result in semantic inconsistencies. On the contrary, setting the `merge step' to 0 will maximize the guidance of text prompts, yet might harm the identity consistency.








To visually illustrate the impact of the `merge step', we display the variation curves for the CLIP-I, CLIP-T, and FGIS metrics as the `merge step' increases in Figure <ref>. 
From the figure, we observe a consistent trend where the textual control gradually strengthens with each increment of the `merge step'. 


Infer time of each module: In Table <ref>, we present the inference time of each module, which adds up to 16 seconds for processing one image. 
It quantitatively demonstrates the competitive performance in terms of inference efficiency [During the inference phase, the LLaVa or ChatGPT-4v module is not necessary input. Effective outcomes can be achieved by solely utilizing predefined descriptors of the facial description `face, nose, eyes, ears, and mouth'.]. 







§ DATASET DETAILS




Data source: Our facial images are from three public datasets, including FFHQ <cit.>, CelebA<cit.>, and SFHQ<cit.>. 
We select 70,000, 30,000, and 424,258 images from these datasets, respectively.  
In a total of 524,258 images, 107,048 images have recognizable IDs.  
Figure <ref> shows some examples of these images and their corresponding captions. 




Dataset pipeline: Below is the detailed our dataset processing pipeline:
Each image is initially fed into BiSeNet and LLaVA1.5 to obtain a fine-grained mask and facial descriptions. Let I_mask denote the fine-grained image mask, which is a binary mask indicating our defined facial components.  
We then utilize I_mask to segment out the corresponding regions from the original image and denote them as I_face. 
Meanwhile, we utilize the InsightFace model to extract facial identity features.  





Dataset characteristics:
In our dataset, we include 15 types of identities, which are listed in Table <ref>. 
Subsequently, in Figure  <ref>, we display the distributions of gender and age across all identities.
The figure illustrates a relative balance of both properties in our dataset. 

Dataset scenarios: In table <ref>, we further provide all prompts used in 45 scenarios. 
The scenarios are divided into 4 categories based on the different applications, including Clothing&Accessory, Action, Background and Style. 





§ MORE TRAINING DETAILS.
 


1. We define the keywords of T_face as `face', `ears', `eyes', `nose', and `mouth'.   
These keywords are then used to locate their positions in I_face, and a trigger word `<facial>' is inserted to replace the keywords at the matched positions.   
Next, the descriptions corresponding to facial regions are rearranged according to the order of facial feature keywords, while any descriptions unrelated to facial regions are eliminated.    
To resolve the problem of incomplete alignment between facial region descriptions and actual facial regions, we address two scenarios.  
If T_face comprises fewer than 5 region descriptions, I_face retains only the corresponding regions, with unidentified regions substituted by zero matrices.  
Conversely, if T_face includes complete descriptions for 5 regions but I_face lacks descriptions for all 5, the absent region is replaced with a zero matrix. 



2. T_face with trigger words undergoes ID encoding via a tokenizer, resulting in an encoded vector input_ids of length 77. The positions of trigger word representations in input_ids are recorded for FacialEncoder model localization during trigger word replacement.

3. To extract prior information for overall face ID, we referred to the IP-Adapter model and employed the InsightFace model to extract facial ID features for all images.  






§ MORE VISUALIZATION


Downstream applications: 
In Figures <ref>, <ref>, <ref>, and <ref>, we present additional visualized results to demonstrate the capabilities of our model in high-fidelity and flexible editing across various recontextualization scenarios, including age modification, identity mixing, and gender transformation. 

















§ DISCUSSION OF ETHICAL PRINCIPLES:

 
In the work, we introduce ConsistentID, a method for generating high-quality facial images while preserving identity fidelity. Our approach emphasizes efficiency, diversity, and controllability in facial generation tasks, serving as a robust baseline for academic research. However, the widespread adoption of such technology raises ethical concerns regarding privacy, misinformation, and potential misuse. We advocate for the responsible development and use of these tools, emphasizing the importance of ethical guidelines to ensure their safe and ethical application in computer vision.












