{"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/designing-an-encoder-for-stylegan-image","title":"Designing an Encoder for StyleGAN Image Manipulation","arxiv_id":"2102.02766","date":"2021-02-04","proceeding":null,"authors":["Omer Tov","Yuval Alaluf","Yotam Nitzan","Or Patashnik","Daniel Cohen-Or"],"abstract":"Recently, there has been a surge of diverse methods for performing image editing by employing pre-trained unconditional generators. Applying these methods on real images, however, remains a challenge, as it necessarily requires the inversion of the images into their latent space. To successfully invert a real image, one needs to find a latent code that reconstructs the input image accurately, and more importantly, allows for its meaningful manipulation. In this paper, we carefully study the latent space of StyleGAN, the state-of-the-art unconditional generator. We identify and analyze the existence of a distortion-editability tradeoff and a distortion-perception tradeoff within the StyleGAN latent space. We then suggest two principles for designing encoders in a manner that allows one to control the proximity of the inversions to regions that StyleGAN was originally trained on. We present an encoder based on our two principles that is specifically designed for facilitating editing on real images by balancing these tradeoffs. By evaluating its performance qualitatively and quantitatively on numerous challenging domains, including cars and horses, we show that our inversion method, followed by common editing techniques, achieves superior real-image editing quality, with only a small reconstruction accuracy drop.","url_abs":"https://arxiv.org/abs/2102.02766v1","url_pdf":"https://arxiv.org/pdf/2102.02766v1.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":"designing-an-encoder-for-stylegan-image","repo_url":"https://github.com/omertov/encoder4editing","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"designing-an-encoder-for-stylegan-image","repo_url":"https://github.com/akatigre/multi2one","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"designing-an-encoder-for-stylegan-image","repo_url":"https://github.com/eladrich/pixel2style2pixel","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"designing-an-encoder-for-stylegan-image","repo_url":"https://github.com/mikelasz/fair-psp","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"designing-an-encoder-for-stylegan-image","repo_url":"https://github.com/orpatashnik/StyleCLIP","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"designing-an-encoder-for-stylegan-image","repo_url":"https://github.com/stelabou/stylegan_directions_face_reenactment","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"designing-an-encoder-for-stylegan-image","repo_url":"https://github.com/yangli-lab/artifact-eraser","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"unanswered"}},{"paper_slug":"designing-an-encoder-for-stylegan-image","repo_url":"https://github.com/yuval-alaluf/restyle-encoder","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-manipulation","task_name":"Image Manipulation"}],"methods":[{"method_slug":"adaptive-instance-normalization","method_name":"Adaptive Instance Normalization"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"feedforward-network","method_name":"Feedforward Network"},{"method_slug":"r1-regularization","method_name":"R1 Regularization"},{"method_slug":"stylegan","method_name":"StyleGAN"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2102.02766","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2102.02766"}},"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/eladrich/pixel2style2pixel","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mikelasz/fair-psp","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yuval-alaluf/restyle-encoder","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/stelabou/stylegan_directions_face_reenactment","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/omertov/encoder4editing","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/akatigre/multi2one","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/orpatashnik/StyleCLIP","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yangli-lab/artifact-eraser","reach":{"status":"unanswered"}}],"summary":{"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":2,"ran":1,"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":"d027eaaf8c4b5c3e","entry":"get_latents","repo":"omertov/encoder4editing","repo_kind":"official","path":"scripts/inference.py","file_url":"https://github.com/omertov/encoder4editing/blob/HEAD/scripts/inference.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d027eaaf8c4b5c3e"}},{"code_sha256_prefix":"56b7de72d9413f8f","entry":"get_all_latents","repo":"omertov/encoder4editing","repo_kind":"official","path":"scripts/inference.py","file_url":"https://github.com/omertov/encoder4editing/blob/HEAD/scripts/inference.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"56b7de72d9413f8f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}