PuLID: Pure and Lightning ID Customization via Contrastive Alignment

Authors: zinan  guo
yanze  wu
†  zhuowei
chen  lang
chen  peng
zhang  qian he
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-08 05:39:07

Abstract: We propose Pure and Lightning ID customization (PuLID), a novel tuning-free ID customization method for text-to-image generation. By incorporating a Lightning T2I branch with a standard diffusion one, PuLID introduces both contrastive alignment loss and accurate ID loss, minimizing disruption to the original model and ensuring high ID fidelity. Experiments show that PuLID achieves superior performance in both ID fidelity and editability. Another attractive property of PuLID is that the image elements (\eg, background, lighting, composition, and style) before and after the ID insertion are kept as consistent as possible. Codes and models are available at https://github.com/ToTheBeginning/PuLID

Main paper: 
 introduction: 
 As a special category of customized text-to-image (T2I) generation [7, 36, 14, 19, 46, 50] , identity (ID) customization allow users to adapt pre-trained T2I diffusion models to align with their personalized ID. One line of work [7, 36, 14, 19] fine-tunes certain parameters on several images with the same ID provided by the user, thereby embedding the ID into the generative model. These methods have spawned many popular AI portrait applications, such as PhotoAI and EPIK.While tuning-based solutions have achieved commendable results, customizing for each ID requires tens of minutes of fine-tuning, thus making the personalization process economically expensive. Another line of work [48, 50, 3, 42, 22, 21, 44] forgoes the necessity of fine-tuning for each ID, instead resorting to pre-training an ID adapter [13, 28] on an expansive portrait dataset. These methods typically utilize an encoder (e.g., CLIP image encoder [32] ) to extract the ID feature. The extracted feature is then integrated into the base diffusion model in a specific way (e.g., embedded into cross-attention layer). Although highly efficient, these tuning-free methods face two significant challenges.• Insertion of ID disrupts the original model's behavior. A pure ID information embedding should feature two characteristics. Firstly, an ideal ID insertion should alter only ID-related aspects, such as face, hairstyle, and skin color, while image elements not directly associated with the specific identity, such as background, lighting, composition, and style, should be consistent with the behavior of the original model. To our knowledge, this point has not been focused by previous works. While some research [50, 44, 22] has shown the ability for stylized ID generation, notable style degradation occurs when compared with images before ID insertion (as depicted in Fig. 1 ). Methods with higher ID fidelity tend to induce more severe style degradation.Secondly, after the ID insertion, it should still retain the ability of the original T2I model to follow prompts. In the context of ID customization, this generally implies the capacity to alter ID attributes (e.g., age, gender, expression, and hair), orientation, and accessories (e.g., glasses) via prompts. To achieve these features, current solutions generally fall into two categories. The first category involves enhancing the encoder. IPAdapter [50, 1] shifted from early-version CLIP extraction of grid features to utilizing face recognition backbone [6] to extract more abstract and relevant ID information. Despite the improved editability, the ID fidelity is not high enough. InstantID [44] builds on this by including an additional ID&Landmark ControlNet [52] for more effective modulation. Even though the ID similarity improves significantly, it compromises some degree of editability and flexibility. The second category of methods [22] supports non-reconstructive training to enhance editability by constructing datasets grouped by ID; each ID includes several images. However, creating such datasets demands significant effort. Also, most IDs correspond to a limited number of celebrities, which might limit their effectiveness on non-celebrities.• Lack of ID fidelity. Given our human sensitivity to faces, maintaining a high degree of ID fidelity is crucial in ID customization tasks. Inspired by the successful experience of face generation [35, 45] tasks during the GAN era [9] , a straightforward idea for improving ID fidelity is to introduce ID loss within diffusion training. However, due to the iterative denoising nature of diffusion models [12] , achieving an accurate x 0 needs multiple steps. The resource consumption for training in this manner can be prohibitively high. Consequently, some methods [3] predict x 0 directly from the current timestep and then calculate the ID loss. However, when the current timestep is large, the predicted x 0 is often noisy and flawed. Calculating ID loss under such conditions is obviously inaccurate, as the face recognition backbone [6] is trained on photo-realistic images. Although some workarounds have been proposed, such as calculating ID loss only at less noisy timesteps [29] or predicting x 0 with an additional inference step [54] , there still remains room for improvement.In this work, to maintain high ID fidelity while reducing the influence on the original model's behavior, we propose PuLID, a pure and lighting ID customization method via contrastive alignment. Specifically, we introduce a Lightning T2I branch alongside the standard diffusion-denoising training branch. Leveraging recent fast sampling methods [26, 38, 23] , the lighting T2I branch can generate high-quality images from pure noise with a limited and manageable number of steps. With this additional branch, we can simultaneously address the two challenges mentioned above. Firstly, to minimize the influence on the original model's behavior, we construct a contrastive pair with the same prompt and initial latent, with and without ID insertion. During the Lightning T2I process, we align the UNet features between the contrastive pair semantically, instructing the ID adapter how to insert ID information without affecting the behavior of the original model. Secondly, as we now have the precise and high-quality generated x 0 after ID insertion, we can naturally extract its face embedding and calculate an accurate ID loss with the ground truth face embedding. It is worth mentioning that such x 0 generation process aligns with the actual test setting. Our experiments demonstrate that optimizing the ID loss in this context can significantly increase ID similarity.The contributions are summarized as follows.(1) We propose a tuning-free method, namely, PuLID, which preserves high ID similarity while mitigating the impact on the original model's behavior. (2) We introduce a Lightning T2I branch alongside the regular diffusion branch. Within this branch, we incorporate a contrastive alignment loss and ID loss to minimize the contamination of ID information on the original model while ensuring fidelity. Compared to the current mainstream approaches that improve the ID encoder or datasets, we offer a new perspective and training paradigm. (3) Experiments show that our method achieves SOTA performance in terms of both ID fidelity and editability. Moreover, compared to existing methods, our ID information is less invasive to the model, making our method more flexible for practical applications. 
related work: 
 Tuning-free Text-to-image ID Customization. ID Customization for text-to-image models aims to empower pre-trained models to generate images of specific identities while following the text descriptions. To ease the resource demand necessitated by tuning-based methods [7, 36, 14, 19, 10, 41] , a series of tuning-free methods [42, 44, 29, 50, 22, 48, 51, 4] have emerged, which directly encode ID information into the generation process. The major challenge these methods encounter is minimizing disruption to the original behavior of T2I models while still maintaining high ID fidelity.In terms of minimizing the disruption, one plausible approach is to utilize a face recognition model [6] to extract more abstract and relevant facial domain-specific representations, as done by IP-Apdater-FaceID [1] and InstantID [44] . A dataset comprising multiple images from the same ID can facilitate the learning of a common representation [22] . Despite the progress made by these approaches, they have yet to fundamentally solve the disruption issue. Notably, models with higher ID fidelity often cause more significant disruptions to the behavior of the original model. In this study, we propose a new perspective and training method to tackle this issue. Interestingly, the suggested method does not require laborious dataset collection grouped by ID, nor is it confined to a specific ID encoder.To improve ID fidelity, ID loss is employed in previous works [18, 3] , motivated by its effectiveness in prior GAN-based works [35, 45] . However, in these methods, x 0 is typically directly predicted from the current timestep using a single step, often resulting in noisy and flawed images. Such images are not ideal for the face recognition models [6] , as they are trained on real-world images. PortraitBooth [29] alleviates this issue by only applying ID loss at less noisy stages, which ignores such loss in the early steps, thereby limiting its overall effectiveness. Diffswap [54] obtains a better predicted x 0 by employing two steps instead of just one, even though this estimation still contains noisy artifacts. In our work, with the introduced Lightning T2I training branch, we can calculate ID loss in a more accurate setting.We notice a concurrent work, LCM-Lookahead [8] , which also uses fast sampling technology (i.e., LCM [26] ) to achieve a more precise prediction of x 0 . However, there are several differences between this work and ours. Firstly, LCM-Lookahead makes a precise prediction of x 0 during the conventional diffusion-denoising process, whereas we start from pure noise and iteratively denoise to x 0 . Our approach, which aligns better with actual testing settings, makes the optimization of ID loss more direct. Secondly, to enhance prompt editing capability, LCM-Lookahead capitalized on the mode collapse phenomenon of SDXL-Turbo [38] to synthesis an ID-consistent dataset. However, the synthetic dataset might face diversity and consistency challenges, and the authors found that training with this dataset may lean towards stylized results more frequently than other methods. In contrast, our method does not need an ID-grouped dataset. Instead, we enhance prompt follow ability through a more fundamental and intuitive approach, namely, contrastive alignment.Fast Sampling of Diffusion Models. In practice, diffusion models are typically trained under 1000 steps. During inference, such a lengthy process can be shortened to a few dozen steps with the help of advanced sampling methods [39, 25, 17] . Recent distill-based works [23, 26, 38] further accelerate this generation process within 10 steps. The core motivation is to guide the student network to align with points further from the base teacher model. In this study, the Lightning T2I training branch we introduce leverages the SDXL-Lightning [23] acceleration technology, thus enabling us to generate high-quality images from pure noise in just 4 steps. In this branch, we construct contrastive paths with and without ID injection and introduce an alignment loss to instruct the model on how to insert ID condition without disrupting the original model's behavior. As this branch can produce photo-realistic images, it implies that we can achieve a more accurate ID loss for optimization.Question: Does the paper discuss the limitations of the work performed by the authors?Answer: [Yes] Justification: We discuss the limitations in section 5.Guidelines:• The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper. • The authors are encouraged to create a separate "Limitations" section in their paper.• The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be. • The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated. • The authors should reflect on the factors that influence the performance of the approach.For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon. • The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size. • If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness. • While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations. 
preliminary: 
 Diffusion models [12] are a class of generative models capable of synthesizing desired data samples through iterative denoising. A conventional diffusion training encapsulates two procedures, the forward diffusion process and reverse denoising process. During the diffusion process, noise ϵ is sampled and added to the data sample x 0 based on a predefined noise schedule. This process yields a noisy sample x t at timestep t. Conversely, during the denoising process, a denoisng model ϵ θ takes x t , t, and optional additional conditions C as inputs to predict the added noise, the optimization process can be articulated as:EQUATIONThe denoising model ϵ θ in modern T2I diffusion models [37, 33, 30] is predominantly a UNET composed of residual blocks [11] , self-attention layers, and cross-attention [43] layers. The prompt, as a condition, is embedded into the cross-attention layers adhering to the attention mechanism, illustrated as follows:EQUATIONwhere Q is projected from the UNET image features, τ txt denotes a pre-trained language model that converts prompt C txt to textual features, W K and W V are the learned linear layers.ID Customization in T2I diffusion introduces ID images C id as an additional condition, working together with the prompt to control image generation. Tuning-free customization [16, 48, 50] methods typically employ an encoder to extract ID features from C id . The encoder often includes a frozen backbone, such as CLIP image encoder [32] or face recognition backbone [6] , along with a learnable head.A simple yet effective technique to embed the ID features to the pre-trained T2I model is to add parallel cross-attention layers to the original ones. In these parallel layers, learnable linear layers are introduced to project the ID features into K id and V id for calculating attention with Q. This technique, proposed by IP-Adapter [50] , has been widely used, we also adopt it for embedding ID features in this study.We build our model based on the pre-trained SDXL [30] , which is a SOTA T2I latent diffusion model. Our ID encoder employs two commonly used backbones within the ID customization domain: the face recognition model [6] and the CLIP image encoder [32] , to extract ID features. Specifically, we concatenate the feature vectors from the last layer of both backbones (for the CLIP image encoder, we use the CLS token feature), and employ a Multilayer Perceptron (MLP) to map them into 5 tokens as the global ID features. Additionally, following ELITE's approach [46] , we use MLPs to map the multi-layer features of CLIP to another 5 tokens, serving as the local ID features. It is worth noting that our method is not restricted to a specific encoder.Currently, tuning-free ID customization methods generally face a challenge: the embedding of the ID disrupts the behavior of the original model. The disruption manifests in two ways: firstly, the ID-irrelevant elements in the generated image (e.g., background, lighting, composition, and style) have changed extensively compared to before the ID insertion; secondly, there is a loss of prompt adherence, implying we can hardly edit the ID attributes, orientations, and accessories with the prompt. Typically, models with higher ID fidelity suffer more severe disruptions. Before we present our solutions, we first analyze why conventional diffusion training would cause this issue.In conventional ID Customization diffusion training process, as formulated in Eq. 1, the ID condition C id is usually cropped from the target image x 0 [50, 44] . In this scenario, the ID condition aligns completely with the prompt and UNET features, implying the ID condition does not constitute contamination to the T2I diffusion model during the training process. This essentially forms a reconstruction training task. So, to better reconstruct x 0 (or predict noise ϵ), the model will make the utmost effort to use all the information from ID features (which may likely contain ID-irrelevant information), as well as bias the training parameters towards the dataset distribution, typically in the realistic portrait domain. Consequently, during testing, when we provide a prompt that is in conflict or misaligned with the ID condition, such as altering ID attributes or changing styles, these methods tend to fail. This is because there exists a disparity between the testing and training settings.While it is difficult to ascertain whether the insertion of ID disrupts the original model's behavior during the conventional diffusion training, it is rather easy to recognize under the test settings. For instance, we can easily observe whether the elements of the image change after the ID is embedded, and whether it still possesses prompt follow ability. Thus, our solution is intuitive. We introduce a Lightning T2I training branch beyond the conventional diffusion-denoising training branch. Just like in the test setting, the Lighting T2I branch starts from pure noise and goes through the full iterative denoising steps until reaching x 0 . Leveraging recent fast sampling methods [26, 38, 23] , the Lighting T2I branch can generate high-quality images from pure noise with a limited and manageable number of steps. Concretely, we employ SDXL-Lightning [23] with 4 denoising steps. We prepare a list of challenging prompts that can easily reveal contamination, as shown in Table 8 . During each training iteration, a random prompt from this list is chosen as the textual condition for the Lightning T2I branch. Then, we construct contrastive paths that start from the same prompt and initial latent. One path is conditioned only by the prompt, while the other path employs both the ID and the prompt as conditions. By semantically aligning the UNET features on these two paths, the model will learn how to embed ID without impacting the behavior of the original model. The overview of our method is shown in Fig. 2 . We chose to align the contrastive paths in their corresponding UNET's cross-attention layers. Specifically, we denote the UNET features in the path without ID embedding as Q t , whereas the corresponding UNET features in the contrastive path with ID embedding as Q tid . For simplicity, we omit the specific layers and denoising steps here. In actuality, alignment is conducted across all layers and time steps.Our alignment loss consists of two components: the semantic alignment loss and the layout alignment loss. An illustration is presented in Fig. 3 (a). We use textual features K to query the UNET features Q. For each token in K, it will calculate the correlation with Q, and further aggregate Q based on the correlation matrix. Analogous to Eq. 2, the attention mechanism here can be expressed as Attention(K, Q, Q), which can be interpreted as the response of the UNET features to the prompt. The insight behind our semantic alignment loss is simple: if the embedding of ID does not affect the original model's behavior, then the response of the UNET features to the prompt should be similar in both paths. Therefore, our semantic alignment loss L align-sem can be formulated as follows:EQUATION)As illustrated in Fig. 3 (b), the introduction of L align-sem significantly mitigates the issue of ID information contaminating the model's behavior. However, it cannot guarantee layout consistency, so we add a layout alignment loss L align-layout , which is defined as:EQUATIONThe full alignment loss is formulated asEQUATIONwhere λ align-sem and λ align-layout serve as hyperparameters that determine the relative importance of each loss item. In practice, we set λ align-layout to a relatively small value, as we found that a larger value compromises the ID fidelity.In ID Customization tasks, ensuring a high degree of ID fidelity is essential, given our innate human sensitivity towards discerning facial features. To improve the ID fidelity, aside from enhancements on the ID encoder [50, 44, 53] , another universal and parallel improvement is the introducing of an ID loss [6, 3, 29] during the training. However, these methods directly predict x 0 at the t-th timestep in the diffusion training process, only using a single step. This will produce a noisy and flawed predicted x 0 , subsequently leading to inaccurate calculation of ID loss. To ease this issue, recent work [29] proposes to only applying the ID loss on less noisy stages. However, since the ID loss only affects a portion of timesteps, which may potentially limit the full effectiveness of it. In this study, thanks to the introduced Lightning T2I branch, the above issue can be fundamentally resolved. Firstly, we can swiftly generate an accurate x 0 conditioned on the ID from pure noise within 4 steps. Consequently, calculating the ID loss on this x 0 , which is very close to the real-world data distribution, is evidently more precise. Secondly, optimizing ID loss in a setting that aligns with the testing phase, is more direct and effective. Formally, the ID loss L id is defined as:EQUATIONwhere x T denotes the pure noise, L-T2I represents the Lightning T2I branch, and ϕ denotes the face recognition backbone [6] . To generate photo-realistic faces, we fix the prompt C txt to "portrait, color, cinematic".The full learning objective is defined as:EQUATIONDuring training, only the newly introduced MLPs and the learnable linear layers K id and V id in cross-attention layers are optimized with this objective, with the rest remaining frozen.4 ExperimentsQuestion: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?Answer • Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted. 
implementation details: 
 We build our PuLID model based on SDXL [30] and the 4-step SDXL-Lightning [23] . For the ID encoder, we use antelopev2 [6] as the face recognition model and EVA-CLIP [40] as the CLIP Image encoder. Our training dataset comprises 1.5 million high-quality human images collected from the Internet, with captions automatically generated by BLIP-2 [20] . Our training process consists of three stages. In the first stage, we use the conventional diffusion loss L diff to train the model. In the second stage, we resume from the first stage model and train with the ID loss L id (we use arcface-50 [6] to calculate ID loss) and diffusion loss L diff . This model strives for the maximum ID fidelity without considering the contamination to the original model. In the third stage, we add the alignment loss L align and use the full objective as shown in Eq. 7 to fine-tune the model. We set the λ align-sem to 0.6, λ align-layout to 0.1, and λ id to 1.0. In the Lightning T2I training branch, we set the resolution of the generated image to 768 × 768 to conserve memory. Training is performed with PyTorch and diffusers on 8 NVIDIA A100 GPUs in an internal cluster.For consistency in comparison, unless otherwise specified, all the results in this paper are generated with the SDXL-Lightning [23] base model over 4 steps using the DPM++ 2M sampler [17] . The CFG-scale is set to 1.2, as recommended by [23] . Moreover, for each comparison sample, all methods utilize the same seed. We observe that the comparison methods, namely InstantID [44] and IPAdapter (more specifically, IPAdapter-FaceID [1]) are highly compatible with the SDXL-Lightning model. As shown in appendix subsection 7.5, when compared to using SDXL-base [30] as the base model, employing SDXL-Lightning results in InstantID generating more natural and aesthetically pleasing images, and enables IPAdapter to achieve higher ID fidelity. Furthermore, we provide a quantitative comparison with these methods on SDXL-base, with the conclusions remaining consistent with those on SDXL-Lightning.To more effectively evaluate these methods, we collected a diverse portrait test set from the internet. This set covers a variety of skin tones, ages, and genders, totaling 120 images, which we refer to as DivID-120. As a supplementary resource, we also used a recent open-source test set, Unsplash-50 [8] , which comprises 50 portrait images uploaded to the Unsplash website between February and March 2024.As shown in Fig. 4 , when compared to SOTA methods such as IPAdapter and InstantID, our PuLID tends to achieve higher ID fidelity while creating less disruption to the original model. that as the disruption to the model decreases, the results produced by PuLID accurately replicate the lighting (1st column), style (4th column), and even layout (5th column) of the original model. In contrast, although comparative methods can also perform stylization, notable style degradation can be noticed when compared to the original model. Finally, our model also possesses respectable promptediting capabilities, such as changing orientation (2nd column), altering attributes (6th column), and modifying accessories (7th column). More qualitative results can be found in subsection 7.1 and subsection 7.2 of the appendix.The quantitative results are reported in Table 1 . Face Sim. represents the ID cosine similarity, with ID embeddings extracted using CurricularFace [15] . CurricularFace is different from the face recognition models we use in the ID encoder and for calculating ID loss. CLIP-T [32] measures the ability to follow prompt. We also use CLIP-I to quantify the CLIP image similarity between two images before and after the ID insertion. A higher CLIP-I metric indicates a smaller modification in image elements (such as the background, composition, style) after ID insertion, suggesting a lower degree 1 , our method, PuLID, surpasses comparison methods across all three metrics, achieves SOTA performance in terms of both ID fidelity and editability. Furthermore, our method significantly outperforms others with respect to the CLIP-I metric, implying that our method incurs much less intrusion on model behavior compared to other methods.Alignment loss ablation. Fig. 5 displays a qualitative comparison between models trained with and without the alignment loss L align . As observed, without L align , the embedding of ID severely disrupts the behavior of the original model. This disruption manifests as an inability for the prompt to precisely modify style (the left two cases of Fig. 5 ) and orientation (the lower right case of Fig. 5 ). Also, the layout would collapse to the extent that the face occupies the majority of the image area, resulting in a diminished diversification of the layout. However, with the introduction of our alignment loss, this disruption can be significantly reduced. From Table 2 , we could also observe a large improvement in CLIP-T and CLIP-I when equipped with L align (from Stage2 to Stage3).ID loss ablation. Table 2 illustrates the improvement in ID fidelity using the naive ID loss (directly predicting x 0 from current timestep) and the more accurate ID loss L id introduced in this paper, in comparison to the baseline. As observed, L id can accomplish a greater improvement compared to the naive ID loss. We attribute this to the more precise x 0 provided by the Lightning-T2I branch, which also better aligns with the testing setting, thereby making the optimization of ID loss more direct and effective. Another worth mentioning point is that the baseline, naively trained on the internal dataset, underperforms in ID fidelity and editability. Conversely, the introduction of the PuLID training paradigms delivers significant enhancement. Therefore, this substantiates that the improvement mainly comes from the method, rather than the dataset. 
limitation: 
 While our PuLID achieves superior ID fidelity and editability with minimal disruption to the base model's behavior, it still has limitations. Due to the incorporation of the Lightning T2I branch, the training speed per iteration is slower than that of conventional diffusion training, and it also demands more CUDA memory. However, this issue can be significantly mitigated when future fast sampling methods can generate satisfying results in a single step (currently, we use 4 steps). Another limitation is that although the accurate ID loss introduced in the Lightning T2I branch markedly enhances ID fidelity, it also impacts image quality to some extent, such as causing blurriness in faces. This can be discerned in Fig. 3 (b) and Fig. 5 . Nonetheless, this issue is not uniquely associated to our method, as similar phenomena has been observed in reward tuning methods [49, 31, 5, 47] , with [5] attributing it to the reward-hacking problem. Although this issue can be largely alleviated by pairing with our proposed contrastive alignment loss, future work could explore a more effective ID loss that does not negatively affect image quality. 
conclusion: 
 This paper presents PuLID, a novel tuning-free approach to ID customization in text-to-image generation. By incorporating a Lightning T2I branch along with a contrastive alignment strategy, PuLID achieves superior ID fidelity and editability with minimal disruption to the base model's behavior. Experimental results demonstrate that PuLID surpasses current methods, showcasing its potential for flexible and efficient personalized image generation. Future work could explore the application of this proposed training paradigm to other image customization tasks, like IP and style customization.Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?Answer: [Yes] Justification: The paper provides the settings and details of the method, more details will be available in the codes.Guidelines:• The answer NA means that the paper does not include experiments.• The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them. • The full details can be provided either with the code, in appendix, or as supplemental material. 
more applications of pulid: 
 We provide more applications of our PuLID in Fig. 6 , encompassing style alterations (1st row), IP fusion (2nd row), accessories modification (3rd row), recontextualization (4th row), attributes editing (5th row), transformation from non-photo-realistic domains to photo-realistic ones (6th row), and ID mixing (7th row).Testing With Community Models. During training, we keep the base model parameters fixed. We use SDXL in the initial stage and SDXL-Lightning, which is distilled from SDXL, in the final two stages. SDXL-Lightning is effective in retaining the style and layout of SDXL, allowing our model to generalize to community models based on SDXL during testing. However, disruptions caused by ID insertion are more noticeable when testing other base models rather than SDXL-Lightning, our training base model. To combat this, we enhance compatibility by simultaneously aligning with multiple base models during training. This process involves loading different base models onto different GPU ranks, while a single ID adapter is shared across all ranks [24] . Using this strategy, our PuLID model attains robust compatibility with popular community models, both accelerated and non-accelerated ones. This includes models like RealVisXL (Fig. 9 ), Juggernaut-XL-Lightning (Fig. 10 ), and DreamShaper-XL-Lightning (Fig. 11 ).Training With Non-accelerated Base Models. We want to highlight that the core essence of our paper is to introduce a more accurate ID loss and alignment loss in the T2I training branch to achieve better ID fidelity and editability. The fast sampling method (such as SDXL-Lightning) serves as an optional acceleration trick, but it is not indispensable. Without the fast sampling method, we would need 30 inference steps with CFG on the T2I branch, compared to the current 4 required inference steps without CFG. Due to CUDA memory bottleneck (we exclude the use of gradient checkpointing due to its significant speed penalty), it is not feasible to perform backpropagation (BP) of the gradient at all timesteps. Nonetheless, it remains possible to make optimization viable with strategic techniques. Particularly, for the optimization of ID loss, BP of the gradient happens only for the last few timesteps [5] . For the optimization of alignment loss, a timestep is randomly selected for BP of the gradient. Table 3 shows the differences in speed and memory consumption between training with and without acceleration. From the table, we can see that if we do not use fast sampling and take SDXL as the base model for the T2I training branch, efficiency will indeed be much lower. However, thanks to the carefully designed optimization strategies mentioned above, the training method presented in this paper can be effectively adapted to non-accelerated models, with performance being further improved, shown in Table 4 . Additional visual results can be found in Fig. 12 . In summary, our method does not rely on accelerated base models, thus reflecting the universality of our approach. We also successfully adapt PuLID to a much larger and non-accelerated base model, FLUX [2] , and open-source it at https://github.com/ToTheBeginning/PuLID. Our selection criteria for a fast sampling method is that it can generate high-quality images within a limited number of steps while well preserving the style and layout of the original model. SDXL-Lightning fulfills these requirements and was the SOTA option at that time, so we selected it to accelerate our T2I training branch. Moreover, we settle on 4 steps as it achieves a balance between efficiency and quality. With fewer steps (e.g., 1 or 2), the likelihood that SDXL-Lightning generates flawed faces increases. However, we have noted a recently emerged fast sampling method, Hyper-SD [34] , which performs better than SDXL-Lightning on 1 and 2 steps. Therefore, we present the results of training on 1 step and 2 steps with Hyper-SD, as well as on 8 steps with SDXL-Lightning in Table 5 . As shown in this table, training with 1 or 2 steps leads to a reduction in face similarity. Meanwhile, training with 8 steps slightly enhances overall performance. Considering both efficiency and performance, 4 steps is a sound choice.Evaluation Prompts. Table 7 presents the complete list of prompts utilized in the calculation of CLIP-T and CLIP-I. For measuring Face Sim., we employ the prompt "portrait, color, cinematic, in garden, soft light, detailed face" to guarantee that the generated face is photo-realistic and detectable. For each ID and each prompt, we randomly generate four images for evaluation.Hyperparameter Selection for the Comparison Methods. We employ the popular and widely used ComfyUI workflow2 in the community to test IPAdapter and InstantID. For InstantID, the weight is set to 0.8. For IPAdapter, the lora scale is set to 0.8 and the IP_weight is set to 1.5. Additionally, we present the results of these methods under different ID weights (as shown in Fig. 7 ). It can be observed that for InstantID and IPAdapter, the ID embedding only has minimal impact on the original model when the ID weight is set to a relatively small value. However, at this point, the ID similarity decreases significantly. Since our method only influences the ID-relevant parts, it doesn't significantly disrupt the original model's behavior, even when increasing ID weight.The Influence of Changing Base Model on the Comparison Methods. Here, we present the visual differences associated with these methods when varying base models are used. Fig. 8 showcases the qualitative comparison results. As observable from the figure, InstantID attains better image quality and aesthetics when using SDXL-Lightning instead of SDXL-base, while the ID fidelity shows little visual difference. For IPAdapter, a better ID fidelity can be achieved using SDXL-Lightning compared to SDXL-base.Quantitative Comparison. We provide the quantitative comparison on SDXL-base in Table . 6.As evident, our final model, PuLID, still outperforms the comparative methods in most scenarios, with the exception of Face Sim. on DivID-120, where our method slightly falls behind InstantID. Nevertheless, our method significantly surpasses InstantID in terms of CLIP-T and CLIP-I metrics, and our model (from Stage2) that strives for maximum ID similarity also manages to surpass InstantID on the Face Sim. metric. Another intriguing and noteworthy point is that typically, an enhancement in ID similarity accompanies a decrease in the CLIP-T and CLIP-I metrics. However, our method has the unique capability to not only achieve a high degree of ID similarity, but concurrently maintain high editability and low interference. This is facilitated by the novel training paradigm introduced in this study.Table 8 presents the complete list of prompts used in contrastive alignment. Despite their simplicity, these prompts already ensure an effective methodology. Future exploration will involve determining if there exists a more optimal list of prompts. Thanks to the superior ID fidelity and editability offered by PuLID, this technology holds the potential to enhance personalized content creation, offering benefits for various applications such as entertainment and virtual reality. However, it could also be exploited to create misleading or false representations of individuals, potentially posing privacy infringements or being used maliciously, such as in deepfakes. Although existing deepfake detection methods [27] can help mitigate these risks, we underscore the imperative role of developing and adhering to stringent ethical guidelines for ensuring responsible use of such technology. • portrait, color, cinematic • portrait, anime artwork • portrait, comic art, graphic novel art • portrait, digital artwork, illustrative, painterly, matte painting • portrait, magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy • portrait, vibrant, professional, sleek, modern, minimalist, graphic, line art, vector graphics • portrait, cyberpunk, vaporwave, neon, vibes, vibrant, stunningly beautiful, crisp, detailed, sleek, ultramodern, magenta highlights, dark purple shadows, high contrast, cinematic, ultra detailed, intricate, professional • portrait, energetic brushwork, bold colors, abstract forms, expressive, emotional • portrait, film noir style, monochrome, high contrast, dramatic shadows, 1940s style, mysterious, cinematic • portrait, papercut, mixed media, textured paper, overlapping, asymmetrical, abstract, vibrant • portrait, paper mache representation, 3D, sculptural, textured, handmade, vibrant, fun • portrait, vaporwave style, retro aesthetic, cyberpunk, vibrant, neon colors, vintage 80s and 90s style, highly detailed • portrait, watercolor painting, vibrant, beautiful, painterly, detailed, textural, artistic • portrait, impressionist painting, loose brushwork, vibrant color, light and shadow play • portrait, expressionist, raw, emotional, dynamic, distortion for emotional effect, vibrant, use of unusual colors, detailed Guidelines:• The answer NA means that the abstract and introduction do not include the claims made in the paper. • The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers. • The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings. • It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?Answer: [No] Justification: Following previous methods, we did not report the error bars. But in order to calculate the metrics, we used the same seed and averaged the 4 generated results.Guidelines:• The answer NA means that the paper does not include experiments.• The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.• The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions). • The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.) • The assumptions made should be given (e.g., Normally distributed errors). • It should be clear whether the error bar is the standard deviation or the standard error of the mean. Justification: Yes, we provide the sufficient information.Guidelines:• The answer NA means that the paper does not include experiments.• The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage. • The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute. • The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper). 
code of ethics: 
 Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines? 
broader impacts: 
 Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?Answer: [Yes]Justification: Yes, we discuss both potential positive societal impacts and negative societal impacts of the work in subsection 7.7.Guidelines:• The answer NA means that there is no societal impact of the work performed.• If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact. • Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations. • The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster. • The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology. • If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML). 
safeguards: 
 Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?Answer: [NA] Justification: The paper poses no such risks.Guidelines:• The answer NA means that the paper poses no such risks.• Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters. • Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images. • We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.12. Licenses for existing assets Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?Answer: [Yes] Justification: Yes, they are properly credited.Guidelines:• The answer NA means that the paper does not use existing assets.• The authors should cite the original paper that produced the code package or dataset.• The authors should state which version of the asset is used and, if possible, include a URL. • The name of the license (e.g., CC-BY 4.0) should be included for each asset.• For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.• If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset. • For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided. • If this information is not available online, the authors are encouraged to reach out to the asset's creators. 
new assets: 
 Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?Answer: [NA]Justification: The paper does not release new assets Guidelines:• The answer NA means that the paper does not release new assets.• Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc. • The paper should discuss whether and how consent was obtained from people whose asset is used. • At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file. 
crowdsourcing and research with human subjects: 
 Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?Answer: [NA]Justification: The paper does not involve crowdsourcing nor research with human subjects.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects. • Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper. • According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector. 
institutional review board (irb) approvals or equivalent for research with human subjects: 
 Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?Answer: [NA]Justification: The paper does not involve crowdsourcing nor research with human subjects Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects. • Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.• We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution. • For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review. 
 
 Appendix: Justification: Yes, the research is conducted with the NeurIPS Code of Ethics.Guidelines:• The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.• If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics. • The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).https://github.com/cubiq/ComfyUI_InstantID ; https://github.com/cubiq/ComfyUI_IPAdapter_plus 


Decision: This paper studies tuning-free ID customization for T2I generation. Reviewers gave accept, accept, strong accept, and accept ratings. The ratings are overwhelmingly positive. Reviewers are happy with the good presentation, novelty, performance, and many experiments. The AC recommends accepting this paper as a spotlight presentation.

Reviews: review: paper_summary: paper_summary: The paper propose a tuning-free method for customization text-to-image diffusion model. Particularly, the author propose to utilize efficient diffusion model (SDXL-lightning in this case) to generate samples during training. Then, they adopt contrastive alignment loss to preserve the identity of subject in the input.
strength_weakness: strength_weakness: - Since the model requires an efficient text-to-image diffusion model (in terms of number of inference steps), it can hinder the application of  the introduced method with other base models.
questions: questions: - Since the author roll out full diffusion path (4 steps) during training, how much memory is required for training (e.g., compared to existing methods)? 
- How does the model perform if we set the number of diffusion step to (1, 2, 6)? (and how much memory footprint)
- Does this method work for subject other than human as input (e.g., dog, cat, etc) ?
limitations: limitations: please refer to weakness section.
paper_summary: paper_summary: This article presents a novel fine-tuning-free ID customization method called PuLID for text-to-image generation tasks. The method introduces Lightning T2I and contrast alignment loss, aiming to minimize the interference with the original model behavior while maintaining high ID fidelity. Experiments show that PuLID achieves excellent performance in terms of both ID fidelity and editability.
strength_weakness: strength_weakness: Here are some points and suggestions on how the authors should address them:

Clarification of Contributions:
The authors should clearly delineate their contributions in the manuscript. If the primary contribution is the use of contrastive alignment loss and ID loss, they should emphasize how these methods specifically address the problem of high ID similarity and reduce ID interference.
They should provide a more detailed explanation of how these losses are implemented and why they are effective.

Related Work:
The authors should expand their discussion on related work to include whether contrastive learning has been applied in similar contexts. This would help situate their work within the broader field and demonstrate its novelty.

Method Section:
There should be a more detailed explanation of how the method was realized. This includes a clear description of the steps taken, the rationale behind the chosen approach, and any unique aspects of the implementation.

Theoretical Analysis:
The authors should provide a more in-depth theoretical analysis, particularly for components like L_align-sem. They should explain the theoretical underpinnings of their approach and how it contributes to the overall effectiveness of the method.
Discussion on Main Contributions:

The manuscript should include a richer discussion on the main contributions. For example, the authors should explore whether the proposed loss functions reduce the weight of ID in text-to-image generation tasks. They should provide evidence or reasoning to support their claims.

Ablation Studies:
The authors should conduct ablation experiments to validate the necessity and effectiveness of each component of their method. For instance, if L_align-layout is introduced without ablation studies, it's unclear how crucial this component is to the overall performance.
Experimental Results:

While the effectiveness is illustrated in the experimental results, the authors should ensure that these results are robust and that the experiments are designed to test the method under various conditions.

Layout Consistency:
The authors should address the issue of layout consistency more thoroughly. If L_align-layout is mentioned but not rigorously tested, they should either conduct additional experiments or provide a theoretical justification for its inclusion.
Overall Clarity and Depth:

The authors should ensure that the manuscript is clear and that the depth of the discussion matches the complexity of the problem. This includes explaining the limitations of their approach and how it compares to existing methods.
By addressing these points, the authors can provide a more comprehensive and convincing argument for their contributions, making their research more accessible and impactful to the academic community.
questions: questions: 1. Lines 133 and 195 both mention that Q is an image feature of UNet, could the authors please explain how that image feature was obtained.
2. Is L_align-layout necessary? Is there any connection to your solution to the problem of ID information polluting the prompt?
3. In addition I would like to know how the authors' approach relates to the CFG scale (Classifier-Free Guidance scale) and whether CFG is valid for this task.
limitations: limitations: YES
paper_summary: paper_summary: This paper introduces Pure and Lightning ID customization (PuLID). It is a tuning-free approach for customizing identities in text-to-image generation. The model is trained over a huge dataset.

Technically, it integrates a Lightning T2I branch alongside a standard diffusion model, incorporating contrastive alignment loss and accurate ID loss to maintain fidelity to the original model. 

Experimental results show PuLID achieves superior performance in preserving identity fidelity and enhancing editability. Additionally, PuLID ensures consistency in image elements like background, lighting, composition, and style throughout the identity customization process.
strength_weakness: strength_weakness: 1. The primary limitation, in my opinion, is that the PuLID model is trained using an internal dataset. This raises questions about whether the observed improvements stem primarily from the introduction of this new dataset or from the efficacy of the method itself. Consequently, it's unclear whether comparisons with other methods on public datasets are fair or solely reflective of dataset differences.

2. Another picky question for the authors is to include more quantitative comparison metrics as in PhotoMaker[1] and ConsistentID[2], including DINO, Face Diversity, FID, Speed, FGIS (fine-grained identity similarity), etc. Furthermore, can you explain why the experimental results in your paper are much lower than that showed in the original PhotoMaker paper?

3. It seems the T2I lightning branch is pretty important for your method PuLID. Have you done any ablation study over the choices of the T2I lightning models, e.g. the LCM, SDXL-turbo, TCM, InstaFlow, UFOGen, etc? This is to verify your model can be based on SDXL or other backbones, and the lightning models are with diverse choices. Also you choose T=4, would it be influenced by T=1,2,8...?




[1] PhotoMaker: Customizing Realistic Human Photos via Stacked ID Embedding

[2] ConsistentID: Portrait Generation with Multimodal Fine-Grained Identity Preserving
questions: questions: Check the weaknesses
limitations: limitations: Check the weaknesses
paper_summary: paper_summary: In this paper, an ID customization method for text-to-image generation without tuning is studied. In practical applications, the method often encounters the problems of lack of ID fidelity and interference of the original pattern line by inserting ID. To solve this problem, the author proposes a new ID customization method for text-to-image generation without tuning. A large number of experiments, called Pure and Lightning ID customization (PuLID), on multiple benchmark datasets validate the superiority of the proposed PuLID.
strength_weakness: strength_weakness: The author's work is very good, but I still have three questions I would like to discuss with them.

1. Experimental results show that PuLID has achieved good performance on specific data sets, but the generalization ability of the model on different types and styles of data sets has not been discussed much in this paper. Can the author provide more experimental results on the generalization of the model? In addition, is there further analysis and discussion of possible limitations of the model, such as its performance in handling certain ID features or style transitions?

2. The authors mentioned that in order to solve the two problems mentioned in their method, the final loss calculation is based on the combination of three kinds of losses. What impact do the different proportions of the three kinds of losses have on the experimental results, especially the impact of ID loss?

3.The paper points out that high-quality images can be generated in fewer steps through the Lightning T2I branch, and ID losses can be calculated on this basis. Is there a significant improvement in computing efficiency with this method? Compared to the traditional multi-step diffusion model, what is the training and reasoning time of the Lightning T2I branch in practical applications?

4.The PULID used by the author in the experiment is based on SDXL and the 4-step SDXL-Lightning. Is it possible to conduct experiments based on other diffusion models to judge its universality？
questions: questions: I am mainly concerned about the universality of the proposed method and theoretical analysis, whether the proposed Lightning T2I branch can be applied to other diffusion models, and how fast and efficient it is in the actual training and reasoning process.
limitations: limitations: In general, the content and theory of the article are very rich, but there are some limitations. 1) There are few experimental data, which is not well reflected in aspects such as universality and speed. 2) Is it possible to extend this method and replace ID with other things, such as (clothing)?

Comments: title: Further discussions with Reviewer bfEK
Thanks for the rebuttal
comment: Dear Reviewer bfEK,

We thank you for the precious review time and valuable comments. We have provided corresponding responses, which we believe have covered your concerns. We hope to further discuss with you whether or not your concerns have been addressed. Please let us know if you still have any unclear parts of our work. Thanks :-)

Best,

PuLID Authors
We thank Reviewer BtJK for taking the time to review our response. We highly agree with your suggestion of open-sourcing, which aligns with our original intentions. Furthermore, we plan to adapt PuLID to FLUX.1 in the coming months and make it open-source as well.
My concerns are partially addressed in the rebuttal. I prefer to see this project open source and more people engage to make it function better and more effective. Here I prefer to keep my rating.
We thank Reviewer pgk9 for taking the time to review our response. We greatly appreciate your acknowledgment and are pleased that we could address your concerns.
This is a good job, and the author has also answered my questions well.