{"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/towards-highly-realistic-artistic-style","title":"Towards Highly Realistic Artistic Style Transfer via Stable Diffusion with Step-aware and Layer-aware Prompt","arxiv_id":"2404.11474","date":"2024-04-17","proceeding":null,"authors":["Zhanjie Zhang","Quanwei Zhang","Huaizhong Lin","Wei Xing","Juncheng Mo","Shuaicheng Huang","Jinheng Xie","Guangyuan Li","Junsheng Luan","Lei Zhao","Dalong Zhang","Lixia Chen"],"abstract":"Artistic style transfer aims to transfer the learned artistic style onto an arbitrary content image, generating artistic stylized images. Existing generative adversarial network-based methods fail to generate highly realistic stylized images and always introduce obvious artifacts and disharmonious patterns. Recently, large-scale pre-trained diffusion models opened up a new way for generating highly realistic artistic stylized images. However, diffusion model-based methods generally fail to preserve the content structure of input content images well, introducing some undesired content structure and style patterns. To address the above problems, we propose a novel pre-trained diffusion-based artistic style transfer method, called LSAST, which can generate highly realistic artistic stylized images while preserving the content structure of input content images well, without bringing obvious artifacts and disharmonious style patterns. Specifically, we introduce a Step-aware and Layer-aware Prompt Space, a set of learnable prompts, which can learn the style information from the collection of artworks and dynamically adjusts the input images' content structure and style pattern. To train our prompt space, we propose a novel inversion method, called Step-ware and Layer-aware Prompt Inversion, which allows the prompt space to learn the style information of the artworks collection. In addition, we inject a pre-trained conditional branch of ControlNet into our LSAST, which further improved our framework's ability to maintain content structure. Extensive experiments demonstrate that our proposed method can generate more highly realistic artistic stylized images than the state-of-the-art artistic style transfer methods.","url_abs":"https://arxiv.org/abs/2404.11474v3","url_pdf":"https://arxiv.org/pdf/2404.11474v3.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":"towards-highly-realistic-artistic-style","repo_url":"https://github.com/jamie-cheung/lsast","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":null,"task_name":"Generative Adversarial Network"},{"task_slug":"style-transfer","task_name":"Style Transfer"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2404.11474","atlas_url":"https://app.syntology.ai/?focus=2404.11474","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.11474"}},"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/jamie-cheung/lsast","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/Jamie-Cheung/LSAST","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":5,"ran_draft_wrong":4,"unverified":11},"by_repo_kind":{"official":{"samples":20,"ran":9,"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":"69360f5b0cc8f069","entry":"CheckpointFunction","repo":"Jamie-Cheung/LSAST","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/Jamie-Cheung/LSAST/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":"69360f5b0cc8f069"}},{"code_sha256_prefix":"edd0dbdde64951f7","entry":"CrossAttention","repo":"Jamie-Cheung/LSAST","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/Jamie-Cheung/LSAST/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":"edd0dbdde64951f7"}},{"code_sha256_prefix":"713884729e861c62","entry":"MemoryEfficientCrossAttention","repo":"Jamie-Cheung/LSAST","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/Jamie-Cheung/LSAST/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":"713884729e861c62"}},{"code_sha256_prefix":"c3a6b977022957cb","entry":"Normalize","repo":"jamie-cheung/lsast","repo_kind":"official","path":"cldm/sanet.py","file_url":"https://github.com/jamie-cheung/lsast/blob/HEAD/cldm/sanet.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":"c3a6b977022957cb"}},{"code_sha256_prefix":"a0ab4de8a03b69b0","entry":"adaptive_instance_normalization","repo":"jamie-cheung/lsast","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/jamie-cheung/lsast/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":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a0ab4de8a03b69b0"}},{"code_sha256_prefix":"98f385d847636a3e","entry":"basic_clean","repo":"jamie-cheung/lsast","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/jamie-cheung/lsast/blob/HEAD/clip/simple_tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"98f385d847636a3e"}},{"code_sha256_prefix":"6576c5264bea5331","entry":"calc_mean_std","repo":"jamie-cheung/lsast","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/jamie-cheung/lsast/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":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6576c5264bea5331"}},{"code_sha256_prefix":"d919ae32e5e4e616","entry":"get_pairs","repo":"jamie-cheung/lsast","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/jamie-cheung/lsast/blob/HEAD/clip/simple_tokenizer.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":"d919ae32e5e4e616"}},{"code_sha256_prefix":"9542161e9640b858","entry":"whitespace_clean","repo":"jamie-cheung/lsast","repo_kind":"official","path":"clip/simple_tokenizer.py","file_url":"https://github.com/jamie-cheung/lsast/blob/HEAD/clip/simple_tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9542161e9640b858"}},{"code_sha256_prefix":"b6dff222c0e9edfe","entry":"AttentionBlock","repo":"Jamie-Cheung/LSAST","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/Jamie-Cheung/LSAST/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":"b6dff222c0e9edfe"}},{"code_sha256_prefix":"cd763b5f891b0938","entry":"BasicTransformerBlock","repo":"Jamie-Cheung/LSAST","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/Jamie-Cheung/LSAST/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":"cd763b5f891b0938"}},{"code_sha256_prefix":"60d938a3fe7521c0","entry":"ControlNet_style","repo":"Jamie-Cheung/LSAST","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/Jamie-Cheung/LSAST/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":"60d938a3fe7521c0"}},{"code_sha256_prefix":"66e12c88bac640da","entry":"ResBlock","repo":"Jamie-Cheung/LSAST","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/Jamie-Cheung/LSAST/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":"66e12c88bac640da"}},{"code_sha256_prefix":"406611ffc8d44703","entry":"SpatialTransformer","repo":"Jamie-Cheung/LSAST","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/Jamie-Cheung/LSAST/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":"406611ffc8d44703"}},{"code_sha256_prefix":"1c67e34b46237f50","entry":"TimestepEmbedSequential","repo":"Jamie-Cheung/LSAST","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/Jamie-Cheung/LSAST/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":"1c67e34b46237f50"}},{"code_sha256_prefix":"39e6b23b55f376ea","entry":"build_model","repo":"jamie-cheung/lsast","repo_kind":"official","path":"clip/model.py","file_url":"https://github.com/jamie-cheung/lsast/blob/HEAD/clip/model.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":"39e6b23b55f376ea"}},{"code_sha256_prefix":"21f94f83ceb82390","entry":"checkpoint","repo":"Jamie-Cheung/LSAST","repo_kind":"official","path":"cldm/cldm.py","file_url":"https://github.com/Jamie-Cheung/LSAST/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":"21f94f83ceb82390"}},{"code_sha256_prefix":"cfc17707f35e7ec4","entry":"get_state_dict","repo":"jamie-cheung/lsast","repo_kind":"official","path":"cldm/model.py","file_url":"https://github.com/jamie-cheung/lsast/blob/HEAD/cldm/model.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":"cfc17707f35e7ec4"}},{"code_sha256_prefix":"f6f30e41636ae569","entry":"load","repo":"jamie-cheung/lsast","repo_kind":"official","path":"clip/clip.py","file_url":"https://github.com/jamie-cheung/lsast/blob/HEAD/clip/clip.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":"f6f30e41636ae569"}},{"code_sha256_prefix":"df733a879693145d","entry":"load_state_dict","repo":"jamie-cheung/lsast","repo_kind":"official","path":"cldm/model.py","file_url":"https://github.com/jamie-cheung/lsast/blob/HEAD/cldm/model.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":"df733a879693145d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}