[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Tencent-Hunyuan--HunyuanVideo":3,"tool-Tencent-Hunyuan--HunyuanVideo":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",160015,2,"2026-04-18T11:30:52",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":76,"owner_website":77,"owner_url":78,"languages":79,"stars":88,"forks":89,"last_commit_at":90,"license":91,"difficulty_score":10,"env_os":92,"env_gpu":93,"env_ram":94,"env_deps":95,"category_tags":103,"github_topics":105,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":109,"updated_at":110,"faqs":111,"releases":141},9156,"Tencent-Hunyuan\u002FHunyuanVideo","HunyuanVideo","HunyuanVideo: A Systematic Framework For Large Video Generation Model","HunyuanVideo 是腾讯开源的一套系统化大型视频生成框架，旨在通过人工智能技术将文本描述或静态图像转化为高质量、高动态的视频内容。它主要解决了当前视频生成领域中长序列连贯性不足、画面细节模糊以及复杂动作难以模拟等痛点，能够生成分辨率高达 720p 且逻辑自然的视频片段。\n\n这款工具非常适合 AI 研究人员、开发者以及数字内容创作者使用。研究人员可以利用其开放的 PyTorch 模型定义和预训练权重探索前沿算法；开发者可通过集成的 Diffusers 接口或并行推理代码（支持 xDiT）快速构建应用；设计师和普通用户则能借助其强大的生成能力，轻松制作创意短片或动态素材。\n\nHunyuanVideo 的技术亮点在于其系统化的架构设计，不仅支持文生视频（T2V）和图生视频（I2V），还衍生出了支持音频驱动的数字人动画（Avatar）及个性化定制生成（Custom）等扩展能力。此外，项目提供了 FP8 量化版本以显著降低显存占用，并发布了专业的\"Penguin Video Benchmark\"评测基准，展现了其在工业级落地与学术研究之间的良好平衡。无论是想要复现论文成果，还是寻求高效的","HunyuanVideo 是腾讯开源的一套系统化大型视频生成框架，旨在通过人工智能技术将文本描述或静态图像转化为高质量、高动态的视频内容。它主要解决了当前视频生成领域中长序列连贯性不足、画面细节模糊以及复杂动作难以模拟等痛点，能够生成分辨率高达 720p 且逻辑自然的视频片段。\n\n这款工具非常适合 AI 研究人员、开发者以及数字内容创作者使用。研究人员可以利用其开放的 PyTorch 模型定义和预训练权重探索前沿算法；开发者可通过集成的 Diffusers 接口或并行推理代码（支持 xDiT）快速构建应用；设计师和普通用户则能借助其强大的生成能力，轻松制作创意短片或动态素材。\n\nHunyuanVideo 的技术亮点在于其系统化的架构设计，不仅支持文生视频（T2V）和图生视频（I2V），还衍生出了支持音频驱动的数字人动画（Avatar）及个性化定制生成（Custom）等扩展能力。此外，项目提供了 FP8 量化版本以显著降低显存占用，并发布了专业的\"Penguin Video Benchmark\"评测基准，展现了其在工业级落地与学术研究之间的良好平衡。无论是想要复现论文成果，还是寻求高效的视频创作方案，HunyuanVideo 都是一个值得尝试的开源选择。","\u003C!-- ## **HunyuanVideo** -->\n\n[中文阅读](.\u002FREADME_zh.md)\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_85b7aacd16dd.png\"  height=100>\n\u003C\u002Fp>\n\n# HunyuanVideo: A Systematic Framework For Large Video Generation Model\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=HunyuanVideo Code&message=Github&color=blue\">\u003C\u002Fa> &ensp;\n  \u003Ca href=\"https:\u002F\u002Faivideo.hunyuan.tencent.com\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Project%20Page&message=Web&color=green\">\u003C\u002Fa> &ensp;\n  \u003Ca href=\"https:\u002F\u002Fvideo.hunyuan.tencent.com\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Playground&message=Web&color=green\">\u003C\u002Fa>\n\u003C\u002Fdiv>\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2412.03603\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Tech Report&message=Arxiv&color=red\">\u003C\u002Fa> &ensp;\n  \u003Ca href=\"https:\u002F\u002Faivideo.hunyuan.tencent.com\u002Fhunyuanvideo.pdf\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=Tech Report&message=High-Quality Version (~350M)&color=red\">\u003C\u002Fa>\n\u003C\u002Fdiv>\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=HunyuanVideo&message=HuggingFace&color=yellow\">\u003C\u002Fa> &ensp;\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fdiffusers\u002Fmain\u002Fapi\u002Fpipelines\u002Fhunyuan_video\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=HunyuanVideo&message=Diffusers&color=yellow\">\u003C\u002Fa> &ensp;\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo-PromptRewrite\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=HunyuanVideo-PromptRewrite&message=HuggingFace&color=yellow\">\u003C\u002Fa>\n\n\n [![Replicate](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_7dacf1cc5d87.png)](https:\u002F\u002Freplicate.com\u002Fzsxkib\u002Fhunyuan-video)\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n    👋 Join our \u003Ca href=\"assets\u002FWECHAT.md\" target=\"_blank\">WeChat\u003C\u002Fa> and \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Ftv7FkG4Nwf\" target=\"_blank\">Discord\u003C\u002Fa> \n\u003C\u002Fp>\n\u003Cp align=\"center\">\n\n-----\n\nThis repo contains PyTorch model definitions, pre-trained weights and inference\u002Fsampling code for our paper exploring HunyuanVideo. You can find more visualizations on our [project page](https:\u002F\u002Faivideo.hunyuan.tencent.com).\n\n> [**HunyuanVideo: A Systematic Framework For Large Video Generation Model**](https:\u002F\u002Farxiv.org\u002Fabs\u002F2412.03603) \u003Cbe>\n\n\n\n## 🔥🔥🔥 News!!\n\n* Nov 21, 2025: 🎉 We release the [HunyuanVideo-1.5](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo-1.5), a highly efficient and powerful new foundation model.\n* May 28, 2025: 💃 We release the [HunyuanVideo-Avatar](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo-Avatar), an audio-driven human animation model  based on HunyuanVideo.\n* May 09, 2025: 🙆 We release the [HunyuanCustom](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanCustom), a multimodal-driven architecture for customized video generation based on HunyuanVideo.\n* Mar 06, 2025: 🌅 We release the [HunyuanVideo-I2V](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo-I2V), an image-to-video model based on HunyuanVideo.\n* Jan 13, 2025: 📈 We release the [Penguin Video Benchmark](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\u002Fblob\u002Fmain\u002Fassets\u002FPenguinVideoBenchmark.csv).\n* Dec 18, 2024: 🏃‍♂️ We release the [FP8 model weights](https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo\u002Fblob\u002Fmain\u002Fhunyuan-video-t2v-720p\u002Ftransformers\u002Fmp_rank_00_model_states_fp8.pt) of HunyuanVideo to save more GPU memory.\n* Dec 17, 2024: 🤗 HunyuanVideo has been integrated into [Diffusers](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fdiffusers\u002Fmain\u002Fapi\u002Fpipelines\u002Fhunyuan_video).\n* Dec 7, 2024: 🚀 We release the parallel inference code for HunyuanVideo powered by [xDiT](https:\u002F\u002Fgithub.com\u002Fxdit-project\u002FxDiT).\n* Dec 3, 2024: 👋 We release the inference code and model weights of HunyuanVideo. [Download](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\u002Fblob\u002Fmain\u002Fckpts\u002FREADME.md).\n\n\n\n## 🎥 Demo\n\n\u003Cdiv align=\"center\">\n  \u003Cvideo src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F22440764-0d7e-438e-a44d-d0dad1006d3d\" width=\"70%\" poster=\".\u002Fassets\u002Fvideo_poster.png\"> \u003C\u002Fvideo>\n\u003C\u002Fdiv>\n\n\n## 🧩 Community Contributions\n\nIf you develop\u002Fuse HunyuanVideo in your projects, welcome to let us know.\n\n- ComfyUI-Kijai (FP8 Inference, V2V and IP2V Generation): [ComfyUI-HunyuanVideoWrapper](https:\u002F\u002Fgithub.com\u002Fkijai\u002FComfyUI-HunyuanVideoWrapper) by [Kijai](https:\u002F\u002Fgithub.com\u002Fkijai)\n- ComfyUI-Native (Native Support): [ComfyUI-HunyuanVideo](https:\u002F\u002Fcomfyanonymous.github.io\u002FComfyUI_examples\u002Fhunyuan_video\u002F) by [ComfyUI Official](https:\u002F\u002Fgithub.com\u002Fcomfyanonymous\u002FComfyUI)\n\n- FastVideo (Consistency Distilled Model and Sliding Tile Attention): [FastVideo](https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FFastVideo) and [Sliding Tile Attention](https:\u002F\u002Fhao-ai-lab.github.io\u002Fblogs\u002Fsta\u002F) by [Hao AI Lab](https:\u002F\u002Fhao-ai-lab.github.io\u002F)\n- HunyuanVideo-gguf (GGUF Version and Quantization): [HunyuanVideo-gguf](https:\u002F\u002Fhuggingface.co\u002Fcity96\u002FHunyuanVideo-gguf) by [city96](https:\u002F\u002Fhuggingface.co\u002Fcity96)\n- Enhance-A-Video (Better Generated Video for Free): [Enhance-A-Video](https:\u002F\u002Fgithub.com\u002FNUS-HPC-AI-Lab\u002FEnhance-A-Video) by [NUS-HPC-AI-Lab](https:\u002F\u002Fai.comp.nus.edu.sg\u002F)\n- TeaCache (Cache-based Accelerate): [TeaCache](https:\u002F\u002Fgithub.com\u002FLiewFeng\u002FTeaCache) by [Feng Liu](https:\u002F\u002Fgithub.com\u002FLiewFeng)\n- HunyuanVideoGP (GPU Poor version): [HunyuanVideoGP](https:\u002F\u002Fgithub.com\u002Fdeepbeepmeep\u002FHunyuanVideoGP) by [DeepBeepMeep](https:\u002F\u002Fgithub.com\u002Fdeepbeepmeep)\n- RIFLEx (Video Length Extrapolation): [RIFLEx](https:\u002F\u002Friflex-video.github.io\u002F) by [Tsinghua University](https:\u002F\u002Friflex-video.github.io\u002F)\n- HunyuanVideo Keyframe Control Lora: [hunyuan-video-keyframe-control-lora](https:\u002F\u002Fgithub.com\u002Fdashtoon\u002Fhunyuan-video-keyframe-control-lora) by [dashtoon](https:\u002F\u002Fgithub.com\u002Fdashtoon)\n- Sparse-VideoGen (Accelerate Video Generation with High Pixel-level Fidelity): [Sparse-VideoGen](https:\u002F\u002Fgithub.com\u002Fsvg-project\u002FSparse-VideoGen) by [University of California, Berkeley](https:\u002F\u002Fsvg-project.github.io\u002F)\n- FramePack (Packing Input Frame Context in Next-Frame Prediction Models for Video Generation): [FramePack](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFramePack) by [Lvmin Zhang](https:\u002F\u002Fgithub.com\u002Flllyasviel) \n- Jenga (Training-Free Efficient Video Generation via Dynamic Token Carving): [Jenga](https:\u002F\u002Fgithub.com\u002Fdvlab-research\u002FJenga) by [DV Lab](https:\u002F\u002Fgithub.com\u002Fdvlab-research)\n- DCM (Dual-Expert Consistency Model for Efficient and High-Quality Video Generation): [DCM](https:\u002F\u002Fgithub.com\u002FVchitect\u002FDCM) by [Vchitect](https:\u002F\u002Fgithub.com\u002FVchitect\u002FDCM)\n\n\n## 📑 Open-source Plan\n\n- HunyuanVideo (Text-to-Video Model)\n  - [x] Inference \n  - [x] Checkpoints\n  - [x] Multi-gpus Sequence Parallel inference (Faster inference speed on more gpus)\n  - [x] Web Demo (Gradio)\n  - [x] Diffusers \n  - [x] FP8 Quantified weight\n  - [x] Penguin Video Benchmark\n  - [x] ComfyUI\n- [HunyuanVideo (Image-to-Video Model)](https:\u002F\u002Fgithub.com\u002FTencent\u002FHunyuanVideo-I2V)\n  - [X] Inference \n  - [X] Checkpoints \n\n\n\n## Contents\n- [HunyuanVideo: A Systematic Framework For Large Video Generation Model](#hunyuanvideo-a-systematic-framework-for-large-video-generation-model)\n  - [🎥 Demo](#-demo)\n  - [🔥🔥🔥 News!!](#-news)\n  - [🧩 Community Contributions](#-community-contributions)\n  - [📑 Open-source Plan](#-open-source-plan)\n  - [Contents](#contents)\n  - [**Abstract**](#abstract)\n  - [**HunyuanVideo Overall Architecture**](#hunyuanvideo-overall-architecture)\n  - [🎉 **HunyuanVideo Key Features**](#-hunyuanvideo-key-features)\n    - [**Unified Image and Video Generative Architecture**](#unified-image-and-video-generative-architecture)\n    - [**MLLM Text Encoder**](#mllm-text-encoder)\n    - [**3D VAE**](#3d-vae)\n    - [**Prompt Rewrite**](#prompt-rewrite)\n  - [📈 Comparisons](#-comparisons)\n  - [📜 Requirements](#-requirements)\n  - [🛠️ Dependencies and Installation](#️-dependencies-and-installation)\n    - [Installation Guide for Linux](#installation-guide-for-linux)\n  - [🧱 Download Pretrained Models](#-download-pretrained-models)\n  - [🔑 Single-gpu Inference](#-single-gpu-inference)\n    - [Using Command Line](#using-command-line)\n    - [Run a Gradio Server](#run-a-gradio-server)\n    - [More Configurations](#more-configurations)\n  - [🚀 Parallel Inference on Multiple GPUs by xDiT](#-parallel-inference-on-multiple-gpus-by-xdit)\n    - [Using Command Line](#using-command-line-1)\n  - [🚀  FP8 Inference](#--fp8-inference)\n    - [Using Command Line](#using-command-line-2)\n  - [🔗 BibTeX](#-bibtex)\n  - [Acknowledgements](#acknowledgements)\n  - [Star History](#star-history)\n---\n\n## **Abstract**\nWe present HunyuanVideo, a novel open-source video foundation model that exhibits performance in video generation that is comparable to, if not superior to, leading closed-source models. In order to train HunyuanVideo model, we adopt several key technologies for model learning, including data curation, image-video joint model training, and an efficient infrastructure designed to facilitate large-scale model training and inference. Additionally, through an effective strategy for scaling model architecture and dataset, we successfully trained a video generative model with over 13 billion parameters, making it the largest among all open-source models. \n\nWe conducted extensive experiments and implemented a series of targeted designs to ensure high visual quality, motion diversity, text-video alignment, and generation stability. According to professional human evaluation results, HunyuanVideo outperforms previous state-of-the-art models, including Runway Gen-3, Luma 1.6, and 3 top-performing Chinese video generative models. By releasing the code and weights of the foundation model and its applications, we aim to bridge the gap between closed-source and open-source video foundation models. This initiative will empower everyone in the community to experiment with their ideas, fostering a more dynamic and vibrant video generation ecosystem. \n\n\n\n## **HunyuanVideo Overall Architecture**\n\nHunyuanVideo is trained on a spatial-temporally\ncompressed latent space, which is compressed through a Causal 3D VAE. Text prompts are encoded\nusing a large language model, and used as the conditions. Taking Gaussian noise and the conditions as\ninput, our generative model produces an output latent, which is then decoded to images or videos through\nthe 3D VAE decoder.\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_26aa5b9589d8.png\"  height=300>\n\u003C\u002Fp>\n\n\n## 🎉 **HunyuanVideo Key Features**\n\n### **Unified Image and Video Generative Architecture**\nHunyuanVideo introduces the Transformer design and employs a Full Attention mechanism for unified image and video generation. \nSpecifically, we use a \"Dual-stream to Single-stream\" hybrid model design for video generation. In the dual-stream phase, video and text\ntokens are processed independently through multiple Transformer blocks, enabling each modality to learn its own appropriate modulation mechanisms without interference. In the single-stream phase, we concatenate the video and text\ntokens and feed them into subsequent Transformer blocks for effective multimodal information fusion.\nThis design captures complex interactions between visual and semantic information, enhancing\noverall model performance.\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_614f62a8d17a.png\"  height=350>\n\u003C\u002Fp>\n\n### **MLLM Text Encoder**\nSome previous text-to-video models typically use pre-trained CLIP and T5-XXL as text encoders where CLIP uses Transformer Encoder and T5 uses an Encoder-Decoder structure. In contrast, we utilize a pre-trained Multimodal Large Language Model (MLLM) with a Decoder-Only structure as our text encoder, which has the following advantages: (i) Compared with T5, MLLM after visual instruction finetuning has better image-text alignment in the feature space, which alleviates the difficulty of the instruction following in diffusion models; (ii)\nCompared with CLIP, MLLM has demonstrated superior ability in image detail description\nand complex reasoning; (iii) MLLM can play as a zero-shot learner by following system instructions prepended to user prompts, helping text features pay more attention to key information. In addition, MLLM is based on causal attention while T5-XXL utilizes bidirectional attention that produces better text guidance for diffusion models. Therefore, we introduce an extra bidirectional token refiner to enhance text features.\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_50fee2b148fb.png\"  height=275>\n\u003C\u002Fp>\n\n### **3D VAE**\nHunyuanVideo trains a 3D VAE with CausalConv3D to compress pixel-space videos and images into a compact latent space. We set the compression ratios of video length, space, and channel to 4, 8, and 16 respectively. This can significantly reduce the number of tokens for the subsequent diffusion transformer model, allowing us to train videos at the original resolution and frame rate.\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_f62a1479c4f9.png\"  height=150>\n\u003C\u002Fp>\n\n### **Prompt Rewrite**\nTo address the variability in linguistic style and length of user-provided prompts, we fine-tune the [Hunyuan-Large model](https:\u002F\u002Fgithub.com\u002FTencent\u002FTencent-Hunyuan-Large) as our prompt rewrite model to adapt the original user prompt to model-preferred prompt.\n\nWe provide two rewrite modes: Normal mode and Master mode, which can be called using different prompts. The prompts are shown [here](hyvideo\u002Fprompt_rewrite.py). The Normal mode is designed to enhance the video generation model's comprehension of user intent, facilitating a more accurate interpretation of the instructions provided. The Master mode enhances the description of aspects such as composition, lighting, and camera movement, which leans towards generating videos with a higher visual quality. However, this emphasis may occasionally result in the loss of some semantic details. \n\nThe Prompt Rewrite Model can be directly deployed and inferred using the [Hunyuan-Large original code](https:\u002F\u002Fgithub.com\u002FTencent\u002FTencent-Hunyuan-Large). We release the weights of the Prompt Rewrite Model [here](https:\u002F\u002Fhuggingface.co\u002FTencent\u002FHunyuanVideo-PromptRewrite).\n\n\n\n## 📈 Comparisons\n\nTo evaluate the performance of HunyuanVideo, we selected five strong baselines from closed-source video generation models. In total, we utilized 1,533 text prompts, generating an equal number of video samples with HunyuanVideo in a single run. For a fair comparison, we conducted inference only once, avoiding any cherry-picking of results. When comparing with the baseline methods, we maintained the default settings for all selected models, ensuring consistent video resolution. Videos were assessed based on three criteria: Text Alignment, Motion Quality, and Visual Quality. More than 60 professional evaluators performed the evaluation. Notably, HunyuanVideo demonstrated the best overall performance, particularly excelling in motion quality. Please note that the evaluation is based on Hunyuan Video's high-quality version. This is different from the currently released fast version.\n\n\u003Cp align=\"center\">\n\u003Ctable> \n\u003Cthead> \n\u003Ctr> \n    \u003Cth rowspan=\"2\">Model\u003C\u002Fth> \u003Cth rowspan=\"2\">Open Source\u003C\u002Fth> \u003Cth>Duration\u003C\u002Fth> \u003Cth>Text Alignment\u003C\u002Fth> \u003Cth>Motion Quality\u003C\u002Fth> \u003Cth rowspan=\"2\">Visual Quality\u003C\u002Fth> \u003Cth rowspan=\"2\">Overall\u003C\u002Fth>  \u003Cth rowspan=\"2\">Ranking\u003C\u002Fth>\n\u003C\u002Ftr> \n\u003C\u002Fthead> \n\u003Ctbody> \n\u003Ctr> \n    \u003Ctd>HunyuanVideo (Ours)\u003C\u002Ftd> \u003Ctd> ✔ \u003C\u002Ftd> \u003Ctd>5s\u003C\u002Ftd> \u003Ctd>61.8%\u003C\u002Ftd> \u003Ctd>66.5%\u003C\u002Ftd> \u003Ctd>95.7%\u003C\u002Ftd> \u003Ctd>41.3%\u003C\u002Ftd> \u003Ctd>1\u003C\u002Ftd>\n\u003C\u002Ftr> \n\u003Ctr> \n    \u003Ctd>CNTopA (API)\u003C\u002Ftd> \u003Ctd> &#10008 \u003C\u002Ftd> \u003Ctd>5s\u003C\u002Ftd> \u003Ctd>62.6%\u003C\u002Ftd> \u003Ctd>61.7%\u003C\u002Ftd> \u003Ctd>95.6%\u003C\u002Ftd> \u003Ctd>37.7%\u003C\u002Ftd> \u003Ctd>2\u003C\u002Ftd>\n\u003C\u002Ftr> \n\u003Ctr> \n    \u003Ctd>CNTopB (Web)\u003C\u002Ftd> \u003Ctd> &#10008\u003C\u002Ftd> \u003Ctd>5s\u003C\u002Ftd> \u003Ctd>60.1%\u003C\u002Ftd> \u003Ctd>62.9%\u003C\u002Ftd> \u003Ctd>97.7%\u003C\u002Ftd> \u003Ctd>37.5%\u003C\u002Ftd> \u003Ctd>3\u003C\u002Ftd>\n\u003C\u002Ftr> \n\u003Ctr> \n    \u003Ctd>GEN-3 alpha (Web)\u003C\u002Ftd> \u003Ctd>&#10008\u003C\u002Ftd> \u003Ctd>6s\u003C\u002Ftd> \u003Ctd>47.7%\u003C\u002Ftd> \u003Ctd>54.7%\u003C\u002Ftd> \u003Ctd>97.5%\u003C\u002Ftd> \u003Ctd>27.4%\u003C\u002Ftd> \u003Ctd>4\u003C\u002Ftd> \n\u003C\u002Ftr> \n\u003Ctr> \n    \u003Ctd>Luma1.6 (API)\u003C\u002Ftd>\u003Ctd>&#10008\u003C\u002Ftd> \u003Ctd>5s\u003C\u002Ftd> \u003Ctd>57.6%\u003C\u002Ftd> \u003Ctd>44.2%\u003C\u002Ftd> \u003Ctd>94.1%\u003C\u002Ftd> \u003Ctd>24.8%\u003C\u002Ftd> \u003Ctd>5\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr> \n    \u003Ctd>CNTopC (Web)\u003C\u002Ftd> \u003Ctd>&#10008\u003C\u002Ftd> \u003Ctd>5s\u003C\u002Ftd> \u003Ctd>48.4%\u003C\u002Ftd> \u003Ctd>47.2%\u003C\u002Ftd> \u003Ctd>96.3%\u003C\u002Ftd> \u003Ctd>24.6%\u003C\u002Ftd> \u003Ctd>6\u003C\u002Ftd>\n\u003C\u002Ftr> \n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fp>\n\n\n## 📜 Requirements\n\nThe following table shows the requirements for running HunyuanVideo model (batch size = 1) to generate videos:\n\n|     Model    |  Setting\u003Cbr\u002F>(height\u002Fwidth\u002Fframe) | GPU Peak Memory  |\n|:------------:|:--------------------------------:|:----------------:|\n| HunyuanVideo   |        720px1280px129f          |       60GB        |\n| HunyuanVideo   |        544px960px129f           |       45GB        |\n\n* An NVIDIA GPU with CUDA support is required. \n  * The model is tested on a single 80G GPU.\n  * **Minimum**: The minimum GPU memory required is 60GB for 720px1280px129f and 45G for 544px960px129f.\n  * **Recommended**: We recommend using a GPU with 80GB of memory for better generation quality.\n* Tested operating system: Linux\n\n\n\n## 🛠️ Dependencies and Installation\n\nBegin by cloning the repository:\n```shell\ngit clone https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\ncd HunyuanVideo\n```\n\n### Installation Guide for Linux\n\nWe recommend CUDA versions 12.4 or 11.8 for the manual installation.\n\nConda's installation instructions are available [here](https:\u002F\u002Fdocs.anaconda.com\u002Ffree\u002Fminiconda\u002Findex.html).\n\n```shell\n# 1. Create conda environment\nconda create -n HunyuanVideo python==3.10.9\n\n# 2. Activate the environment\nconda activate HunyuanVideo\n\n# 3. Install PyTorch and other dependencies using conda\n# For CUDA 11.8\nconda install pytorch==2.6.0 torchvision==0.19.0 torchaudio==2.4.0 pytorch-cuda=11.8 -c pytorch -c nvidia\n# For CUDA 12.4\nconda install pytorch==2.6.0 torchvision==0.19.0 torchaudio==2.4.0 pytorch-cuda=12.4 -c pytorch -c nvidia\n\n# 4. Install pip dependencies\npython -m pip install -r requirements.txt\n\n# 5. Install flash attention v2 for acceleration (requires CUDA 11.8 or above)\npython -m pip install ninja\npython -m pip install git+https:\u002F\u002Fgithub.com\u002FDao-AILab\u002Fflash-attention.git@v2.6.3\n\n# 6. Install xDiT for parallel inference (It is recommended to use torch 2.6.0 and flash-attn 2.6.3)\npython -m pip install xfuser==0.4.0\n```\n\nIn case of running into float point exception(core dump) on the specific GPU type, you may try the following solutions:\n\n```shell\n# Option 1: Making sure you have installed CUDA 12.4, CUBLAS>=12.4.5.8, and CUDNN>=9.00 (or simply using our CUDA 12 docker image).\npip install nvidia-cublas-cu12==12.4.5.8\nexport LD_LIBRARY_PATH=\u002Fopt\u002Fconda\u002Flib\u002Fpython3.8\u002Fsite-packages\u002Fnvidia\u002Fcublas\u002Flib\u002F\n\n# Option 2: Forcing to explictly use the CUDA 11.8 compiled version of Pytorch and all the other packages\npip uninstall -r requirements.txt  # uninstall all packages\npip uninstall -y xfuser\npip install torch==2.6.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\npip install -r requirements.txt\npip install ninja\npip install git+https:\u002F\u002Fgithub.com\u002FDao-AILab\u002Fflash-attention.git@v2.6.3\npip install xfuser==0.4.0\n```\n\nAdditionally, HunyuanVideo also provides a pre-built Docker image. Use the following command to pull and run the docker image.\n\n```shell\n# For CUDA 12.4 (updated to avoid float point exception)\ndocker pull hunyuanvideo\u002Fhunyuanvideo:cuda_12\ndocker run -itd --gpus all --init --net=host --uts=host --ipc=host --name hunyuanvideo --security-opt=seccomp=unconfined --ulimit=stack=67108864 --ulimit=memlock=-1 --privileged hunyuanvideo\u002Fhunyuanvideo:cuda_12\n\n# For CUDA 11.8\ndocker pull hunyuanvideo\u002Fhunyuanvideo:cuda_11\ndocker run -itd --gpus all --init --net=host --uts=host --ipc=host --name hunyuanvideo --security-opt=seccomp=unconfined --ulimit=stack=67108864 --ulimit=memlock=-1 --privileged hunyuanvideo\u002Fhunyuanvideo:cuda_11\n```\n\n\n## 🧱 Download Pretrained Models\n\nThe details of download pretrained models are shown [here](ckpts\u002FREADME.md).\n\n\n\n## 🔑 Single-gpu Inference\n\nWe list the height\u002Fwidth\u002Fframe settings we support in the following table.\n\n|      Resolution       |           h\u002Fw=9:16           |    h\u002Fw=16:9     |     h\u002Fw=4:3     |     h\u002Fw=3:4     |     h\u002Fw=1:1     |\n|:---------------------:|:----------------------------:|:---------------:|:---------------:|:---------------:|:---------------:|\n|         540p          |        544px960px129f        |  960px544px129f | 624px832px129f  |  832px624px129f |  720px720px129f |\n| 720p (recommended)    |       720px1280px129f        | 1280px720px129f | 1104px832px129f | 832px1104px129f | 960px960px129f  |\n\n### Using Command Line\n\n```bash\ncd HunyuanVideo\n\npython3 sample_video.py \\\n    --video-size 720 1280 \\\n    --video-length 129 \\\n    --infer-steps 50 \\\n    --prompt \"A cat walks on the grass, realistic style.\" \\\n    --flow-reverse \\\n    --use-cpu-offload \\\n    --save-path .\u002Fresults\n```\n\n### Run a Gradio Server\n```bash\npython3 gradio_server.py --flow-reverse\n\n# set SERVER_NAME and SERVER_PORT manually\n# SERVER_NAME=0.0.0.0 SERVER_PORT=8081 python3 gradio_server.py --flow-reverse\n```\n\n### More Configurations\n\nWe list some more useful configurations for easy usage:\n\n|        Argument        |  Default  |                Description                |\n|:----------------------:|:---------:|:-----------------------------------------:|\n|       `--prompt`       |   None    |   The text prompt for video generation    |\n|     `--video-size`     | 720 1280  |      The size of the generated video      |\n|    `--video-length`    |    129    |     The length of the generated video     |\n|    `--infer-steps`     |    50     |     The number of steps for sampling      |\n| `--embedded-cfg-scale` |    6.0    |    Embedded  Classifier free guidance scale       |\n|     `--flow-shift`     |    7.0    | Shift factor for flow matching schedulers |\n|     `--flow-reverse`   |    False  | If reverse, learning\u002Fsampling from t=1 -> t=0 |\n|        `--seed`        |     None  |   The random seed for generating video, if None, we init a random seed    |\n|  `--use-cpu-offload`   |   False   |    Use CPU offload for the model load to save more memory, necessary for high-res video generation    |\n|     `--save-path`      | .\u002Fresults |     Path to save the generated video      |\n\n\n\n## 🚀 Parallel Inference on Multiple GPUs by xDiT\n\n[xDiT](https:\u002F\u002Fgithub.com\u002Fxdit-project\u002FxDiT) is a Scalable Inference Engine for Diffusion Transformers (DiTs) on multi-GPU Clusters.\nIt has successfully provided low-latency parallel inference solutions for a variety of DiTs models, including mochi-1, CogVideoX, Flux.1, SD3, etc. This repo adopted the [Unified Sequence Parallelism (USP)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.07719) APIs for parallel inference of the HunyuanVideo model.\n\n### Using Command Line\n\nFor example, to generate a video with 8 GPUs, you can use the following command:\n\n```bash\ncd HunyuanVideo\n\ntorchrun --nproc_per_node=8 sample_video.py \\\n    --video-size 1280 720 \\\n    --video-length 129 \\\n    --infer-steps 50 \\\n    --prompt \"A cat walks on the grass, realistic style.\" \\\n    --flow-reverse \\\n    --seed 42 \\\n    --ulysses-degree 8 \\\n    --ring-degree 1 \\\n    --save-path .\u002Fresults\n```\n\nYou can change the `--ulysses-degree` and `--ring-degree` to control the parallel configurations for the best performance. The valid parallel configurations are shown in the following table.\n\n\u003Cdetails>\n\u003Csummary>Supported Parallel Configurations (Click to expand)\u003C\u002Fsummary>\n\n|     --video-size     | --video-length | --ulysses-degree x --ring-degree | --nproc_per_node |\n|----------------------|----------------|----------------------------------|------------------|\n| 1280 720 or 720 1280 | 129            | 8x1,4x2,2x4,1x8                  | 8                |\n| 1280 720 or 720 1280 | 129            | 1x5                              | 5                |\n| 1280 720 or 720 1280 | 129            | 4x1,2x2,1x4                      | 4                |\n| 1280 720 or 720 1280 | 129            | 3x1,1x3                          | 3                |\n| 1280 720 or 720 1280 | 129            | 2x1,1x2                          | 2                |\n| 1104 832 or 832 1104 | 129            | 4x1,2x2,1x4                      | 4                |\n| 1104 832 or 832 1104 | 129            | 3x1,1x3                          | 3                |\n| 1104 832 or 832 1104 | 129            | 2x1,1x2                          | 2                |\n| 960 960              | 129            | 6x1,3x2,2x3,1x6                  | 6                |\n| 960 960              | 129            | 4x1,2x2,1x4                      | 4                |\n| 960 960              | 129            | 3x1,1x3                          | 3                |\n| 960 960              | 129            | 1x2,2x1                          | 2                |\n| 960 544 or 544 960   | 129            | 6x1,3x2,2x3,1x6                  | 6                |\n| 960 544 or 544 960   | 129            | 4x1,2x2,1x4                      | 4                |\n| 960 544 or 544 960   | 129            | 3x1,1x3                          | 3                |\n| 960 544 or 544 960   | 129            | 1x2,2x1                          | 2                |\n| 832 624 or 624 832   | 129            | 4x1,2x2,1x4                      | 4                |\n| 624 832 or 624 832   | 129            | 3x1,1x3                          | 3                |\n| 832 624 or 624 832   | 129            | 2x1,1x2                          | 2                |\n| 720 720              | 129            | 1x5                              | 5                |\n| 720 720              | 129            | 3x1,1x3                          | 3                |\n\n\u003C\u002Fdetails>\n\n\n\u003Cp align=\"center\">\n\u003Ctable align=\"center\">\n\u003Cthead>\n\u003Ctr>\n    \u003Cth colspan=\"4\">Latency (Sec) for 1280x720 (129 frames 50 steps) on 8xGPU\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Cth>1\u003C\u002Fth>\n    \u003Cth>2\u003C\u002Fth>\n    \u003Cth>4\u003C\u002Fth>\n    \u003Cth>8\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n    \u003Cth>1904.08\u003C\u002Fth>\n    \u003Cth>934.09 (2.04x)\u003C\u002Fth>\n    \u003Cth>514.08 (3.70x)\u003C\u002Fth>\n    \u003Cth>337.58 (5.64x)\u003C\u002Fth>\n\u003C\u002Ftr>\n\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fp>\n\n\n\n## 🚀  FP8 Inference\n\nUsing HunyuanVideo with FP8 quantized weights, which saves about 10GB of GPU memory. You can download the [weights](https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo\u002Fblob\u002Fmain\u002Fhunyuan-video-t2v-720p\u002Ftransformers\u002Fmp_rank_00_model_states_fp8.pt) and [weight scales](https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo\u002Fblob\u002Fmain\u002Fhunyuan-video-t2v-720p\u002Ftransformers\u002Fmp_rank_00_model_states_fp8_map.pt) from Huggingface.\n\n### Using Command Line\n\nHere, you must explicitly specify the FP8 weight path. For example, to generate a video with fp8 weights, you can use the following command:\n\n```bash\ncd HunyuanVideo\n\nDIT_CKPT_PATH={PATH_TO_FP8_WEIGHTS}\u002F{WEIGHT_NAME}_fp8.pt\n\npython3 sample_video.py \\\n    --dit-weight ${DIT_CKPT_PATH} \\\n    --video-size 1280 720 \\\n    --video-length 129 \\\n    --infer-steps 50 \\\n    --prompt \"A cat walks on the grass, realistic style.\" \\\n    --seed 42 \\\n    --embedded-cfg-scale 6.0 \\\n    --flow-shift 7.0 \\\n    --flow-reverse \\\n    --use-cpu-offload \\\n    --use-fp8 \\\n    --save-path .\u002Fresults\n```\n\n\n\n## 🔗 BibTeX\n\nIf you find [HunyuanVideo](https:\u002F\u002Farxiv.org\u002Fabs\u002F2412.03603) useful for your research and applications, please cite using this BibTeX:\n\n```BibTeX\n@article{kong2024hunyuanvideo,\n  title={Hunyuanvideo: A systematic framework for large video generative models},\n  author={Kong, Weijie and Tian, Qi and Zhang, Zijian and Min, Rox and Dai, Zuozhuo and Zhou, Jin and Xiong, Jiangfeng and Li, Xin and Wu, Bo and Zhang, Jianwei and others},\n  journal={arXiv preprint arXiv:2412.03603},\n  year={2024}\n}\n```\n\n\n\n## Acknowledgements\n\nWe would like to thank the contributors to the [SD3](https:\u002F\u002Fhuggingface.co\u002Fstabilityai\u002Fstable-diffusion-3-medium), [FLUX](https:\u002F\u002Fgithub.com\u002Fblack-forest-labs\u002Fflux), [Llama](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama), [LLaVA](https:\u002F\u002Fgithub.com\u002Fhaotian-liu\u002FLLaVA), [Xtuner](https:\u002F\u002Fgithub.com\u002FInternLM\u002Fxtuner), [diffusers](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fdiffusers) and [HuggingFace](https:\u002F\u002Fhuggingface.co) repositories, for their open research and exploration.\nAdditionally, we also thank the Tencent Hunyuan Multimodal team for their help with the text encoder. \n\n\n## Github Star History\n\u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#Tencent-Hunyuan\u002FHunyuanVideo&Date\">\n \u003Cpicture>\n   \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_648fd42f3dcb.png&theme=dark\" \u002F>\n   \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_648fd42f3dcb.png\" \u002F>\n   \u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_648fd42f3dcb.png\" \u002F>\n \u003C\u002Fpicture>\n\u003C\u002Fa>\n","\u003C!-- ## **HunyuanVideo** -->\n\n[中文阅读](.\u002FREADME_zh.md)\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_85b7aacd16dd.png\"  height=100>\n\u003C\u002Fp>\n\n# HunyuanVideo：大型视频生成模型的系统性框架\n\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=HunyuanVideo代码&message=Github&color=blue\">\u003C\u002Fa> &ensp;\n  \u003Ca href=\"https:\u002F\u002Faivideo.hunyuan.tencent.com\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=项目页面&message=Web&color=green\">\u003C\u002Fa> &ensp;\n  \u003Ca href=\"https:\u002F\u002Fvideo.hunyuan.tencent.com\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=体验平台&message=Web&color=green\">\u003C\u002Fa>\n\u003C\u002Fdiv>\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2412.03603\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=技术报告&message=Arxiv&color=red\">\u003C\u002Fa> &ensp;\n  \u003Ca href=\"https:\u002F\u002Faivideo.hunyuan.tencent.com\u002Fhunyuanvideo.pdf\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=技术报告&message=高质量版本（约350MB）&color=red\">\u003C\u002Fa>\n\u003C\u002Fdiv>\n\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=HunyuanVideo&message=HuggingFace&color=yellow\">\u003C\u002Fa> &ensp;\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fdiffusers\u002Fmain\u002Fapi\u002Fpipelines\u002Fhunyuan_video\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=HunyuanVideo&message=Diffusers&color=yellow\">\u003C\u002Fa> &ensp;\n  \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo-PromptRewrite\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=HunyuanVideo-PromptRewrite&message=HuggingFace&color=yellow\">\u003C\u002Fa>\n\n\n [![Replicate](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_7dacf1cc5d87.png)](https:\u002F\u002Freplicate.com\u002Fzsxkib\u002Fhunyuan-video)\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n    👋 欢迎加入我们的\u003Ca href=\"assets\u002FWECHAT.md\" target=\"_blank\">微信\u003C\u002Fa>和\u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Ftv7FkG4Nwf\" target=\"_blank\">Discord\u003C\u002Fa> \n\u003C\u002Fp>\n\u003Cp align=\"center\">\n\n-----\n\n本仓库包含我们探索HunyuanVideo论文中的PyTorch模型定义、预训练权重以及推理\u002F采样代码。更多可视化内容请访问我们的[项目页面](https:\u002F\u002Faivideo.hunyuan.tencent.com)。\n\n> [**HunyuanVideo：大型视频生成模型的系统性框架**](https:\u002F\u002Farxiv.org\u002Fabs\u002F2412.03603) \u003Cbe>\n\n\n\n## 🔥🔥🔥 最新消息！！\n\n* 2025年11月21日：🎉 我们发布了[HunyuanVideo-1.5](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo-1.5)，这是一款高效且强大的新型基础模型。\n* 2025年5月28日：💃 我们发布了基于HunyuanVideo的音频驱动型人物动画模型[HunyuanVideo-Avatar](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo-Avatar)。\n* 2025年5月9日：🙆 我们发布了基于HunyuanVideo的多模态驱动型定制化视频生成架构[HunyuanCustom](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanCustom)。\n* 2025年3月6日：🌅 我们发布了基于HunyuanVideo的图像转视频模型[HunyuanVideo-I2V](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo-I2V)。\n* 2025年1月13日：📈 我们发布了[Penguin Video Benchmark](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\u002Fblob\u002Fmain\u002Fassets\u002FPenguinVideoBenchmark.csv)。\n* 2024年12月18日：🏃‍♂️ 我们发布了HunyuanVideo的FP8模型权重[https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo\u002Fblob\u002Fmain\u002Fhunyuan-video-t2v-720p\u002Ftransformers\u002Fmp_rank_00_model_states_fp8.pt]，以节省更多显存。\n* 2024年12月17日：🤗 HunyuanVideo已集成到[Diffusers](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Fdiffusers\u002Fmain\u002Fapi\u002Fpipelines\u002Fhunyuan_video)中。\n* 2024年12月7日：🚀 我们发布了由[xDiT](https:\u002F\u002Fgithub.com\u002Fxdit-project\u002FxDiT)支持的HunyuanVideo并行推理代码。\n* 2024年12月3日：👋 我们发布了HunyuanVideo的推理代码和模型权重。[下载](https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\u002Fblob\u002Fmain\u002Fckpts\u002FREADME.md)。\n\n\n\n## 🎥 示例\n\n\u003Cdiv align=\"center\">\n  \u003Cvideo src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F22440764-0d7e-438e-a44d-d0dad1006d3d\" width=\"70%\" poster=\".\u002Fassets\u002Fvideo_poster.png\"> \u003C\u002Fvideo>\n\u003C\u002Fdiv>\n\n\n## 🧩 社区贡献\n\n如果您在项目中开发或使用了HunyuanVideo，欢迎告知我们。\n\n- ComfyUI-Kijai（FP8推理、V2V和IP2V生成）：由[Kijai](https:\u002F\u002Fgithub.com\u002Fkijai)开发的[ComfyUI-HunyuanVideoWrapper](https:\u002F\u002Fgithub.com\u002Fkijai\u002FComfyUI-HunyuanVideoWrapper)\n- ComfyUI-Native（原生支持）：由[ComfyUI官方](https:\u002F\u002Fgithub.com\u002Fcomfyanonymous\u002FComfyUI)开发的[ComfyUI-HunyuanVideo](https:\u002F\u002Fcomfyanonymous.github.io\u002FComfyUI_examples\u002Fhunyuan_video\u002F)\n- FastVideo（一致性蒸馏模型和滑动块注意力）：由[Hao AI Lab](https:\u002F\u002Fhao-ai-lab.github.io\u002F)开发的[FastVideo](https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FFastVideo)和[滑动块注意力](https:\u002F\u002Fhao-ai-lab.github.io\u002Fblogs\u002Fsta\u002F)。\n- HunyuanVideo-gguf（GGUF版本和量化）：由[city96](https:\u002F\u002Fhuggingface.co\u002Fcity96)开发的[HunyuanVideo-gguf](https:\u002F\u002Fhuggingface.co\u002Fcity96\u002FHunyuanVideo-gguf)。\n- Enhance-A-Video（免费提升生成视频质量）：由[NUS-HPC-AI-Lab](https:\u002F\u002Fai.comp.nus.edu.sg\u002F)开发的[Enhance-A-Video](https:\u002F\u002Fgithub.com\u002FNUS-HPC-AI-Lab\u002FEnhance-A-Video)。\n- TeaCache（基于缓存的加速）：由[Feng Liu](https:\u002F\u002Fgithub.com\u002FLiewFeng)开发的[TeaCache](https:\u002F\u002Fgithub.com\u002FLiewFeng\u002FTeaCache)。\n- HunyuanVideoGP（低配GPU版本）：由[DeepBeepMeep](https:\u002F\u002Fgithub.com\u002Fdeepbeepmeep)开发的[HunyuanVideoGP](https:\u002F\u002Fgithub.com\u002Fdeepbeepmeep\u002FHunyuanVideoGP)。\n- RIFLEx（视频长度外推）：由[清华大学](https:\u002F\u002Friflex-video.github.io\u002F)开发的[RIFLEx](https:\u002F\u002Friflex-video.github.io\u002F)。\n- HunyuanVideo关键帧控制LoRA：由[dashtoon](https:\u002F\u002Fgithub.com\u002Fdashtoon)开发的[hunyuan-video-keyframe-control-lora](https:\u002F\u002Fgithub.com\u002Fdashtoon\u002Fhunyuan-video-keyframe-control-lora)。\n- Sparse-VideoGen（以高像素级保真度加速视频生成）：由[加州大学伯克利分校](https:\u002F\u002Fsvg-project.github.io\u002F)开发的[Sparse-VideoGen](https:\u002F\u002Fgithub.com\u002Fsvg-project\u002FSparse-VideoGen)。\n- FramePack（在下一代帧预测模型中打包输入帧上下文以用于视频生成）：由[Lvmin Zhang](https:\u002F\u002Fgithub.com\u002Flllyasviel)开发的[FramePack](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002FFramePack)。\n- Jenga（通过动态标记切割实现无需训练的高效视频生成）：由[DV Lab](https:\u002F\u002Fgithub.com\u002Fdvlab-research)开发的[Jenga](https:\u002F\u002Fgithub.com\u002Fdvlab-research\u002FJenga)。\n- DCM（双专家一致性模型，用于高效且高质量的视频生成）：由[Vchitect](https:\u002F\u002Fgithub.com\u002FVchitect\u002FDCM)开发的[DCM](https:\u002F\u002Fgithub.com\u002FVchitect\u002FDCM)。\n\n\n## 📑 开源计划\n\n- HunyuanVideo（文本到视频模型）\n  - [x] 推理\n  - [x] 检查点\n  - [x] 多GPU序列并行推理（在更多GPU上实现更快的推理速度）\n  - [x] Web演示（Gradio）\n  - [x] Diffusers\n  - [x] FP8量化权重\n  - [x] Penguin Video Benchmark\n  - [x] ComfyUI\n- [HunyuanVideo（图像到视频模型）](https:\u002F\u002Fgithub.com\u002FTencent\u002FHunyuanVideo-I2V)\n  - [X] 推理\n  - [X] 检查点\n\n## 目录\n- [HunyuanVideo：大规模视频生成模型的系统性框架](#hunyuanvideo-a-systematic-framework-for-large-video-generation-model)\n  - [🎥 演示](#-demo)\n  - [🔥🔥🔥 新闻！！](#-news)\n  - [🧩 社区贡献](#-community-contributions)\n  - [📑 开源计划](#-open-source-plan)\n  - [Contents](#contents)\n  - [**摘要**](#abstract)\n  - [**HunyuanVideo 总体架构**](#hunyuanvideo-overall-architecture)\n  - [🎉 **HunyuanVideo 主要特性**](#-hunyuanvideo-key-features)\n    - [**统一的图像与视频生成架构**](#unified-image-and-video-generative-architecture)\n    - [**MLLM 文本编码器**](#mllm-text-encoder)\n    - [**3D VAE**](#3d-vae)\n    - [**提示重写**](#prompt-rewrite)\n  - [📈 对比](#-comparisons)\n  - [📜 系统要求](#-requirements)\n  - [🛠️ 依赖与安装](#️-dependencies-and-installation)\n    - [Linux 安装指南](#installation-guide-for-linux)\n  - [🧱 下载预训练模型](#-download-pretrained-models)\n  - [🔑 单 GPU 推理](#-single-gpu-inference)\n    - [使用命令行](#using-command-line)\n    - [运行 Gradio 服务器](#run-a-gradio-server)\n    - [更多配置](#more-configurations)\n  - [🚀 使用 xDiT 在多 GPU 上并行推理](#-parallel-inference-on-multiple-gpus-by-xdit)\n    - [使用命令行](#using-command-line-1)\n  - [🚀 FP8 推理](#--fp8-inference)\n    - [使用命令行](#using-command-line-2)\n  - [🔗 BibTeX](#-bibtex)\n  - [致谢](#acknowledgements)\n  - [Star 历史](#star-history)\n---\n\n## **摘要**\n我们提出了 HunyuanVideo，这是一种新颖的开源视频基础模型，其在视频生成方面的性能可与领先的闭源模型相媲美，甚至更胜一筹。为了训练 HunyuanVideo 模型，我们采用了多项关键的技术来进行模型学习，包括数据整理、图像与视频联合训练，以及高效的基础架构设计，以促进大规模模型的训练和推理。此外，通过有效的模型架构和数据集扩展策略，我们成功训练出一个参数量超过 130 亿的视频生成模型，使其成为目前所有开源模型中规模最大的。\n\n我们进行了广泛的实验，并实施了一系列有针对性的设计，以确保高视觉质量、运动多样性、文本与视频的对齐能力以及生成的稳定性。根据专业的人工评估结果，HunyuanVideo 的表现优于以往的最先进模型，包括 Runway Gen-3、Luma 1.6 以及三款表现最佳的中文视频生成模型。通过发布该基础模型及其应用的代码和权重，我们旨在缩小闭源与开源视频基础模型之间的差距。这一举措将赋能社区中的每一个人去尝试他们的想法，从而促进更加动态和充满活力的视频生成生态系统。\n\n\n\n## **HunyuanVideo 总体架构**\n\nHunyuanVideo 是在一种时空压缩的潜在空间上进行训练的，该潜在空间通过因果 3D VAE 进行压缩。文本提示使用大型语言模型进行编码，并作为条件输入。以高斯噪声和条件作为输入，我们的生成模型会输出一个潜在表示，随后通过 3D VAE 解码器将其解码为图像或视频。\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_26aa5b9589d8.png\"  height=300>\n\u003C\u002Fp>\n\n\n## 🎉 **HunyuanVideo 主要特性**\n\n### **统一的图像与视频生成架构**\nHunyuanVideo 引入了 Transformer 设计，并采用全注意力机制来实现图像和视频的统一生成。\n具体而言，我们使用“双流转单流”的混合模型设计来进行视频生成。在双流阶段，视频和文本标记分别通过多个 Transformer 块独立处理，使每种模态能够在互不干扰的情况下学习各自合适的调制机制。而在单流阶段，我们将视频和文本标记拼接在一起，输入到后续的 Transformer 块中，以实现高效的多模态信息融合。\n这种设计能够捕捉视觉与语义信息之间的复杂交互，从而提升模型的整体性能。\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_614f62a8d17a.png\"  height=350>\n\u003C\u002Fp>\n\n### **MLLM 文本编码器**\n一些先前的文本到视频模型通常使用预训练的 CLIP 和 T5-XXL 作为文本编码器，其中 CLIP 使用 Transformer 编码器，而 T5 则采用编码器-解码器结构。相比之下，我们则利用一个具有仅解码器结构的预训练多模态大型语言模型（MLLM）作为文本编码器，它具有以下优势：(i) 与 T5 相比，经过视觉指令微调后的 MLLM 在特征空间中具有更好的图像-文本对齐能力，这有助于缓解扩散模型中遵循指令的难度；(ii) 与 CLIP 相比，MLLM 在图像细节描述和复杂推理方面表现出更强的能力；(iii) MLLM 可以通过遵循用户提示前缀的系统指令，充当零样本学习者，帮助文本特征更好地关注关键信息。此外，MLLM 基于因果注意力机制，而 T5-XXL 则采用双向注意力机制，后者能为扩散模型提供更好的文本指导。因此，我们引入了一个额外的双向标记精炼器来增强文本特征。\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_50fee2b148fb.png\"  height=275>\n\u003C\u002Fp>\n\n### **3D VAE**\nHunyuanVideo 训练了一个带有 CausalConv3D 的 3D VAE，用于将像素空间中的视频和图像压缩到紧凑的潜在空间中。我们将视频长度、空间和通道的压缩比分别设置为 4、8 和 16。这可以显著减少后续扩散 Transformer 模型所需的标记数量，从而使我们能够在原始分辨率和帧率下训练视频。\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_f62a1479c4f9.png\"  height=150>\n\u003C\u002Fp>\n\n### **提示重写**\n为应对用户提供的提示在语言风格和长度上的差异，我们基于[Hunyuan-Large模型](https:\u002F\u002Fgithub.com\u002FTencent\u002FTencent-Hunyuan-Large)微调了一个提示重写模型，用于将原始用户提示调整为更适合模型的格式。\n\n我们提供了两种重写模式：普通模式和大师模式，可通过不同的提示词调用。相关提示词请参见[此处](hyvideo\u002Fprompt_rewrite.py)。普通模式旨在增强视频生成模型对用户意图的理解，从而更准确地解析用户指令；而大师模式则会进一步强化对构图、光照和镜头运动等方面的描述，以生成更高视觉质量的视频。不过，这种侧重有时可能会导致部分语义细节的丢失。\n\n提示重写模型可以直接使用[Hunyuan-Large原版代码](https:\u002F\u002Fgithub.com\u002FTencent\u002FTencent-Hunyuan-Large)进行部署和推理。我们已在此处发布了提示重写模型的权重文件：[Hugging Face链接](https:\u002F\u002Fhuggingface.co\u002FTencent\u002FHunyuanVideo-PromptRewrite)。\n\n\n\n## 📈 对比结果\n\n为了评估HunyuanVideo的性能，我们选取了五款闭源视频生成模型作为强基准。总共使用了1,533个文本提示，在一次运行中生成了相同数量的视频样本。为确保公平性，我们仅进行了一次推理，避免了挑选最佳结果的情况。与基准方法对比时，我们保持所有选定模型的默认设置，并统一视频分辨率。评价主要从三个方面展开：文本一致性、动作质量和视觉质量。超过60位专业评估者参与了此次评测。值得注意的是，HunyuanVideo在整体表现上最为出色，尤其在动作质量方面表现突出。需要说明的是，本次评测基于Hunyuan Video的高质量版本，与目前发布的快速版本有所不同。\n\n\u003Cp align=\"center\">\n\u003Ctable> \n\u003Cthead> \n\u003Ctr> \n    \u003Cth rowspan=\"2\">模型\u003C\u002Fth> \u003Cth rowspan=\"2\">开源\u003C\u002Fth> \u003Cth>时长\u003C\u002Fth> \u003Cth>文本一致性\u003C\u002Fth> \u003Cth>动作质量\u003C\u002Fth> \u003Cth rowspan=\"2\">视觉质量\u003C\u002Fth> \u003Cth rowspan=\"2\">综合得分\u003C\u002Fth>  \u003Cth rowspan=\"2\">排名\u003C\u002Fth>\n\u003C\u002Ftr> \n\u003C\u002Fthead> \n\u003Ctbody> \n\u003Ctr> \n    \u003Ctd>HunyuanVideo（我们的模型）\u003C\u002Ftd> \u003Ctd> ✔ \u003C\u002Ftd> \u003Ctd>5s\u003C\u002Ftd> \u003Ctd>61.8%\u003C\u002Ftd> \u003Ctd>66.5%\u003C\u002Ftd> \u003Ctd>95.7%\u003C\u002Ftd> \u003Ctd>41.3%\u003C\u002Ftd> \u003Ctd>1\u003C\u002Ftd>\n\u003C\u002Ftr> \n\u003Ctr> \n    \u003Ctd>CNTopA（API）\u003C\u002Ftd> \u003Ctd> &#10008 \u003C\u002Ftd> \u003Ctd>5s\u003C\u002Ftd> \u003Ctd>62.6%\u003C\u002Ftd> \u003Ctd>61.7%\u003C\u002Ftd> \u003Ctd>95.6%\u003C\u002Ftd> \u003Ctd>37.7%\u003C\u002Ftd> \u003Ctd>2\u003C\u002Ftd>\n\u003C\u002Ftr> \n\u003Ctr> \n    \u003Ctd>CNTopB（Web）\u003C\u002Ftd> \u003Ctd> &#10008\u003C\u002Ftd> \u003Ctd>5s\u003C\u002Ftd> \u003Ctd>60.1%\u003C\u002Ftd> \u003Ctd>62.9%\u003C\u002Ftd> \u003Ctd>97.7%\u003C\u002Ftd> \u003Ctd>37.5%\u003C\u002Ftd> \u003Ctd>3\u003C\u002Ftd>\n\u003C\u002Ftr> \n\u003Ctr> \n    \u003Ctd>GEN-3 alpha（Web）\u003C\u002Ftd> \u003Ctd>&#10008\u003C\u002Ftd> \u003Ctd>6s\u003C\u002Ftd> \u003Ctd>47.7%\u003C\u002Ftd> \u003Ctd>54.7%\u003C\u002Ftd> \u003Ctd>97.5%\u003C\u002Ftd> \u003Ctd>27.4%\u003C\u002Ftd> \u003Ctd>4\u003C\u002Ftd> \n\u003C\u002Ftr> \n\u003Ctr> \n    \u003Ctd>Luma1.6（API）\u003C\u002Ftd>\u003Ctd>&#10008\u003C\u002Ftd> \u003Ctd>5s\u003C\u002Ftd> \u003Ctd>57.6%\u003C\u002Ftd> \u003Ctd>44.2%\u003C\u002Ftd> \u003Ctd>94.1%\u003C\u002Ftd> \u003Ctd>24.8%\u003C\u002Ftd> \u003Ctd>5\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr> \n    \u003Ctd>CNTopC（Web）\u003C\u002Ftd> \u003Ctd>&#10008\u003C\u002Ftd> \u003Ctd>5s\u003C\u002Ftd> \u003Ctd>48.4%\u003C\u002Ftd> \u003Ctd>47.2%\u003C\u002Ftd> \u003Ctd>96.3%\u003C\u002Ftd> \u003Ctd>24.6%\u003C\u002Ftd> \u003Ctd>6\u003C\u002Ftd>\n\u003C\u002Ftr> \n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fp>\n\n\n## 📜 系统要求\n\n下表展示了运行HunyuanVideo模型（批量大小=1）生成视频所需的硬件和软件要求：\n\n|     模型    |  设置\u003Cbr\u002F>(高\u002F宽\u002F帧率) | GPU峰值显存  |\n|:------------:|:--------------------------------:|:----------------:|\n| HunyuanVideo   |        720px×1280px×129f          |       60GB        |\n| HunyuanVideo   |        544px×960px×129f           |       45GB        |\n\n* 需要支持CUDA的NVIDIA显卡。  \n  * 该模型已在单块80G显卡上测试通过。\n  * **最低要求**：生成720px×1280px×129f视频时，GPU显存需至少60GB；生成544px×960px×129f视频时，需至少45GB。\n  * **推荐配置**：为获得更好的生成效果，建议使用80GB显存的GPU。\n* 测试操作系统：Linux\n\n\n\n## 🛠️ 依赖与安装\n\n首先克隆仓库：\n```shell\ngit clone https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\ncd HunyuanVideo\n```\n\n### Linux系统安装指南\n\n手动安装时，推荐使用CUDA 12.4或11.8版本。\n\nConda的安装说明请参见[这里](https:\u002F\u002Fdocs.anaconda.com\u002Ffree\u002Fminiconda\u002Findex.html)。\n\n```shell\n# 1. 创建Conda环境\nconda create -n HunyuanVideo python==3.10.9\n\n# 2. 激活环境\nconda activate HunyuanVideo\n\n# 3. 使用Conda安装PyTorch及其他依赖\n# 对于CUDA 11.8\nconda install pytorch==2.6.0 torchvision==0.19.0 torchaudio==2.4.0 pytorch-cuda=11.8 -c pytorch -c nvidia\n# 对于CUDA 12.4\nconda install pytorch==2.6.0 torchvision==0.19.0 torchaudio==2.4.0 pytorch-cuda=12.4 -c pytorch -c nvidia\n\n# 4. 安装pip依赖\npython -m pip install -r requirements.txt\n\n# 5. 安装flash attention v2以加速（需CUDA 11.8及以上）\npython -m pip install ninja\npython -m pip install git+https:\u002F\u002Fgithub.com\u002FDao-AILab\u002Fflash-attention.git@v2.6.3\n\n# 6. 安装xDiT以支持并行推理（建议配合PyTorch 2.6.0和flash-attn 2.6.3使用）\npython -m pip install xfuser==0.4.0\n```\n\n如果在特定型号的GPU上运行时遇到浮点异常（核心转储），可以尝试以下解决方案：\n\n```shell\n# 选项1：确保已安装CUDA 12.4、CUBLAS≥12.4.5.8以及CUDNN≥9.00（或者直接使用我们的CUDA 12 Docker镜像）。\npip install nvidia-cublas-cu12==12.4.5.8\nexport LD_LIBRARY_PATH=\u002Fopt\u002Fconda\u002Flib\u002Fpython3.8\u002Fsite-packages\u002Fnvidia\u002Fcublas\u002Flib\u002F\n\n# 选项2：强制使用CUDA 11.8编译版本的PyTorch及其他所有包\npip uninstall -r requirements.txt  # 卸载所有包\npip uninstall -y xfuser\npip install torch==2.6.0 --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\npip install -r requirements.txt\npip install ninja\npip install git+https:\u002F\u002Fgithub.com\u002FDao-AILab\u002Fflash-attention.git@v2.6.3\npip install xfuser==0.4.0\n```\n\n此外，HunyuanVideo还提供了预构建的Docker镜像。可使用以下命令拉取并运行该镜像。\n\n```shell\n# 对于CUDA 12.4（更新后可避免浮点异常）\ndocker pull hunyuanvideo\u002Fhunyuanvideo:cuda_12\ndocker run -itd --gpus all --init --net=host --uts=host --ipc=host --name hunyuanvideo --security-opt=seccomp=unconfined --ulimit=stack=67108864 --ulimit=memlock=-1 --privileged hunyuanvideo\u002Fhunyuanvideo:cuda_12\n\n# 对于CUDA 11.8\ndocker pull hunyuanvideo\u002Fhunyuanvideo:cuda_11\ndocker run -itd --gpus all --init --net=host --uts=host --ipc=host --name hunyuanvideo --security-opt=seccomp=unconfined --ulimit=stack=67108864 --ulimit=memlock=-1 --privileged hunyuanvideo\u002Fhunyuanvideo:cuda_11\n```\n\n\n## 🧱 预训练模型下载\n\n预训练模型的下载详情请参见[此处](ckpts\u002FREADME.md)。\n\n## 🔑 单 GPU 推理\n\n我们在下表中列出了我们支持的高\u002F宽\u002F帧设置。\n\n|      分辨率       |           高\u002F宽=9:16           |    高\u002F宽=16:9     |     高\u002F宽=4:3     |     高\u002F宽=3:4     |     高\u002F宽=1:1     |\n|:---------------------:|:----------------------------:|:---------------:|:---------------:|:---------------:|:---------------:|\n|         540p          |        544px960px129f        |  960px544px129f | 624px832px129f  |  832px624px129f |  720px720px129f |\n| 720p（推荐）    |       720px1280px129f        | 1280px720px129f | 1104px832px129f | 832px1104px129f | 960px960px129f  |\n\n### 使用命令行\n\n```bash\ncd HunyuanVideo\n\npython3 sample_video.py \\\n    --video-size 720 1280 \\\n    --video-length 129 \\\n    --infer-steps 50 \\\n    --prompt \"一只猫在草地上行走，写实风格。\" \\\n    --flow-reverse \\\n    --use-cpu-offload \\\n    --save-path .\u002Fresults\n```\n\n### 运行 Gradio 服务器\n```bash\npython3 gradio_server.py --flow-reverse\n\n# 手动设置 SERVER_NAME 和 SERVER_PORT\n# SERVER_NAME=0.0.0.0 SERVER_PORT=8081 python3 gradio_server.py --flow-reverse\n```\n\n### 更多配置\n\n我们列出了一些更实用的配置，方便使用：\n\n|        参数        |  默认值  |                描述                |\n|:----------------------:|:---------:|:-----------------------------------------:|\n|       `--prompt`       |   无    |   视频生成的文本提示    |\n|     `--video-size`     | 720 1280  |      生成视频的尺寸      |\n|    `--video-length`    |    129    |     生成视频的时长     |\n|    `--infer-steps`     |    50     |     采样步数      |\n| `--embedded-cfg-scale` |    6.0    |    内置分类器自由引导尺度       |\n|     `--flow-shift`     |    7.0    | 流匹配调度器的偏移因子 |\n|     `--flow-reverse`   |    假    | 如果为真，则从 t=1 到 t=0 进行学习\u002F采样 |\n|        `--seed`        |     无  |   用于生成视频的随机种子，若未指定则自动初始化随机种子    |\n|  `--use-cpu-offload`   |   假   |    使用 CPU offload 加载模型以节省更多内存，对于高分辨率视频生成是必要的    |\n|     `--save-path`      | .\u002Fresults |     保存生成视频的路径      |\n\n\n\n## 🚀 xDiT 在多 GPU 上的并行推理\n\n[xDiT](https:\u002F\u002Fgithub.com\u002Fxdit-project\u002FxDiT) 是一个用于多 GPU 集群上的扩散 Transformer (DiT) 的可扩展推理引擎。\n它已成功为多种 DiT 模型提供了低延迟的并行推理解决方案，包括 mochi-1、CogVideoX、Flux.1、SD3 等。本仓库采用了 [统一序列并行性 (USP)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2405.07719) API 来实现 HunyuanVideo 模型的并行推理。\n\n### 使用命令行\n\n例如，要使用 8 个 GPU 生成视频，可以使用以下命令：\n\n```bash\ncd HunyuanVideo\n\ntorchrun --nproc_per_node=8 sample_video.py \\\n    --video-size 1280 720 \\\n    --video-length 129 \\\n    --infer-steps 50 \\\n    --prompt \"一只猫在草地上行走，写实风格。\" \\\n    --flow-reverse \\\n    --seed 42 \\\n    --ulysses-degree 8 \\\n    --ring-degree 1 \\\n    --save-path .\u002Fresults\n```\n\n您可以调整 `--ulysses-degree` 和 `--ring-degree` 来控制并行配置，以获得最佳性能。有效的并行配置如下表所示。\n\n\u003Cdetails>\n\u003Csummary>支持的并行配置（点击展开）\u003C\u002Fsummary>\n\n|     --video-size     | --video-length | --ulysses-degree x --ring-degree | --nproc_per_node |\n|----------------------|----------------|----------------------------------|------------------|\n| 1280 720 或 720 1280 | 129            | 8x1,4x2,2x4,1x8                  | 8                |\n| 1280 720 或 720 1280 | 129            | 1x5                              | 5                |\n| 1280 720 或 720 1280 | 129            | 4x1,2x2,1x4                      | 4                |\n| 1280 720 或 720 1280 | 129            | 3x1,1x3                          | 3                |\n| 1280 720 或 720 1280 | 129            | 2x1,1x2                          | 2                |\n| 1104 832 或 832 1104 | 129            | 4x1,2x2,1x4                      | 4                |\n| 1104 832 或 832 1104 | 129            | 3x1,1x3                          | 3                |\n| 1104 832 或 832 1104 | 129            | 2x1,1x2                          | 2                |\n| 960 960              | 129            | 6x1,3x2,2x3,1x6                  | 6                |\n| 960 960              | 129            | 4x1,2x2,1x4                      | 4                |\n| 960 960              | 129            | 3x1,1x3                          | 3                |\n| 960 960              | 129            | 1x2,2x1                          | 2                |\n| 960 544 或 544 960   | 129            | 6x1,3x2,2x3,1x6                  | 6                |\n| 960 544 或 544 960   | 129            | 4x1,2x2,1x4                      | 4                |\n| 960 544 或 544 960   | 129            | 3x1,1x3                          | 3                |\n| 960 544 或 544 960   | 129            | 1x2,2x1                          | 2                |\n| 832 624 或 624 832   | 129            | 4x1,2x2,1x4                      | 4                |\n| 624 832 或 624 832   | 129            | 3x1,1x3                          | 3                |\n| 832 624 或 624 832   | 129            | 2x1,1x2                          | 2                |\n| 720 720              | 129            | 1x5                              | 5                |\n| 720 720              | 129            | 3x1,1x3                          | 3                |\n\n\u003C\u002Fdetails>\n\n\n\u003Cp align=\"center\">\n\u003Ctable align=\"center\">\n\u003Cthead>\n\u003Ctr>\n    \u003Cth colspan=\"4\">1280x720（129 帧，50 步）在 8xGPU 上的延迟（秒）\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Cth>1\u003C\u002Fth>\n    \u003Cth>2\u003C\u002Fth>\n    \u003Cth>4\u003C\u002Fth>\n    \u003Cth>8\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n    \u003Cth>1904.08\u003C\u002Fth>\n    \u003Cth>934.09（2.04倍）\u003C\u002Fth>\n    \u003Cth>514.08（3.70倍）\u003C\u002Fth>\n    \u003Cth>337.58（5.64倍）\u003C\u002Fth>\n\u003C\u002Ftr>\n\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fp>\n\n\n\n## 🚀 FP8 推理\n\n使用 FP8 量化权重的 HunyuanVideo 可以节省约 10GB 的 GPU 内存。您可以从 Huggingface 下载 [权重](https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo\u002Fblob\u002Fmain\u002Fhunyuan-video-t2v-720p\u002Ftransformers\u002Fmp_rank_00_model_states_fp8.pt) 和 [权重缩放值](https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo\u002Fblob\u002Fmain\u002Fhunyuan-video-t2v-720p\u002Ftransformers\u002Fmp_rank_00_model_states_fp8_map.pt)。\n\n### 使用命令行\n\n在这里，您必须显式指定 FP8 权重路径。例如，要使用 fp8 权重生成视频，可以使用以下命令：\n\n```bash\ncd HunyuanVideo\n\nDIT_CKPT_PATH={FP8权重路径}\u002F{权重名称}_fp8.pt\n\npython3 sample_video.py \\\n    --dit-weight ${DIT_CKPT_PATH} \\\n    --video-size 1280 720 \\\n    --video-length 129 \\\n    --infer-steps 50 \\\n    --prompt \"一只猫在草地上行走，写实风格。\" \\\n    --seed 42 \\\n    --embedded-cfg-scale 6.0 \\\n    --flow-shift 7.0 \\\n    --flow-reverse \\\n    --use-cpu-offload \\\n    --use-fp8 \\\n    --save-path .\u002Fresults\n```\n\n\n\n## 🔗 BibTeX\n\n如果您发现 [HunyuanVideo](https:\u002F\u002Farxiv.org\u002Fabs\u002F2412.03603) 对您的研究和应用有所帮助，请使用以下 BibTeX 格式引用：\n\n```BibTeX\n@article{kong2024hunyuanvideo,\n  title={Hunyuanvideo: 大规模视频生成模型的系统性框架},\n  author={Kong, Weijie and Tian, Qi and Zhang, Zijian and Min, Rox and Dai, Zuozhuo and Zhou, Jin and Xiong, Jiangfeng and Li, Xin and Wu, Bo and Zhang, Jianwei and others},\n  journal={arXiv 预印本 arXiv:2412.03603},\n  year={2024}\n}\n```\n\n\n\n## 致谢\n\n我们衷心感谢 [SD3](https:\u002F\u002Fhuggingface.co\u002Fstabilityai\u002Fstable-diffusion-3-medium)、[FLUX](https:\u002F\u002Fgithub.com\u002Fblack-forest-labs\u002Fflux)、[Llama](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama)、[LLaVA](https:\u002F\u002Fgithub.com\u002Fhaotian-liu\u002FLLaVA)、[Xtuner](https:\u002F\u002Fgithub.com\u002FInternLM\u002Fxtuner)、[diffusers](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fdiffusers) 和 [HuggingFace](https:\u002F\u002Fhuggingface.co) 等开源项目的所有贡献者，感谢他们开放的研究与探索。\n\n此外，我们还要感谢腾讯混元多模态团队在文本编码器方面的帮助。\n\n\n## GitHub 星标历史\n\u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#Tencent-Hunyuan\u002FHunyuanVideo&Date\">\n \u003Cpicture>\n   \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_648fd42f3dcb.png&theme=dark\" \u002F>\n   \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_648fd42f3dcb.png\" \u002F>\n   \u003Cimg alt=\"星标历史图表\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_readme_648fd42f3dcb.png\" \u002F>\n \u003C\u002Fpicture>\n\u003C\u002Fa>","# HunyuanVideo 快速上手指南\n\nHunyuanVideo 是腾讯混元团队开源的大型视频生成基础模型，支持文生视频（Text-to-Video），在视觉质量、运动多样性和文本对齐方面表现卓越。本指南将帮助开发者快速完成环境配置并运行推理。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**: Linux (推荐 Ubuntu 20.04+)\n*   **Python**: 3.8 或更高版本\n*   **GPU**: NVIDIA 显卡，显存建议 24GB 及以上（生成 720p 视频）。若显存不足，可使用 FP8 量化版本或多卡并行推理。\n*   **CUDA**: 11.8 或 12.x\n*   **Git & Git LFS**: 用于克隆代码库和下载大模型文件\n\n## 安装步骤\n\n### 1. 克隆项目代码\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo.git\ncd HunyuanVideo\n```\n\n### 2. 创建虚拟环境并安装依赖\n推荐使用 Conda 管理环境。为方便国内用户，这里提供使用清华源加速安装的方案。\n\n```bash\n# 创建虚拟环境\nconda create -n hunyuan python=3.10 -y\nconda activate hunyuan\n\n# 安装 PyTorch (根据实际 CUDA 版本调整，此处以 12.1 为例)\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu121\n\n# 安装其他依赖 (使用国内镜像源加速)\npip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n> **注意**：如果项目中未直接提供 `requirements.txt`，请参考仓库根目录下的安装说明手动安装列出的核心库（如 `transformers`, `diffusers`, `accelerate` 等）。目前该模型已集成到 `diffusers` 库中，也可直接通过 `pip install diffusers` 使用。\n\n### 3. 下载预训练模型\n模型权重较大，请使用 Git LFS 下载或通过 Hugging Face 镜像站下载。\n\n**方式 A：使用 Git LFS (需配置代理或镜像)**\n```bash\n# 确保已安装 git-lfs\ngit lfs install\ngit lfs pull\n```\n*注：模型文件通常位于 `ckpts` 目录，具体下载链接请参考 `ckpts\u002FREADME.md`。*\n\n**方式 B：手动下载 (推荐国内用户)**\n访问 [Hugging Face 模型页](https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanVideo) 或使用国内镜像站（如 ModelScope）下载 `hunyuan-video-t2v-720p` 文件夹，并将其放置在项目指定的目录下（通常为 `ckpts\u002F`）。\n\n若使用 **FP8 量化版本**（节省显存），请下载 `mp_rank_00_model_states_fp8.pt`。\n\n## 基本使用\n\n### 方式一：命令行推理 (单卡)\n\n这是最基础的用法，适合测试模型是否正常运行。\n\n```bash\npython infer.py \\\n    --ckpt_path .\u002Fckpts\u002Fhunyuan-video-t2v-720p \\\n    --prompt \"A cat walking on the street, realistic style, high quality\" \\\n    --save_path .\u002Foutputs\u002Fsample.mp4 \\\n    --height 720 \\\n    --width 1280 \\\n    --num_frames 129\n```\n\n*   `--ckpt_path`: 模型权重文件夹路径。\n*   `--prompt`: 生成视频的描述词（支持英文，建议使用详细描述）。\n*   `--height` \u002F `--width`: 输出分辨率。\n*   `--num_frames`: 生成帧数（通常为 129 帧，对应约 5 秒视频）。\n\n**显存优化提示**：如果您的显存小于 24GB，请添加 `--use_fp8` 参数（需提前下载 FP8 权重）或减少 `--height` 和 `--num_frames`。\n\n### 方式二：启动 Web 演示界面 (Gradio)\n\n项目提供了基于 Gradio 的本地 Web 界面，方便直观地调整参数和生成视频。\n\n```bash\npython gradio_server.py \\\n    --ckpt_path .\u002Fckpts\u002Fhunyuan-video-t2v-720p\n```\n\n运行后，终端会显示一个本地地址（如 `http:\u002F\u002F127.0.0.1:7860`），在浏览器中打开即可使用。\n\n### 方式三：使用 Diffusers 库 (Python API)\n\n由于 HunyuanVideo 已集成至 `diffusers`，您可以直接使用 Python 代码调用：\n\n```python\nimport torch\nfrom diffusers import HunyuanVideoPipeline\n\n# 加载管道\npipe = HunyuanVideoPipeline.from_pretrained(\n    \"tencent\u002FHunyuanVideo\", \n    torch_dtype=torch.bfloat16\n).to(\"cuda\")\n\n# 生成视频\nprompt = \"A drone view of a snowy mountain landscape, cinematic lighting\"\noutput = pipe(\n    prompt=prompt,\n    height=720,\n    width=1280,\n    num_frames=129,\n    guidance_scale=7.5,\n    num_inference_steps=50\n).frames[0]\n\n# 保存视频\nfrom diffusers.utils import export_to_video\nexport_to_video(output, \"output.mp4\", fps=24)\n```\n\n---\n**进阶提示**：\n*   **多卡并行加速**：若拥有多张 GPU，可使用 xDiT 进行并行推理以提升速度，参考命令：`python parallel_inference.py ...`。\n*   **提示词优化**：模型内置了 Prompt Rewrite 功能，若生成的视频效果不佳，可尝试启用提示词重写模块自动优化描述。","某独立游戏开发者正在为一款赛博朋克风格的冒险游戏制作开场动画，需要生成一段高质量、动作连贯且符合特定美术风格的视频素材。\n\n### 没有 HunyuanVideo 时\n- **制作成本高昂**：必须聘请专业 3D 动画师或使用昂贵的渲染农场，单秒视频的制作成本高达数百元，严重挤压独立开发者的预算。\n- **迭代周期漫长**：修改一个镜头的光影或角色动作，需要重新建模、绑定并渲染数小时，无法快速验证创意想法。\n- **风格统一困难**：外包团队难以精准还原开发者脑海中独特的“霓虹故障风”，反复沟通导致成品与预期偏差较大。\n- **动态连贯性差**：尝试使用早期小型 AI 视频模型时，人物动作经常扭曲变形，背景闪烁严重，无法直接用于商业项目。\n\n### 使用 HunyuanVideo 后\n- **大幅降低门槛**：开发者只需输入详细的文本提示词，HunyuanVideo 即可直接在本地或云端生成 720p 高清视频，将制作成本降低至几乎为零。\n- **实时创意验证**：利用其高效的推理框架，几分钟内即可生成多个不同运镜版本的样片，迅速锁定最佳视觉方案。\n- **精准风格控制**：依托其系统性框架对复杂提示词的理解能力，HunyuanVideo 能准确呈现“雨夜霓虹”、“机械义肢”等细节，完美契合游戏美术设定。\n- **电影级画质输出**：生成的视频中人物动作自然流畅，长镜头下背景稳定无闪烁，物理运动规律符合真实逻辑，达到可直接商用的标准。\n\nHunyuanVideo 让独立创作者也能以极低的成本和极高的效率，拥有媲美大厂的电影级视频生成能力，彻底重塑了内容创作的工作流。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanVideo_37a2ecfc.png","Tencent-Hunyuan","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FTencent-Hunyuan_c6e5ecd4.png","",null,"https:\u002F\u002Fhunyuan.tencent.com\u002F","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan",[80,84],{"name":81,"color":82,"percentage":83},"Python","#3572A5",98.7,{"name":85,"color":86,"percentage":87},"Shell","#89e051",1.3,11978,1229,"2026-04-18T08:39:37","NOASSERTION","Linux","必需 NVIDIA GPU。官方提供 FP8 量化权重以节省显存；支持多 GPU 并行推理 (xDiT)。具体显存需求未在当前片段明确说明，但作为 130 亿参数的大型视频生成模型，通常建议 24GB+ (如 A10\u002FA100\u002FRTX 3090\u002F4090)，FP8 版本可降低需求。","未说明",{"notes":96,"python":94,"dependencies":97},"该模型拥有超过 130 亿参数，是大型视频生成基础模型。官方提供了 FP8 量化权重以减少显存占用。支持单卡推理、多卡序列并行推理（通过 xDiT 加速）以及 ComfyUI 集成。安装指南部分在提供的文本中被截断，因此具体的 Python 版本和详细的依赖库版本号未在片段中直接显示，但通常此类项目需要较新的 PyTorch (2.0+) 和 CUDA 环境。",[98,99,100,101,102],"PyTorch","Diffusers","Transformers","Gradio","xDiT",[104,35,15],"视频",[106,107,108],"video-generation","diffusion-models","diffusion-transformer","2026-03-27T02:49:30.150509","2026-04-19T03:05:10.388513",[112,117,122,127,132,137],{"id":113,"question_zh":114,"answer_zh":115,"source_url":116},41105,"如何在多张 GPU 上运行模型进行推理？","请使用 `sample_video.py` 脚本并配合 `torchrun` 命令启动。注意不要使用已废弃或笔误的 `sample_video_parallel.py`。示例命令如下：\n`torchrun --nproc_per_node=4 sample_video.py --video-size 1280 720 --video-length 129 --infer-steps 50 --prompt \"A cat walks on the grass\" --flow-reverse --seed 42 --ulysses-degree 4 --ring-degree 1 --save-path .\u002Fresults`\n其中 `--ulysses-degree` 和 `--ring-degree` 用于配置并行策略（如 4 卡可设为 4 和 1）。","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\u002Fissues\u002F33",{"id":118,"question_zh":119,"answer_zh":120,"source_url":121},41106,"安装 flash-attention 时失败或报错怎么办？","建议手动下载与当前环境匹配的预编译 wheel 文件进行离线安装，步骤如下：\n1. 检查 Python 版本（如 3.10）。\n2. 检查 CUDA 版本（使用 `nvidia-smi`）。\n3. 检查 CPython 标签：运行 `python -m pip install wheel && python -c 'from wheel.vendored.packaging import tags; print(f\"{tags.interpreter_name()}{tags.interpreter_version()}\", end=\"\")'`。\n4. 前往 Flash Attention Releases 页面 (https:\u002F\u002Fgithub.com\u002FDao-AILab\u002Fflash-attention\u002Freleases) 下载匹配版本。\n注意：如果遇到问题，请选择文件名中包含 `abiFALSE` 的版本，避免使用 `abiTRUE`。\n5. 安装：`python -m pip install flash_attention_xxx.whl`。","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\u002Fissues\u002F51",{"id":123,"question_zh":124,"answer_zh":125,"source_url":126},41107,"多卡推理时出现显存不足（OOM）错误的原因是什么？","多卡推理目前不支持 CPU offloading（CPU 卸载），因此相比单卡推理会消耗更多的 GPU 显存，这是导致 OOM 的主要原因。\n解决方案：\n1. 尝试降低生成视频的分辨率或帧数。\n2. 官方正在探索 FSDP 等策略以降低显存需求，但目前需通过调整输入参数来规避。","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\u002Fissues\u002F129",{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},41108,"如何在 ComfyUI 中使用多张显卡（如 4x3090）运行 Hunyuan Video？","目前在 ComfyUI 中直接利用多卡并行（如 xDiT）的支持尚不明确或可能未完全集成。官方建议使用命令行工具 `sample_video.py` 配合 `torchrun` 来实现多卡并行推理。对于希望在 ComfyUI 中使用的用户，可能需要等待后续更新或查看 xDiT 论文 (https:\u002F\u002Farxiv.org\u002Fabs\u002F2411.01738) 了解底层并行原理，暂时推荐优先使用官方提供的 Python 脚本进行多卡部署。","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\u002Fissues\u002F96",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},41109,"生成视频时长时间卡在某个进度条不动是正常现象吗？","如果使用高显存占用配置（如 4090 24G 生成高分辨率长视频），生成过程可能非常缓慢，甚至看似卡死。这通常是因为显存接近极限导致交换频繁或计算负载极高。\n建议：\n1. 确认显存是否已满（使用 `nvidia-smi` 监控）。\n2. 尝试减小 `--video-size` 或 `--video-length` 参数。\n3. 若使用多卡，确保正确配置了并行参数（如 `--ulysses-degree`），否则单卡负载过重会导致极慢的生成速度。","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanVideo\u002Fissues\u002F71",{"id":138,"question_zh":139,"answer_zh":140,"source_url":131},41110,"xDiT 并行推理中的序列并行（sequence parallel）是如何工作的？","在使用序列并行时，模型会被复制到每张 GPU 上。这意味着显存占用会随着 GPU 数量线性增加（除非使用其他优化策略）。\n如果需要更低的显存占用，可以参考官方发布的 xDiT 论文 (https:\u002F\u002Farxiv.org\u002Fabs\u002F2411.01738)，其中介绍了其他并行方法（如环状并行 Ring Parallel 等），可以在保持性能的同时降低单卡显存压力。",[]]