{"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/characterfactory-sampling-consistent","title":"CharacterFactory: Sampling Consistent Characters with GANs for Diffusion Models","arxiv_id":"2404.15677","date":"2024-04-24","proceeding":null,"authors":["Qinghe Wang","Baolu Li","Xiaomin Li","Bing Cao","Liqian Ma","Huchuan Lu","Xu Jia"],"abstract":"Recent advances in text-to-image models have opened new frontiers in human-centric generation. However, these models cannot be directly employed to generate images with consistent newly coined identities. In this work, we propose CharacterFactory, a framework that allows sampling new characters with consistent identities in the latent space of GANs for diffusion models. More specifically, we consider the word embeddings of celeb names as ground truths for the identity-consistent generation task and train a GAN model to learn the mapping from a latent space to the celeb embedding space. In addition, we design a context-consistent loss to ensure that the generated identity embeddings can produce identity-consistent images in various contexts. Remarkably, the whole model only takes 10 minutes for training, and can sample infinite characters end-to-end during inference. Extensive experiments demonstrate excellent performance of the proposed CharacterFactory on character creation in terms of identity consistency and editability. Furthermore, the generated characters can be seamlessly combined with the off-the-shelf image/video/3D diffusion models. We believe that the proposed CharacterFactory is an important step for identity-consistent character generation. Project page is available at: https://qinghew.github.io/CharacterFactory/.","url_abs":"https://arxiv.org/abs/2404.15677v2","url_pdf":"https://arxiv.org/pdf/2404.15677v2.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":"characterfactory-sampling-consistent","repo_url":"https://github.com/qinghew/CharacterFactory","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"consistent-character-generation","task_name":"Consistent Character Generation"},{"task_slug":"word-embeddings","task_name":"Word Embeddings"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.15677","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.15677"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/qinghew/CharacterFactory","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":6,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"official":{"samples":9,"ran":7,"repositories":1}},"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":"93719d1ffaad162b","entry":"add_noise_return_paras","repo":"qinghew/CharacterFactory","repo_kind":"official","path":"utils.py","file_url":"https://github.com/qinghew/CharacterFactory/blob/HEAD/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":"93719d1ffaad162b"}},{"code_sha256_prefix":"0738f543a73a1096","entry":"discriminator_r1_loss_accelerator","repo":"qinghew/CharacterFactory","repo_kind":"official","path":"utils.py","file_url":"https://github.com/qinghew/CharacterFactory/blob/HEAD/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":"0738f543a73a1096"}},{"code_sha256_prefix":"30c989755522dca7","entry":"embedding_forward","repo":"qinghew/CharacterFactory","repo_kind":"official","path":"models/celeb_embeddings.py","file_url":"https://github.com/qinghew/CharacterFactory/blob/HEAD/models/celeb_embeddings.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":"30c989755522dca7"}},{"code_sha256_prefix":"2340eb21cf6c4ce5","entry":"get_clip_token_for_string","repo":"qinghew/CharacterFactory","repo_kind":"official","path":"models/embedding_manager.py","file_url":"https://github.com/qinghew/CharacterFactory/blob/HEAD/models/embedding_manager.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":"2340eb21cf6c4ce5"}},{"code_sha256_prefix":"185e8742c689f316","entry":"get_embedding_for_clip_token","repo":"qinghew/CharacterFactory","repo_kind":"official","path":"models/embedding_manager.py","file_url":"https://github.com/qinghew/CharacterFactory/blob/HEAD/models/embedding_manager.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":"185e8742c689f316"}},{"code_sha256_prefix":"fd9206b7174f95ba","entry":"get_rep_pos","repo":"qinghew/CharacterFactory","repo_kind":"official","path":"models/id_embedding/helpers.py","file_url":"https://github.com/qinghew/CharacterFactory/blob/HEAD/models/id_embedding/helpers.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":"fd9206b7174f95ba"}},{"code_sha256_prefix":"c8ec5333f4bcb71f","entry":"leaky_relu","repo":"qinghew/CharacterFactory","repo_kind":"official","path":"models/id_embedding/meta_net.py","file_url":"https://github.com/qinghew/CharacterFactory/blob/HEAD/models/id_embedding/meta_net.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":"c8ec5333f4bcb71f"}},{"code_sha256_prefix":"c451f8fed3a37a6f","entry":"discriminator_r1_loss","repo":"qinghew/CharacterFactory","repo_kind":"official","path":"utils.py","file_url":"https://github.com/qinghew/CharacterFactory/blob/HEAD/utils.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":"c451f8fed3a37a6f"}},{"code_sha256_prefix":"109f33b49ebd4274","entry":"shift_tensor_dim0","repo":"qinghew/CharacterFactory","repo_kind":"official","path":"models/id_embedding/helpers.py","file_url":"https://github.com/qinghew/CharacterFactory/blob/HEAD/models/id_embedding/helpers.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":"109f33b49ebd4274"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}