[{"data":1,"prerenderedAt":464},["ShallowReactive",2],{"content-query-F3nPNOG7Dp":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"category":13,"body":14,"_type":458,"_id":459,"_source":460,"_file":461,"_stem":462,"_extension":463},"/technology-blogs/zh/3632","zh",false,"","视频生成SOTA模型推理开箱即用！MindSpore支持Wan2.1","本文将详细介绍如何基于昇思MindSpore和单机Atlas 800T A2，完整实现Wan2.1视频生成的部署流程。","2025-03-03","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/c2d25a5cd7b346a796ed93c2ceb33005.png","technology-blogs","实践",{"type":15,"children":16,"toc":455},"root",[17,25,31,36,44,51,56,63,79,89,96,106,114,129,137,151,159,173,181,188,202,210,217,222,227,234,241,248,253,262,267,276,283,291,298,305,310,318,325,330,335,343,348,353,361,366,373,378,382,390,394,402,409,414,421,426,431,438,443],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"视频生成sota模型推理开箱即用mindspore支持wan21",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29],{"type":24,"value":30},"在AI视频生成领域，Wan2.1作为最新的视觉生成模型，能够根据文本、图像或其他控制信号生成视频，以其卓越表现备受关注。在VBench评测中，Wan2.1以86.22%的总分，摘得桂冠。",{"type":18,"tag":26,"props":32,"children":33},{},[34],{"type":24,"value":35},"MindSpore快速对Wan2.1进行适配，并将其开源至MindSpore ONE仓库，结合昇腾硬件，为开发者提供高效体验。本文将详细介绍如何基于昇思MindSpore和单机Atlas 800T A2，完整实现Wan2.1视频生成的部署流程。",{"type":18,"tag":26,"props":37,"children":38},{},[39],{"type":18,"tag":40,"props":41,"children":43},"img",{"alt":7,"src":42},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/bd0cf3aa6a4f49a58e6a45c370b368d3.png",[],{"type":18,"tag":26,"props":45,"children":46},{},[47],{"type":18,"tag":40,"props":48,"children":50},{"alt":7,"src":49},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/906888c56a2449168b3b2c01f3c6c0ea.png",[],{"type":18,"tag":26,"props":52,"children":53},{},[54],{"type":24,"value":55},"先别急着看代码，来看看 Wan2.1 的“作品”：",{"type":18,"tag":26,"props":57,"children":58},{},[59],{"type":18,"tag":40,"props":60,"children":62},{"alt":7,"src":61},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/fb148504b8f34fd6a1ed26ce841970aa.png",[],{"type":18,"tag":26,"props":64,"children":65},{},[66,68,77],{"type":24,"value":67},"（",{"type":18,"tag":69,"props":70,"children":74},"a",{"href":71,"rel":72},"https://mp.weixin.qq.com/s/_Zqw3qXIRZFheZUp1I_b-Q",[73],"nofollow",[75],{"type":24,"value":76},"点击链接进行观看",{"type":24,"value":78},"）",{"type":18,"tag":80,"props":81,"children":83},"pre",{"code":82},"prompt: A sepia-toned vintage photograph depicting a whimsical bicycle race featuring several dogs wearing goggles and tiny cycling outfits. The canine racers, with determined expressions and blurred motion, pedal miniature bicycles on a dusty road. Spectators in period clothing line the sides, adding to the nostalgic atmosphere. Slightly grainy and blurred, mimicking old photos, with soft side lighting enhancing the warm tones and rustic charm of the scene. 'Bicycle Race' captures this unique moment in a medium shot, focusing on both the racers and the lively crowd.\n",[84],{"type":18,"tag":85,"props":86,"children":87},"code",{"__ignoreMap":7},[88],{"type":24,"value":82},{"type":18,"tag":26,"props":90,"children":91},{},[92],{"type":18,"tag":40,"props":93,"children":95},{"alt":7,"src":94},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/eb453bb0962c418b9bef719ba59731d5.png",[],{"type":18,"tag":26,"props":97,"children":98},{},[99,100,105],{"type":24,"value":67},{"type":18,"tag":69,"props":101,"children":103},{"href":71,"rel":102},[73],[104],{"type":24,"value":76},{"type":24,"value":78},{"type":18,"tag":80,"props":107,"children":109},{"code":108},"prompt: Film quality, professional quality, rich details. The video begins to show the surface of a pond, and the camera slowly zooms in to a close-up. The water surface begins to bubble, and then a blonde woman is seen coming out of the lotus pond soaked all over, showing the subtle changes in her facial expression, creating a dreamy atmosphere.\n",[110],{"type":18,"tag":85,"props":111,"children":112},{"__ignoreMap":7},[113],{"type":24,"value":108},{"type":18,"tag":26,"props":115,"children":116},{},[117,121,123,128],{"type":18,"tag":40,"props":118,"children":120},{"alt":7,"src":119},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/5dd2f0ed7bd549ec8271459632eebcea.png",[],{"type":24,"value":122}," （",{"type":18,"tag":69,"props":124,"children":126},{"href":71,"rel":125},[73],[127],{"type":24,"value":76},{"type":24,"value":78},{"type":18,"tag":80,"props":130,"children":132},{"code":131},"prompt: Two anthropomorphic cats wearing boxing suits and bright gloves fiercely battled on the boxing ring under the spotlight. Their muscles are tight, displaying the strength and agility of professional boxers. A spotted dog judge stood aside. The animals in the audience around cheered and cheered, adding a lively atmosphere to the competition. The cat's boxing movements are quick and powerful, with its paws tracing blurry trajectories in the air. The screen adopts a dynamic blur effect, close ups, and focuses on the intense confrontation on the boxing ring.\n",[133],{"type":18,"tag":85,"props":134,"children":135},{"__ignoreMap":7},[136],{"type":24,"value":131},{"type":18,"tag":26,"props":138,"children":139},{},[140,144,145,150],{"type":18,"tag":40,"props":141,"children":143},{"alt":7,"src":142},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/2f682d058de8419589ca60f9ae0fc481.png",[],{"type":24,"value":122},{"type":18,"tag":69,"props":146,"children":148},{"href":71,"rel":147},[73],[149],{"type":24,"value":76},{"type":24,"value":78},{"type":18,"tag":80,"props":152,"children":154},{"code":153},"prompt: Sports photography full of dynamism, several motorcycles fiercely compete on the loess flying track, their wheels rolling up the dust in the sky. The motorcyclist is wearing professional racing clothes. The camera uses a high-speed shutter to capture moments, follows from the side and rear, and finally freezes in a close-up of a motorcycle, showcasing its exquisite body lines and powerful mechanical beauty, creating a tense and exciting racing atmosphere. Close up dynamic perspective, perfectly presenting the visual impact of speed and power.\n",[155],{"type":18,"tag":85,"props":156,"children":157},{"__ignoreMap":7},[158],{"type":24,"value":153},{"type":18,"tag":26,"props":160,"children":161},{},[162,166,167,172],{"type":18,"tag":40,"props":163,"children":165},{"alt":7,"src":164},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/76ecfce1abed48bdb53690e5270edb5a.png",[],{"type":24,"value":122},{"type":18,"tag":69,"props":168,"children":170},{"href":71,"rel":169},[73],[171],{"type":24,"value":76},{"type":24,"value":78},{"type":18,"tag":80,"props":174,"children":176},{"code":175},"prompt: 电影画质，专业质量，丰富细节。一名宇航员身穿太空服，面朝镜头骑着一匹机械马在火星表面驰骋。红色的荒凉地表延伸至远方，点缀着巨大的陨石坑和奇特的岩石结构。机械马的步伐稳健，扬起微弱的尘埃，展现出未来科技与原始探索的完美结合。宇航员手持操控装置，目光坚定，仿佛正在开辟人类的新疆域。背景是深邃的宇宙和蔚蓝的地球，画面既科幻又充满希望，让人不禁畅想未来的星际生活。\n",[177],{"type":18,"tag":85,"props":178,"children":179},{"__ignoreMap":7},[180],{"type":24,"value":175},{"type":18,"tag":26,"props":182,"children":183},{},[184],{"type":18,"tag":40,"props":185,"children":187},{"alt":7,"src":186},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/de6c578b572f4a0e84482dc65f797c50.png",[],{"type":18,"tag":26,"props":189,"children":190},{},[191,195,196,201],{"type":18,"tag":40,"props":192,"children":194},{"alt":7,"src":193},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/09810082ea2c490ea5d276957c312600.png",[],{"type":24,"value":122},{"type":18,"tag":69,"props":197,"children":199},{"href":71,"rel":198},[73],[200],{"type":24,"value":76},{"type":24,"value":78},{"type":18,"tag":80,"props":203,"children":205},{"code":204},"prompt: Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside.\n",[206],{"type":18,"tag":85,"props":207,"children":208},{"__ignoreMap":7},[209],{"type":24,"value":204},{"type":18,"tag":26,"props":211,"children":212},{},[213],{"type":18,"tag":40,"props":214,"children":216},{"alt":7,"src":215},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/1d15951eaead4b769f2391c40c6a1933.png",[],{"type":18,"tag":26,"props":218,"children":219},{},[220],{"type":24,"value":221},"猫咪那酷萌的表情绝了!",{"type":18,"tag":26,"props":223,"children":224},{},[225],{"type":24,"value":226},"这些都是基于MindSpore和昇腾硬件跑出来的，效果如何？来动手试试，生成你的专属视频吧！",{"type":18,"tag":26,"props":228,"children":229},{},[230],{"type":18,"tag":40,"props":231,"children":233},{"alt":7,"src":232},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/28cec3ac4a5248f5927df9719e394407.png",[],{"type":18,"tag":26,"props":235,"children":236},{},[237],{"type":18,"tag":40,"props":238,"children":240},{"alt":7,"src":239},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/f98e927adaa746b0b49c0ad5c62a8c7f.png",[],{"type":18,"tag":26,"props":242,"children":243},{},[244],{"type":18,"tag":40,"props":245,"children":247},{"alt":7,"src":246},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/80683f12bd6747ec95420b004a85299c.png",[],{"type":18,"tag":26,"props":249,"children":250},{},[251],{"type":24,"value":252},"CANN下载：",{"type":18,"tag":26,"props":254,"children":255},{},[256],{"type":18,"tag":69,"props":257,"children":260},{"href":258,"rel":259},"https://www.hiascend.com/developer/download/community/result",[73],[261],{"type":24,"value":258},{"type":18,"tag":26,"props":263,"children":264},{},[265],{"type":24,"value":266},"MindSpore下载：",{"type":18,"tag":26,"props":268,"children":269},{},[270],{"type":18,"tag":69,"props":271,"children":274},{"href":272,"rel":273},"https://www.mindspore.cn/install",[73],[275],{"type":24,"value":272},{"type":18,"tag":26,"props":277,"children":278},{},[279],{"type":18,"tag":40,"props":280,"children":282},{"alt":7,"src":281},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/63d0516c32c34816b14560c2582e97dc.png",[],{"type":18,"tag":80,"props":284,"children":286},{"code":285},"git clone https://github.com/mindspore-lab/mindone\ncd mindone/examples/wan2_1\n\npip install -r requirements.txt\n",[287],{"type":18,"tag":85,"props":288,"children":289},{"__ignoreMap":7},[290],{"type":24,"value":285},{"type":18,"tag":26,"props":292,"children":293},{},[294],{"type":18,"tag":40,"props":295,"children":297},{"alt":7,"src":296},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/e20475695e1149109ada38ffdd09cd8e.png",[],{"type":18,"tag":26,"props":299,"children":300},{},[301],{"type":18,"tag":40,"props":302,"children":304},{"alt":7,"src":303},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/28c4f2c96eb44bc6a7b65f5d5beb0490.png",[],{"type":18,"tag":26,"props":306,"children":307},{},[308],{"type":24,"value":309},"从 Hugging Face 或 ModelScope 下所需的模型，如：",{"type":18,"tag":80,"props":311,"children":313},{"code":312},"huggingface-cli download Wan-AI/Wan2.1-T2V-14B --local-dir ./Wan2.1-T2V-14B\n",[314],{"type":18,"tag":85,"props":315,"children":316},{"__ignoreMap":7},[317],{"type":24,"value":312},{"type":18,"tag":26,"props":319,"children":320},{},[321],{"type":18,"tag":40,"props":322,"children":324},{"alt":7,"src":323},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/e3f7191917f8465db18fff7e8deca4d3.png",[],{"type":18,"tag":26,"props":326,"children":327},{},[328],{"type":24,"value":329},"支持1.3B和14B模型，分辨率可选480P或720P。",{"type":18,"tag":26,"props":331,"children":332},{},[333],{"type":24,"value":334},"单卡推理：",{"type":18,"tag":80,"props":336,"children":338},{"code":337},"python generate.py  \\\n    --task t2v-1.3B \\\n    --size 832*480 \\\n    --ckpt_dir ./Wan2.1-T2V-1.3B \\\n    --sample_shift 8 \\\n    --sample_guide_scale 6 \\\n    --prompt \"Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage.\"\n",[339],{"type":18,"tag":85,"props":340,"children":341},{"__ignoreMap":7},[342],{"type":24,"value":337},{"type":18,"tag":26,"props":344,"children":345},{},[346],{"type":24,"value":347},"可自定义prompt，生成480P个性化视频，通过调小sample_guide_scale参数增强视频画面质量，或者调大该参数以增强视频-文本匹配程度。",{"type":18,"tag":26,"props":349,"children":350},{},[351],{"type":24,"value":352},"多卡加速：",{"type":18,"tag":80,"props":354,"children":356},{"code":355},"msrun --worker_num=4 --local_worker_num=4 generate.py \\\n    --task t2v-14B \\\n    --size 1280*720 \\\n    --ckpt_dir ./Wan2.1-T2V-14B \\\n    --dit_zero3 --t5_zero3 --ulysses_sp \\\n    --prompt \"Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage.\"\n",[357],{"type":18,"tag":85,"props":358,"children":359},{"__ignoreMap":7},[360],{"type":24,"value":355},{"type":18,"tag":26,"props":362,"children":363},{},[364],{"type":24,"value":365},"可开启序列并行和优化器并行加速720P视频生成",{"type":18,"tag":26,"props":367,"children":368},{},[369],{"type":18,"tag":40,"props":370,"children":372},{"alt":7,"src":371},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/6f51d61d717948939e85638b654db5ca.png",[],{"type":18,"tag":26,"props":374,"children":375},{},[376],{"type":24,"value":377},"支持14B模型，分辨率可选480P或720P。",{"type":18,"tag":26,"props":379,"children":380},{},[381],{"type":24,"value":334},{"type":18,"tag":80,"props":383,"children":385},{"code":384},"python generate.py \\\n    --task i2v-14B \\\n    --size 832*480 \\\n    --ckpt_dir ./Wan2.1-I2V-14B-480P \\\n    --image examples/i2v_input.JPG \\\n    --prompt \"Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside.\"\n",[386],{"type":18,"tag":85,"props":387,"children":388},{"__ignoreMap":7},[389],{"type":24,"value":384},{"type":18,"tag":26,"props":391,"children":392},{},[393],{"type":24,"value":352},{"type":18,"tag":80,"props":395,"children":397},{"code":396},"msrun --worker_num=2 --local_worker_num=2 generate.py \\\n    --task i2v-14B --size 1280*720 \\\n    --ckpt_dir ./Wan2.1-I2V-14B-720P \\\n    --dit_zero3 --t5_zero3 --ulysses_sp \\\n    --image examples/i2v_input.JPG \\\n    --prompt \"Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside.\"\n",[398],{"type":18,"tag":85,"props":399,"children":400},{"__ignoreMap":7},[401],{"type":24,"value":396},{"type":18,"tag":26,"props":403,"children":404},{},[405],{"type":18,"tag":40,"props":406,"children":408},{"alt":7,"src":407},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/a8f3b1398c9d4bcb837687b721b73a3c.png",[],{"type":18,"tag":26,"props":410,"children":411},{},[412],{"type":24,"value":413},"性能测试结果如下：",{"type":18,"tag":26,"props":415,"children":416},{},[417],{"type":18,"tag":40,"props":418,"children":420},{"alt":7,"src":419},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/29167f3bbf174fc08a8a152643f43217.png",[],{"type":18,"tag":26,"props":422,"children":423},{},[424],{"type":24,"value":425},"**1.3B模型 ：**资源占用低，生成速度快，适合轻量应用场景。",{"type":18,"tag":26,"props":427,"children":428},{},[429],{"type":24,"value":430},"**14B模型 ：**支持更高分辨率，生成质量更优；多卡并行可显著提升效率，4卡可提速 3.8倍 。",{"type":18,"tag":26,"props":432,"children":433},{},[434],{"type":18,"tag":40,"props":435,"children":437},{"alt":7,"src":436},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2025/03/07/b1a94a47d1ab4c5499c7415bd0ce2fb1.png",[],{"type":18,"tag":26,"props":439,"children":440},{},[441],{"type":24,"value":442},"想把脑洞变成视频？赶紧去MindSpore ONE下载代码，动手试试吧！有什么问题，欢迎留言，我们会第一时间帮你解答。",{"type":18,"tag":26,"props":444,"children":445},{},[446,448],{"type":24,"value":447},"MindSpore ONE开源代码仓链接：",{"type":18,"tag":69,"props":449,"children":452},{"href":450,"rel":451},"https://github.com/mindspore-lab/mindone/tree/master/examples/wan2%5C_1",[73],[453],{"type":24,"value":454},"https://github.com/mindspore-lab/mindone/tree/master/examples/wan2\\_1",{"title":7,"searchDepth":456,"depth":456,"links":457},4,[],"markdown","content:technology-blogs:zh:3632.md","content","technology-blogs/zh/3632.md","technology-blogs/zh/3632","md",1776506132495]