{"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/style-injection-in-diffusion-a-training-free","title":"Style Injection in Diffusion: A Training-free Approach for Adapting Large-scale Diffusion Models for Style Transfer","arxiv_id":"2312.09008","date":"2023-12-11","proceeding":"CVPR 2024 1","authors":["Jiwoo Chung","Sangeek Hyun","Jae-Pil Heo"],"abstract":"Despite the impressive generative capabilities of diffusion models, existing diffusion model-based style transfer methods require inference-stage optimization (e.g. fine-tuning or textual inversion of style) which is time-consuming, or fails to leverage the generative ability of large-scale diffusion models. To address these issues, we introduce a novel artistic style transfer method based on a pre-trained large-scale diffusion model without any optimization. Specifically, we manipulate the features of self-attention layers as the way the cross-attention mechanism works; in the generation process, substituting the key and value of content with those of style image. This approach provides several desirable characteristics for style transfer including 1) preservation of content by transferring similar styles into similar image patches and 2) transfer of style based on similarity of local texture (e.g. edge) between content and style images. Furthermore, we introduce query preservation and attention temperature scaling to mitigate the issue of disruption of original content, and initial latent Adaptive Instance Normalization (AdaIN) to deal with the disharmonious color (failure to transfer the colors of style). Our experimental results demonstrate that our proposed method surpasses state-of-the-art methods in both conventional and diffusion-based style transfer baselines.","url_abs":"https://arxiv.org/abs/2312.09008v2","url_pdf":"https://arxiv.org/pdf/2312.09008v2.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":"style-injection-in-diffusion-a-training-free","repo_url":"https://github.com/jiwoogit/StyleID","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"style-transfer","task_name":"Style Transfer"}],"methods":[{"method_slug":"adaptive-instance-normalization","method_name":"Adaptive Instance Normalization"},{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"instance-normalization","method_name":"Instance Normalization"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/style-transfer-on-stylebench","task":"Style Transfer","dataset":"StyleBench","model":"StyleID","rank_in_archive_order":2,"of":7,"metrics":{"CLIP Score":"0.604"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2312.09008","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.09008"}},"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/jiwoogit/StyleID","reach":null}],"summary":{"ran_fixture":2,"ran_draft_wrong":1},"by_repo_kind":{"official":{"samples":3,"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":"46ae4450d3d338ba","entry":"adain","repo":"jiwoogit/StyleID","repo_kind":"official","path":"run_styleid.py","file_url":"https://github.com/jiwoogit/StyleID/blob/HEAD/run_styleid.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"46ae4450d3d338ba"}},{"code_sha256_prefix":"33f7740ac97c244d","entry":"compute_frechet_distance","repo":"jiwoogit/StyleID","repo_kind":"official","path":"evaluation/eval_artfid.py","file_url":"https://github.com/jiwoogit/StyleID/blob/HEAD/evaluation/eval_artfid.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"33f7740ac97c244d"}},{"code_sha256_prefix":"48d5c5d6cd4c8ff4","entry":"feat_merge","repo":"jiwoogit/StyleID","repo_kind":"official","path":"run_styleid.py","file_url":"https://github.com/jiwoogit/StyleID/blob/HEAD/run_styleid.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"48d5c5d6cd4c8ff4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}