{"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/on-architectural-compression-of-text-to-image","title":"BK-SDM: A Lightweight, Fast, and Cheap Version of Stable Diffusion","arxiv_id":"2305.15798","date":"2023-05-25","proceeding":null,"authors":["Bo-Kyeong Kim","Hyoung-Kyu Song","Thibault Castells","Shinkook Choi"],"abstract":"Text-to-image (T2I) generation with Stable Diffusion models (SDMs) involves high computing demands due to billion-scale parameters. To enhance efficiency, recent studies have reduced sampling steps and applied network quantization while retaining the original architectures. The lack of architectural reduction attempts may stem from worries over expensive retraining for such massive models. In this work, we uncover the surprising potential of block pruning and feature distillation for low-cost general-purpose T2I. By removing several residual and attention blocks from the U-Net of SDMs, we achieve 30%~50% reduction in model size, MACs, and latency. We show that distillation retraining is effective even under limited resources: using only 13 A100 days and a tiny dataset, our compact models can imitate the original SDMs (v1.4 and v2.1-base with over 6,000 A100 days). Benefiting from the transferred knowledge, our BK-SDMs deliver competitive results on zero-shot MS-COCO against larger multi-billion parameter models. We further demonstrate the applicability of our lightweight backbones in personalized generation and image-to-image translation. Deployment of our models on edge devices attains 4-second inference. Code and models can be found at: https://github.com/Nota-NetsPresso/BK-SDM","url_abs":"https://arxiv.org/abs/2305.15798v4","url_pdf":"https://arxiv.org/pdf/2305.15798v4.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":"on-architectural-compression-of-text-to-image","repo_url":"https://github.com/Nota-NetsPresso/BK-SDM","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"on-architectural-compression-of-text-to-image","repo_url":"https://github.com/segmind/distill-sd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"on-architectural-compression-of-text-to-image","repo_url":"https://github.com/Gothos/BK-SDM","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"dreambooth-personalized-generation","task_name":"DreamBooth Personalized Generation"},{"task_slug":"image-to-image-translation","task_name":"Image-to-Image Translation"},{"task_slug":"text-to-image-generation","task_name":"Text-to-Image Generation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"knowledge-distillation","method_name":"Knowledge Distillation"},{"method_slug":"latent-diffusion-model","method_name":"Latent Diffusion Model"},{"method_slug":"pruning","method_name":"Pruning"},{"method_slug":"u-net","method_name":"U-Net"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2305.15798","atlas_url":"https://app.syntology.ai/?focus=2305.15798","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.15798"}},"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/Nota-NetsPresso/BK-SDM","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Gothos/BK-SDM","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/segmind/distill-sd","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran_draft_wrong":2,"ran_fixture":1},"by_repo_kind":{"official":{"samples":3,"ran":3,"repositories":2}},"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":3,"samples":[{"code_sha256_prefix":"5c6d6c3c4e988d5f","entry":"copy_weight_from_teacher","repo":"Nota-NetsPresso/BK-SDM","repo_kind":"official","path":"src/kd_train_text_to_image.py","file_url":"https://github.com/Nota-NetsPresso/BK-SDM/blob/HEAD/src/kd_train_text_to_image.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":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"5c6d6c3c4e988d5f"}},{"code_sha256_prefix":"1221004575bdc5d9","entry":"get_activation","repo":"Nota-NetsPresso/BK-SDM","repo_kind":"official","path":"src/kd_train_text_to_image.py","file_url":"https://github.com/Nota-NetsPresso/BK-SDM/blob/HEAD/src/kd_train_text_to_image.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"1221004575bdc5d9"}},{"code_sha256_prefix":"302a044fe46029e6","entry":"make_image_grid","repo":"segmind/distill-sd","repo_kind":"official","path":"distill_training.py","file_url":"https://github.com/segmind/distill-sd/blob/HEAD/distill_training.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"302a044fe46029e6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}