{"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/z-zero-shot-style-transfer-via-attention","title":"$Z^*$: Zero-shot Style Transfer via Attention Rearrangement","arxiv_id":"2311.16491","date":"2023-11-25","proceeding":null,"authors":["Yingying Deng","Xiangyu He","Fan Tang","WeiMing Dong"],"abstract":"Despite the remarkable progress in image style transfer, formulating style in the context of art is inherently subjective and challenging. In contrast to existing learning/tuning methods, this study shows that vanilla diffusion models can directly extract style information and seamlessly integrate the generative prior into the content image without retraining. Specifically, we adopt dual denoising paths to represent content/style references in latent space and then guide the content image denoising process with style latent codes. We further reveal that the cross-attention mechanism in latent diffusion models tends to blend the content and style images, resulting in stylized outputs that deviate from the original content image. To overcome this limitation, we introduce a cross-attention rearrangement strategy. Through theoretical analysis and experiments, we demonstrate the effectiveness and superiority of the diffusion-based $\\underline{Z}$ero-shot $\\underline{S}$tyle $\\underline{T}$ransfer via $\\underline{A}$ttention $\\underline{R}$earrangement, Z-STAR.","url_abs":"https://arxiv.org/abs/2311.16491v1","url_pdf":"https://arxiv.org/pdf/2311.16491v1.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":"z-zero-shot-style-transfer-via-attention","repo_url":"https://github.com/HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"style-transfer","task_name":"Style Transfer"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2311.16491","atlas_url":"https://app.syntology.ai/?focus=2311.16491","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.16491"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":2,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"official":{"samples":5,"ran":3,"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":"a042902caede448b","entry":"diffusion_step","repo":"HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement","repo_kind":"official","path":"ptp_utils.py","file_url":"https://github.com/HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement/blob/HEAD/ptp_utils.py","link_basis":"harvester_set","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":"a042902caede448b"}},{"code_sha256_prefix":"e3c3bb87bbe9b4a7","entry":"latent2image","repo":"HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement","repo_kind":"official","path":"ptp_utils.py","file_url":"https://github.com/HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement/blob/HEAD/ptp_utils.py","link_basis":"harvester_set","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":"e3c3bb87bbe9b4a7"}},{"code_sha256_prefix":"85d5eb123674597d","entry":"text_under_image","repo":"HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement","repo_kind":"official","path":"ptp_utils.py","file_url":"https://github.com/HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement/blob/HEAD/ptp_utils.py","link_basis":"harvester_set","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":"85d5eb123674597d"}},{"code_sha256_prefix":"d321812b8f73ef4b","entry":"regiter_attention_editor_diffusers","repo":"HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement","repo_kind":"official","path":"zstar/zstar_utils.py","file_url":"https://github.com/HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement/blob/HEAD/zstar/zstar_utils.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":"d321812b8f73ef4b"}},{"code_sha256_prefix":"431f768e76ae86fa","entry":"regiter_attention_editor_ldm","repo":"HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement","repo_kind":"official","path":"zstar/zstar_utils.py","file_url":"https://github.com/HolmesShuan/Zero-shot-Style-Transfer-via-Attention-Rearrangement/blob/HEAD/zstar/zstar_utils.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":"431f768e76ae86fa"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}