{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/pulid-pure-and-lightning-id-customization-via","title":"PuLID: Pure and Lightning ID Customization via Contrastive Alignment","arxiv_id":"2404.16022","date":"2024-04-24","proceeding":null,"authors":["Zinan Guo","Yanze Wu","Zhuowei Chen","Lang Chen","Peng Zhang","Qian He"],"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 (e.g., 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","url_abs":"https://arxiv.org/abs/2404.16022v2","url_pdf":"https://arxiv.org/pdf/2404.16022v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"pulid-pure-and-lightning-id-customization-via","repo_url":"https://github.com/tothebeginning/pulid","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"text-to-image-generation-1","task_name":"Text to Image Generation"},{"task_slug":"text-to-image-generation","task_name":"Text-to-Image Generation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2404.16022","atlas_url":"https://app.syntology.ai/?focus=2404.16022","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.16022"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/ToTheBeginning/PuLID","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tothebeginning/pulid","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":6,"ran_violates":2,"ran":3,"unverified":4},"by_repo_kind":{"official":{"samples":10,"ran":7,"repositories":1},"community":{"samples":5,"ran":4,"repositories":2}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"5105747c2711b1cb","entry":"FeedForward","repo":"tothebeginning/pulid","repo_kind":"official","path":"pulid/encoders_transformer.py","file_url":"https://github.com/tothebeginning/pulid/blob/HEAD/pulid/encoders_transformer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5105747c2711b1cb"}},{"code_sha256_prefix":"0a65604f002e6ce4","entry":"convert_to_custom_text_state_dict","repo":"ToTheBeginning/PuLID","repo_kind":"official","path":"eva_clip/model.py","file_url":"https://github.com/ToTheBeginning/PuLID/blob/HEAD/eva_clip/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0a65604f002e6ce4"}},{"code_sha256_prefix":"7bff6f3b3cb560e7","entry":"convert_to_custom_text_state_dict","repo":"zsxkib/PuLID","repo_kind":"community","path":"eva_clip/model.py","file_url":"https://github.com/zsxkib/PuLID/blob/HEAD/eva_clip/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7bff6f3b3cb560e7"}},{"code_sha256_prefix":"4849b7c1d0b556ce","entry":"drop_seq_token","repo":"tothebeginning/pulid","repo_kind":"official","path":"pulid/utils.py","file_url":"https://github.com/tothebeginning/pulid/blob/HEAD/pulid/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4849b7c1d0b556ce"}},{"code_sha256_prefix":"61d9ad9efd32efee","entry":"get_cast_dtype","repo":"ToTheBeginning/PuLID","repo_kind":"official","path":"eva_clip/model.py","file_url":"https://github.com/ToTheBeginning/PuLID/blob/HEAD/eva_clip/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"61d9ad9efd32efee"}},{"code_sha256_prefix":"dcd422d66b0581d8","entry":"get_cast_dtype","repo":"zsxkib/PuLID","repo_kind":"community","path":"eva_clip/model.py","file_url":"https://github.com/zsxkib/PuLID/blob/HEAD/eva_clip/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dcd422d66b0581d8"}},{"code_sha256_prefix":"221b2d116fdf1032","entry":"get_obj_from_str","repo":"tothebeginning/pulid","repo_kind":"official","path":"pulid/utils.py","file_url":"https://github.com/tothebeginning/pulid/blob/HEAD/pulid/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"221b2d116fdf1032"}},{"code_sha256_prefix":"f32e6125ee65d8a8","entry":"image_to_tensor","repo":"sipie800/ComfyUI-PuLID-Flux-Enhanced","repo_kind":"community","path":"pulidflux.py","file_url":"https://github.com/sipie800/ComfyUI-PuLID-Flux-Enhanced/blob/HEAD/pulidflux.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f32e6125ee65d8a8"}},{"code_sha256_prefix":"9d7051552589b1be","entry":"instantiate_from_config","repo":"tothebeginning/pulid","repo_kind":"official","path":"pulid/utils.py","file_url":"https://github.com/tothebeginning/pulid/blob/HEAD/pulid/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9d7051552589b1be"}},{"code_sha256_prefix":"4cb2e2a2ca0bec9f","entry":"reshape_tensor","repo":"tothebeginning/pulid","repo_kind":"official","path":"pulid/encoders_transformer.py","file_url":"https://github.com/tothebeginning/pulid/blob/HEAD/pulid/encoders_transformer.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4cb2e2a2ca0bec9f"}},{"code_sha256_prefix":"df32d23cfb914023","entry":"tensor_to_image","repo":"sipie800/ComfyUI-PuLID-Flux-Enhanced","repo_kind":"community","path":"pulidflux.py","file_url":"https://github.com/sipie800/ComfyUI-PuLID-Flux-Enhanced/blob/HEAD/pulidflux.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"df32d23cfb914023"}},{"code_sha256_prefix":"e3f7350246f3e4bb","entry":"build_model_from_openai_state_dict","repo":"ToTheBeginning/PuLID","repo_kind":"official","path":"eva_clip/model.py","file_url":"https://github.com/ToTheBeginning/PuLID/blob/HEAD/eva_clip/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e3f7350246f3e4bb"}},{"code_sha256_prefix":"b34d6c17c6e09a04","entry":"build_model_from_openai_state_dict","repo":"zsxkib/PuLID","repo_kind":"community","path":"eva_clip/model.py","file_url":"https://github.com/zsxkib/PuLID/blob/HEAD/eva_clip/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b34d6c17c6e09a04"}},{"code_sha256_prefix":"ddcbd45e940484ee","entry":"gather_features","repo":"tothebeginning/pulid","repo_kind":"official","path":"eva_clip/loss.py","file_url":"https://github.com/tothebeginning/pulid/blob/HEAD/eva_clip/loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ddcbd45e940484ee"}},{"code_sha256_prefix":"2a377da4a76a2d44","entry":"register_pooler","repo":"tothebeginning/pulid","repo_kind":"official","path":"eva_clip/hf_model.py","file_url":"https://github.com/tothebeginning/pulid/blob/HEAD/eva_clip/hf_model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2a377da4a76a2d44"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}