{"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/domain-expansion-of-image-generators","title":"Domain Expansion of Image Generators","arxiv_id":"2301.05225","date":"2023-01-12","proceeding":"CVPR 2023 1","authors":["Yotam Nitzan","Michaël Gharbi","Richard Zhang","Taesung Park","Jun-Yan Zhu","Daniel Cohen-Or","Eli Shechtman"],"abstract":"Can one inject new concepts into an already trained generative model, while respecting its existing structure and knowledge? We propose a new task - domain expansion - to address this. Given a pretrained generator and novel (but related) domains, we expand the generator to jointly model all domains, old and new, harmoniously. First, we note the generator contains a meaningful, pretrained latent space. Is it possible to minimally perturb this hard-earned representation, while maximally representing the new domains? Interestingly, we find that the latent space offers unused, \"dormant\" directions, which do not affect the output. This provides an opportunity: By \"repurposing\" these directions, we can represent new domains without perturbing the original representation. In fact, we find that pretrained generators have the capacity to add several - even hundreds - of new domains! Using our expansion method, one \"expanded\" model can supersede numerous domain-specific models, without expanding the model size. Additionally, a single expanded generator natively supports smooth transitions between domains, as well as composition of domains. Code and project page available at https://yotamnitzan.github.io/domain-expansion/.","url_abs":"https://arxiv.org/abs/2301.05225v2","url_pdf":"https://arxiv.org/pdf/2301.05225v2.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":"domain-expansion-of-image-generators","repo_url":"https://github.com/adobe-research/domain-expansion","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"domain-expansion-of-image-generators","repo_url":"https://github.com/lllyasviel/controlnet","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2301.05225","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2301.05225"}},"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/adobe-research/domain-expansion","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lllyasviel/controlnet","reach":null}],"summary":{"ran":11,"ran_draft_wrong":3,"ran_fixture":2,"unverified":10},"by_repo_kind":{"listed":{"samples":25,"ran":16,"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":4,"samples":[{"code_sha256_prefix":"70ec8e3dd3981b5e","entry":"CheckpointFunction","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"70ec8e3dd3981b5e"}},{"code_sha256_prefix":"87dcf207c5c9187c","entry":"CrossAttention","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"87dcf207c5c9187c"}},{"code_sha256_prefix":"0feab49c606075bb","entry":"Downsample","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0feab49c606075bb"}},{"code_sha256_prefix":"1ce39bf592ba310f","entry":"FeedForward","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1ce39bf592ba310f"}},{"code_sha256_prefix":"387673fa5780bf50","entry":"GEGLU","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"387673fa5780bf50"}},{"code_sha256_prefix":"426c2385fa431d9a","entry":"GroupNorm32","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"426c2385fa431d9a"}},{"code_sha256_prefix":"77ce242242a53898","entry":"MemoryEfficientCrossAttention","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"77ce242242a53898"}},{"code_sha256_prefix":"186bf0385ab93dad","entry":"QKVAttention","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"186bf0385ab93dad"}},{"code_sha256_prefix":"8dd1080ff568f7f4","entry":"QKVAttentionLegacy","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8dd1080ff568f7f4"}},{"code_sha256_prefix":"1b4579fe4aec5257","entry":"Upsample","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1b4579fe4aec5257"}},{"code_sha256_prefix":"0e30585f04efffbe","entry":"linear","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0e30585f04efffbe"}},{"code_sha256_prefix":"daafc1c89511b8be","entry":"normalization","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"daafc1c89511b8be"}},{"code_sha256_prefix":"3d6ab840977ec3fe","entry":"project_to_subspaces","repo":"adobe-research/domain-expansion","repo_kind":"listed","path":"expansion_utils/latent_operations.py","file_url":"https://github.com/adobe-research/domain-expansion/blob/HEAD/expansion_utils/latent_operations.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"3d6ab840977ec3fe"}},{"code_sha256_prefix":"9df115707ad18735","entry":"timestep_embedding","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9df115707ad18735"}},{"code_sha256_prefix":"68d7fb7e4dabea9b","entry":"w_to_wplus","repo":"adobe-research/domain-expansion","repo_kind":"listed","path":"expansion_utils/latent_operations.py","file_url":"https://github.com/adobe-research/domain-expansion/blob/HEAD/expansion_utils/latent_operations.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"68d7fb7e4dabea9b"}},{"code_sha256_prefix":"813a9bbe55cbc6bc","entry":"wplus_to_w","repo":"adobe-research/domain-expansion","repo_kind":"listed","path":"expansion_utils/latent_operations.py","file_url":"https://github.com/adobe-research/domain-expansion/blob/HEAD/expansion_utils/latent_operations.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"813a9bbe55cbc6bc"}},{"code_sha256_prefix":"9ad1408b60f64d8e","entry":"AttentionBlock","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"9ad1408b60f64d8e"}},{"code_sha256_prefix":"76c528e8baaee5c6","entry":"BasicTransformerBlock","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"76c528e8baaee5c6"}},{"code_sha256_prefix":"422ae8467d21d22b","entry":"ControlNet","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"422ae8467d21d22b"}},{"code_sha256_prefix":"6ac534327b50ba98","entry":"ResBlock","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"6ac534327b50ba98"}},{"code_sha256_prefix":"9c960ef8abe48657","entry":"SpatialTransformer","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"9c960ef8abe48657"}},{"code_sha256_prefix":"7958a01675377ce4","entry":"TimestepBlock","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"7958a01675377ce4"}},{"code_sha256_prefix":"07137093faf869ca","entry":"TimestepEmbedSequential","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"07137093faf869ca"}},{"code_sha256_prefix":"ecd0fc28815b65ae","entry":"avg_pool_nd","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"ecd0fc28815b65ae"}},{"code_sha256_prefix":"c596e50230fd9ed8","entry":"checkpoint","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"c596e50230fd9ed8"}},{"code_sha256_prefix":"6e9c81a619f204c5","entry":"count_flops_attn","repo":"lllyasviel/controlnet","repo_kind":"listed","path":"cldm/cldm.py","file_url":"https://github.com/lllyasviel/controlnet/blob/HEAD/cldm/cldm.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":"6e9c81a619f204c5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}