{"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/a-recipe-for-watermarking-diffusion-models","title":"A Recipe for Watermarking Diffusion Models","arxiv_id":"2303.10137","date":"2023-03-17","proceeding":null,"authors":["Yunqing Zhao","Tianyu Pang","Chao Du","Xiao Yang","Ngai-Man Cheung","Min Lin"],"abstract":"Diffusion models (DMs) have demonstrated advantageous potential on generative tasks. Widespread interest exists in incorporating DMs into downstream applications, such as producing or editing photorealistic images. However, practical deployment and unprecedented power of DMs raise legal issues, including copyright protection and monitoring of generated content. In this regard, watermarking has been a proven solution for copyright protection and content monitoring, but it is underexplored in the DMs literature. Specifically, DMs generate samples from longer tracks and may have newly designed multimodal structures, necessitating the modification of conventional watermarking pipelines. To this end, we conduct comprehensive analyses and derive a recipe for efficiently watermarking state-of-the-art DMs (e.g., Stable Diffusion), via training from scratch or finetuning. Our recipe is straightforward but involves empirically ablated implementation details, providing a foundation for future research on watermarking DMs. The code is available at https://github.com/yunqing-me/WatermarkDM.","url_abs":"https://arxiv.org/abs/2303.10137v2","url_pdf":"https://arxiv.org/pdf/2303.10137v2.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":"a-recipe-for-watermarking-diffusion-models","repo_url":"https://github.com/yunqing-me/watermarkdm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2303.10137","atlas_url":"https://app.syntology.ai/?focus=2303.10137","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.10137"}},"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/yunqing-me/watermarkdm","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":3,"ran_draft_wrong":4,"ran":2,"ran_fixture":1,"unverified":3},"by_repo_kind":{"official":{"samples":13,"ran":10,"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":"45e941764344e7f3","entry":"calculate_fid_from_inception_stats","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/fid.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/fid.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"45e941764344e7f3"}},{"code_sha256_prefix":"8241c0562bc710fd","entry":"chunk","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"sd_watermark/stable_txt2img.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/sd_watermark/stable_txt2img.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8241c0562bc710fd"}},{"code_sha256_prefix":"a2b45afa097b55b6","entry":"file_ext","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/dataset_tool.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/dataset_tool.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a2b45afa097b55b6"}},{"code_sha256_prefix":"674eca7b9e1b6439","entry":"format_time","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/dnnlib/util.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/dnnlib/util.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"674eca7b9e1b6439"}},{"code_sha256_prefix":"32af001972a0699f","entry":"format_time_brief","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/dnnlib/util.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/dnnlib/util.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"32af001972a0699f"}},{"code_sha256_prefix":"6840e76ae36d16b1","entry":"generate_random_fingerprints","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"string2img/embed_watermark_cifar10.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/string2img/embed_watermark_cifar10.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6840e76ae36d16b1"}},{"code_sha256_prefix":"dd1dc700e87f36cc","entry":"maybe_min","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/dataset_tool.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/dataset_tool.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dd1dc700e87f36cc"}},{"code_sha256_prefix":"cacd4f6ec202d9b4","entry":"parse_int_list","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/generate.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/generate.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cacd4f6ec202d9b4"}},{"code_sha256_prefix":"07b21b35ecb4815c","entry":"parse_tuple","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/dataset_tool.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/dataset_tool.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"07b21b35ecb4815c"}},{"code_sha256_prefix":"d41a4250066bce93","entry":"weight_init","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/training/networks.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/training/networks.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d41a4250066bce93"}},{"code_sha256_prefix":"9fbf646e18eed1db","entry":"ablation_sampler","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/generate.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/generate.py","link_basis":"harvester_set","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":"9fbf646e18eed1db"}},{"code_sha256_prefix":"9d31d2c4cd16bb2d","entry":"ask_yes_no","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/dnnlib/util.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/dnnlib/util.py","link_basis":"harvester_set","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":"9d31d2c4cd16bb2d"}},{"code_sha256_prefix":"8b16b0674af254db","entry":"edm_sampler","repo":"yunqing-me/watermarkdm","repo_kind":"official","path":"edm/generate.py","file_url":"https://github.com/yunqing-me/watermarkdm/blob/HEAD/edm/generate.py","link_basis":"harvester_set","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":"8b16b0674af254db"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}