{"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/storydiffusion-consistent-self-attention-for","title":"StoryDiffusion: Consistent Self-Attention for Long-Range Image and Video Generation","arxiv_id":"2405.01434","date":"2024-05-02","proceeding":null,"authors":["Yupeng Zhou","Daquan Zhou","Ming-Ming Cheng","Jiashi Feng","Qibin Hou"],"abstract":"For recent diffusion-based generative models, maintaining consistent content across a series of generated images, especially those containing subjects and complex details, presents a significant challenge. In this paper, we propose a new way of self-attention calculation, termed Consistent Self-Attention, that significantly boosts the consistency between the generated images and augments prevalent pretrained diffusion-based text-to-image models in a zero-shot manner. To extend our method to long-range video generation, we further introduce a novel semantic space temporal motion prediction module, named Semantic Motion Predictor. It is trained to estimate the motion conditions between two provided images in the semantic spaces. This module converts the generated sequence of images into videos with smooth transitions and consistent subjects that are significantly more stable than the modules based on latent spaces only, especially in the context of long video generation. By merging these two novel components, our framework, referred to as StoryDiffusion, can describe a text-based story with consistent images or videos encompassing a rich variety of contents. The proposed StoryDiffusion encompasses pioneering explorations in visual story generation with the presentation of images and videos, which we hope could inspire more research from the aspect of architectural modifications. Our code is made publicly available at https://github.com/HVision-NKU/StoryDiffusion.","url_abs":"https://arxiv.org/abs/2405.01434v1","url_pdf":"https://arxiv.org/pdf/2405.01434v1.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":"storydiffusion-consistent-self-attention-for","repo_url":"https://github.com/hvision-nku/storydiffusion","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"story-generation","task_name":"Story Generation"},{"task_slug":"video-generation","task_name":"Video Generation"},{"task_slug":"motion-prediction","task_name":"motion prediction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.01434","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.01434"}},"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/hvision-nku/storydiffusion","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":7},"by_repo_kind":{"official":{"samples":7,"ran":0,"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":"293847aedbd19e46","entry":"add_caption","repo":"hvision-nku/storydiffusion","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/hvision-nku/storydiffusion/blob/HEAD/utils/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":"293847aedbd19e46"}},{"code_sha256_prefix":"fbe121fea006a44e","entry":"add_white_border","repo":"hvision-nku/storydiffusion","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/hvision-nku/storydiffusion/blob/HEAD/utils/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":"fbe121fea006a44e"}},{"code_sha256_prefix":"b109efdd314c37ba","entry":"cal_attn_indice_xl_effcient_memory","repo":"hvision-nku/storydiffusion","repo_kind":"official","path":"utils/gradio_utils.py","file_url":"https://github.com/hvision-nku/storydiffusion/blob/HEAD/utils/gradio_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":"b109efdd314c37ba"}},{"code_sha256_prefix":"2bf55a5e0aed32ff","entry":"cal_attn_mask","repo":"hvision-nku/storydiffusion","repo_kind":"official","path":"utils/gradio_utils.py","file_url":"https://github.com/hvision-nku/storydiffusion/blob/HEAD/utils/gradio_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":"2bf55a5e0aed32ff"}},{"code_sha256_prefix":"1c16defbfcfd003b","entry":"cal_attn_mask_xl","repo":"hvision-nku/storydiffusion","repo_kind":"official","path":"utils/gradio_utils.py","file_url":"https://github.com/hvision-nku/storydiffusion/blob/HEAD/utils/gradio_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":"1c16defbfcfd003b"}},{"code_sha256_prefix":"4397f62f7d8c4e57","entry":"get_image_path_list","repo":"hvision-nku/storydiffusion","repo_kind":"official","path":"gradio_app_sdxl_specific_id_low_vram.py","file_url":"https://github.com/hvision-nku/storydiffusion/blob/HEAD/gradio_app_sdxl_specific_id_low_vram.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":"4397f62f7d8c4e57"}},{"code_sha256_prefix":"ac2390fc5e5bbe10","entry":"process_mulline_text","repo":"hvision-nku/storydiffusion","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/hvision-nku/storydiffusion/blob/HEAD/utils/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":"ac2390fc5e5bbe10"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}