[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-Tencent-Hunyuan--HunyuanImage-2.1":3,"tool-Tencent-Hunyuan--HunyuanImage-2.1":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":75,"owner_avatar_url":76,"owner_bio":77,"owner_company":78,"owner_location":78,"owner_email":78,"owner_twitter":78,"owner_website":79,"owner_url":80,"languages":81,"stars":86,"forks":87,"last_commit_at":88,"license":89,"difficulty_score":10,"env_os":90,"env_gpu":91,"env_ram":92,"env_deps":93,"category_tags":98,"github_topics":99,"view_count":23,"oss_zip_url":78,"oss_zip_packed_at":78,"status":16,"created_at":105,"updated_at":106,"faqs":107,"releases":138},4007,"Tencent-Hunyuan\u002FHunyuanImage-2.1","HunyuanImage-2.1","HunyuanImage-2.1: An Efficient Diffusion Model for High-Resolution (2K) Text-to-Image Generation​","HunyuanImage-2.1 是腾讯开源的一款高效扩散模型，专为生成高分辨率（2K）文本图像而设计。它主要解决了传统 AI 绘图在超高清画质下细节模糊、文字渲染不准以及多语言理解能力不足的痛点，能够轻松产出具有电影级构图和清晰细节的图像。\n\n这款工具非常适合设计师、内容创作者、AI 研究人员及开发者使用。无论是需要高质量素材的专业人士，还是希望探索前沿技术的开发者，都能从中受益。普通用户也可通过官方网页或 ComfyUI 工作流直接体验其强大的生成能力。\n\n技术亮点方面，HunyuanImage-2.1 采用独特的两阶段架构：第一阶段结合多模态大语言模型与多语言字符感知编码器，显著提升了图文对齐精度及中英文提示词的理解能力；第二阶段引入精炼模型，进一步优化画质并减少伪影。此外，它支持多种画幅比例，并凭借先进的 VAE 压缩技术和 FP8 量化方案，实现了在 24GB 显存下即可生成 2K 图像的高效推理。目前，该模型已在开源文生图榜单中名列前茅，是追求极致画质与多语言支持用户的理想选择。","\n[中文阅读](.\u002FREADME_CN.md)\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_3a7747850603.png\"  height=100>\n\u003C\u002Fp>\n\n\u003Cdiv align=\"center\">\n\n# HunyuanImage-2.1: An Efficient Diffusion Model for High-Resolution (2K) Text-to-Image Generation​\n\n\u003C\u002Fdiv>\n\n\n\u003Cp align=\"center\"> &nbsp&nbsp🤗 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanImage-2.1\">HuggingFace\u003C\u002Fa>&nbsp&nbsp | \n💻 \u003Ca href=\"https:\u002F\u002Fhunyuan.tencent.com\u002FmodelSquare\u002Fhome\u002Fplay?modelId=286&from=\u002Fvisual\">Official website(官网) Try our model!\u003C\u002Fa>&nbsp&nbsp\n\u003C\u002Fp>\n\n\n\n\u003Cp align=\"center\">\n    👏 Join our \u003Ca href=\"assets\u002FWECHAT.md\" target=\"_blank\">WeChat\u003C\u002Fa> and \u003Ca href=\"https:\u002F\u002Fdiscord.com\u002Finvite\u002FdNBrdrGGMa\">Discord\u003C\u002Fa>\n\u003C\u002Fp>\n\n\n-----\n\nThis repo contains PyTorch model definitions, pretrained weights and inference\u002Fsampling code for our HunyuanImage-2.1. You can \u003Cspan style=\"color:red\">**directly try our model**\u003C\u002Fspan> on [Official website(官网)](https:\u002F\u002Fhunyuan.tencent.com\u002FmodelSquare\u002Fhome\u002Fplay?modelId=286&from=\u002Fvisual) and find more visualizations on our [project page](https:\u002F\u002Fhunyuan.tencent.com\u002Fimage\u002Fen?tabIndex=0).\n\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_775580210737.jpg\" width=100% alt=\"HunyuanImage 2.1 Demo\">\n\u003C\u002Fdiv>\n\n## 🔥🔥🔥 Latest Updates\n- September 18, 2025: ✨ Try the [PromptEnhancer-32B model](https:\u002F\u002Fhuggingface.co\u002FPromptEnhancer\u002FPromptEnhancer-32B) for higher-quality prompt enhancement!​.\n- September 18, 2025: ✨ [ComfyUI workflow of HunyuanImage-2.1](https:\u002F\u002Fgithub.com\u002FKimbingNg\u002FComfyUI-HunyuanImage2.1) is available now!\n- September 16, 2025: 👑 We achieved the Top1 on Arena's leaderboard for text-to-image open-source models. [Leaderboard](https:\u002F\u002Fartificialanalysis.ai\u002Ftext-to-image\u002Farena\u002Fleaderboard-text)\n- September 12, 2025: 🚀 Released FP8 quantized models! Making it possible to generate 2K images with only 24GB GPU memory!\n- September 8, 2025: 🚀 Released inference code and model weights for HunyuanImage-2.1.\n\n## Introduction\nWe are excited to introduce **HunyuanImage-2.1**, a 17B text-to-image model that is capable of generating **2K (2048 × 2048) resolution** images. \n\n\u003C!-- Leveraging an extensive dataset and structured captions involving multiple expert models, we significantly enhance text-image alignment capabilities. The model employs a highly expressive VAE with a (32 × 32) spatial compression ratio, substantially reducing computational costs. -->\n\nOur architecture consists of two stages:\n1. **​Base text-to-image Model**:​​ The first stage is a text-to-image model that utilizes two text encoders: a multimodal large language model (MLLM) to improve image-text alignment, and a multi-language, character-aware encoder to enhance text rendering across various languages. \n2. **Refiner Model**: The second stage introduces a refiner model that further enhances image quality and clarity, while minimizing artifacts. \n\u003C!-- \nAdditionally, we developed the PromptEnhancer module to further boost model performance, and employed meanflow distillation for efficient inference. HunyuanImage-2.1 demonstrates robust semantic alignment and cross-scenario generalization, leading to improved consistency between text and image, enhanced control of scene details, character poses, and expressions, and the ability to generate multiple objects with distinct descriptions. -->\n\n👑 We achieved the **Top1** on Arena's leaderboard for text-to-image open-source models.\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_9a864444c52d.png\" width=70% alt=\"HunyuanImage 2.1 Demo\">\n\u003C\u002Fdiv>\n \n\n## 🎉 HunyuanImage-2.1 Key Features\n\n- **High-Quality Generation**: Efficiently produces ultra-high-definition (2K) images with cinematic composition.\n- **Multilingual Support**: Provides native support for both Chinese and English prompts.\n- **Advanced Architecture**: Built on a multi-modal, single- and dual-stream combined DiT (Diffusion Transformer) backbone.\n- **Glyph-Aware Processing**: Utilizes ByT5's text rendering capabilities for improved text generation accuracy.\n- **Flexible Aspect Ratios**: Supports a variety of image aspect ratios (1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3).\n- **Prompt Enhancement**: Automatically rewrites prompts to improve descriptive accuracy and visual quality.\n\n\n\n\n\n\n## 📜 System Requirements\n\n**Hardware and OS Requirements:**\n- NVIDIA GPU with CUDA support.\n\n  **Minimum requrement for now:** 24 GB GPU memory for 2048x2048 image generation.\n  \n  > **Note:** The memory requirements above are measured with model CPU offloading and FP8 quantization enabled. If your GPU has sufficient memory, you may disable offloading for improved inference speed.\n- Supported operating system: Linux.\n\n\n## 🛠️ Dependencies and Installation\n\n1. Clone the repository:\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1.git\ncd HunyuanImage-2.1\n```\n\n2. Install dependencies:\n```bash\npip install -r requirements.txt\npip install flash-attn==2.7.3 --no-build-isolation\n```\n\n## 🧱 Download Pretrained Models\n\nThe details of download pretrained models are shown [here](ckpts\u002Fcheckpoints-download.md).\n\n## 🔑 Usage\n\n### Prompt Enhancement\n\nPrompt enhancement plays a **crucial role** in enabling our model to generate high-quality images. By writing longer and more detailed prompts, the generated image will be significantly improved. We encourage you to craft comprehensive and descriptive prompts to achieve the best possible image quality. \n\nWe highly recommend you to try the [PromptEnhancer-32B model](https:\u002F\u002Fhuggingface.co\u002FPromptEnhancer\u002FPromptEnhancer-32B) for higher-quality prompt enhancement.\n\n\n### Text to Image\nHunyuanImage-2.1 **only supports 2K** image generation (e.g. 2048x2048 for 1:1 images, 2560x1536 for 16:9 images, etc.).\nGenerating images with 1K resolution will result in artifacts.\n\nAdditionally, we **highly recommend** using the full generation pipeline for better quality (i.e. enabling prompt enhancement and refinment).\n\n\n| model type               | model name                | description                             | num_inference_steps | guidance_scale | shift |\n|--------------------------|---------------------------|-----------------------------------------|---------------------|----------------|-------|\n| Base text-to-image Model | hunyuanimage2.1           | Undistilled model for the best quality. | 50                  | 3.5            | 5     |\n| Distilled text-to-image Model | hunyuanimage2.1-distilled | Distilled model for faster inference    | 8                   | 3.25           | 4     |\n| Refiner                  | hunyuanimage-refiner      | The refiner model                       | N\u002FA                 | N\u002FA            | N\u002FA   |\n\n\n```python\nimport os\nos.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True'\nimport torch\nfrom hyimage.diffusion.pipelines.hunyuanimage_pipeline import HunyuanImagePipeline\n\n# Supported model_name: hunyuanimage-v2.1, hunyuanimage-v2.1-distilled\nmodel_name = \"hunyuanimage-v2.1\"\npipe = HunyuanImagePipeline.from_pretrained(model_name=model_name, use_fp8=True)\npipe = pipe.to(\"cuda\")\n\n# The input prompt\nprompt = \"A cute, cartoon-style anthropomorphic penguin plush toy with fluffy fur, standing in a painting studio, wearing a red knitted scarf and a red beret with the word \\\"Tencent\\\" on it, holding a paintbrush with a focused expression as it paints an oil painting of the Mona Lisa, rendered in a photorealistic photographic style.\"\n\n\n# Generate with different aspect ratios\naspect_ratios = {\n    \"16:9\": (2560, 1536),\n    \"4:3\": (2304, 1792),\n    \"1:1\": (2048, 2048),\n    \"3:4\": (1792, 2304),\n    \"9:16\": (1536, 2560),\n}\n\nwidth, height = aspect_ratios[\"1:1\"]\n\nimage = pipe(\n    prompt=prompt,\n    width=width,\n    height=height,\n    # disable the reprompt if you already use the prompt enhancement to enhance the prompt\n    use_reprompt=False,  # Enable prompt enhancement (which may result in higher GPU memory usage)\n    use_refiner=True,   # Enable refiner model\n    # For the distilled model, use 8 steps for faster inference.\n    # For the non-distilled model, use 50 steps for better quality.\n    num_inference_steps=8 if \"distilled\" in model_name else 50, \n    guidance_scale=3.25 if \"distilled\" in model_name else 3.5,\n    shift=4 if \"distilled\" in model_name else 5,\n    seed=649151,\n)\n\nimage.save(\"generated_image.png\")\n```\n\n## More Cases\nOur model can follow complex instructions to generate high‑quality, creative images. \n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_6d98286deece.jpg\" width=100% alt=\"HunyuanImage 2.1 Demo\">\n\u003C\u002Fdiv>\n\nWe recommend using longer, more detailed prompts. You can also try the prompts we provide.\n \n\u003Cp align=\"center\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n    \u003Cth>Index\u003C\u002Fth>  \u003Cth>User Prompt\u003C\u002Fth> \u003Cth>Image\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n    \u003Ctd>1\u003C\u002Ftd> \u003Ctd>宏伟教堂的内部，穹顶下方的中央矗立着一尊小巧的维纳斯雕像，微微侧对镜头。雕像没有双手，布满裂纹，表面若干古老的水泥片剥落，露出内部真人质感的牛奶肌肤。雕像穿着薄薄的白色婚纱，在雕像的身后，一只浮空水泥断手轻轻提起长长的婚纱拖尾；在雕像的头顶上方，另一只浮空水泥断手正为她戴上一个由白色花朵组成的花环，雕像本身是没有双手的。教堂穹顶上布满彩色玻璃窗，一束阳光从上往下照射到雕像上，形成丁达尔效应，光斑点点洒在雕像的脸庞和胸前。充满神性的光辉，背景微微虚化，物体的边缘模糊柔和。拉斐尔前派的梦幻朦胧美学风格。\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_bd7e81239c40.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>2\u003C\u002Ftd> \u003Ctd>A hyper-realistic photograph of a crystal ball diorama sitting atop fluffy forest moss and surrounded by scattered sunlight. Inside, detailed diorama features a Tencent meeting room, an animated chat bubble sculpture, and several joyful penguins—one wearing a graduation cap, others playing soccer and waving tiny banners. The base of the crystal sphere boldly presents \"\"Tencent\"\" in large, crisp, white 3D letters. Background is softly blurred and bokeh-rich, emphasizing the cute, vibrant details of the sphere.\u003C\u002Ftd>  \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_121d0dfc9b48.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>3\u003C\u002Ftd> \u003Ctd>A close-up portrait of an elderly Italian man with deeply wrinkled skin, expressive hazel eyes, and a neatly trimmed white mustache. His olive-toned complexion shows the marks of sun and age, and he wears a flat cap slightly tilted to the side. He smiles faintly, revealing warmth and wisdom, while holding a small espresso cup in one hand. The softly blurred background shows a rustic stone wall with climbing ivy, captured in a realistic photography style.\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_4014da80d47b.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>4\u003C\u002Ftd> \u003Ctd>An open vintage suitcase on a neutral, softly lit background. The suitcase is made of deep brown, worn leather with visible scuffs and creases, and its interior is lined with dark, plush fabric. Inside the suitcase is a meticulously crafted miniature landscape of China, featuring the Great Wall of China winding across model mountains, the pagoda roofs of the Forbidden City, and a representation of the terracotta army, all interwoven with vibrant green rice paddies.  On the side of the suitcase, a text \"China\" is labeled. The entire diorama is bathed in warm, ethereal light, with a dreamy lens bloom and soft, glowing highlights. Photorealistic style, ultra-detailed textures, cinematic lighting.\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_2dc04155c6a4.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fp>\n\n\n To improve the quality and detail of generated images, we use a prompt rewriting model. This model automatically enhances user-provided text prompts by adding detailed and descriptive information.\n\u003Cp align=\"center\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n    \u003Cth>Index\u003C\u002Fth>  \u003Cth>User Prompt\u003C\u002Fth> \u003Cth>Prompt Enhanced\u003C\u002Fth> \u003Cth>Image\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n    \u003Ctd>1\u003C\u002Ftd> \u003Ctd>Wildlife poster for Serengeti plains. Wide-eyed chibi explorer riding friendly lion cub. 'Serengeti: Roar of Adventure' in whimsical font. 'Where Dreams Run Wild' tagline. Warm yellows and soft browns.\u003C\u002Ftd> \u003Ctd> A wildlife poster design for the Serengeti plains features a central illustration of a chibi-style explorer riding a lion cub, set against a backdrop of rolling hills. At the top of the composition, the title \"Serengeti: Roar of Adventure\" is displayed in a large, whimsical font with decorative, swirling letters. The main scene depicts a wide-eyed chibi explorer, characterized by a large head and a small body, sitting atop a friendly lion cub. The explorer wears a green explorer's hat, a backpack, and holds onto the cub's mane, looking forward with a look of wonder. The lion cub, with a light brown mane and a smiling expression, strides forward, its body rendered in warm orange tones. In the background, the Serengeti plains are illustrated with rolling hills and savanna grass, all in shades of warm yellow and soft brown. Below the main illustration, the tagline \"Where Dreams Run Wild\" is written in a smaller, elegant script. The overall presentation is that of a poster design, combining a cute chibi illustration style with playful, whimsical typography.\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_458df54b23d2.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>2\u003C\u002Ftd> \u003Ctd>Energetic poster for New York City. Anime businesswoman hailing a taxi with skyscrapers and Times Square signs around. 'NYC: Bright Ambitions' in urban graffiti font. 'Own Every Dream' tagline. Saturated yellows, reds, and sharp blues.\u003C\u002Ftd> \u003Ctd>An energetic poster for New York City unfolds, featuring a dynamic scene with an anime-style businesswoman in the midst of hailing a taxi. The central figure is a young woman with large, expressive eyes and dark hair styled in a bob, wearing a professional blue business suit with motion lines indicating movement. She stands on a bustling street, her arms outstretched as she calls for a classic yellow taxi cab that is approaching. In the background, towering skyscrapers with sleek, anime-inspired architecture rise into the sky, adorned with vibrant, glowing billboards and neon signs characteristic of Times Square. Across the top of the poster, the text \"NYC: Bright Ambitions\" is displayed in a large, stylized urban graffiti font, with spray-paint-like edges. Below this main title, the tagline \"Own Every Dream\" is written in a smaller, clean font. The entire composition is rendered with saturated colors, dominated by bright yellows, reds, and sharp blues. The overall presentation is a fusion of anime illustration and graphic design.\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_c20d2afdbe3c.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>3\u003C\u002Ftd> \u003Ctd>An artistic studio portrait captures a high fashion model in a striking, dynamic pose. Her face is a canvas for avant-garde makeup, defined by bold, geometric applications of primary colors. She wears a sculptural, unconventional garment, emphasizing clean lines and form. The scene is illuminated by dramatic studio lighting, creating sharp contrasts and highlighting her features against an abstract, blurred background of colors. The image is presented in a realistic photography style.\u003C\u002Ftd> \u003Ctd> An artistic studio portrait captures a high fashion model in a striking, dynamic pose, her body twisted with one arm raised high to convey energy and movement. Her face serves as a canvas for avant-garde makeup, featuring bold, geometric applications of primary colors; vibrant yellow triangles are painted on her forehead, and electric blue lines accentuate her eye sockets. She wears a sculptural, unconventional garment made of a stiff, matte white fabric, with asymmetrical panels that wrap around her torso, emphasizing clean lines and form. Illuminated by dramatic studio lighting, with a strong beam from the side casting sharp shadows and highlighting the contours of her face and body against an abstract, blurred background of purples and oranges, creating a bokeh effect. Realistic photography style. \u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_f85798ed2b7c.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>4\u003C\u002Ftd> \u003Ctd>An environmental portrait of a chef, captured with a focused expression in a bustling kitchen. He holds culinary tools, his gaze fixed on his work, embodying passion and creativity. The background is a blur of motion with stainless steel counters, all illuminated by a warm ambient light. The image is presented in a realistic photography style.\u003C\u002Ftd> \u003Ctd> An environmental portrait of a male chef in the midst of work within a bustling kitchen. The chef, as the central subject and viewed from the chest up, has a focused expression with a furrowed brow, his gaze directed downward at the culinary tools he holds. He wears a professional white chef‘s jacket and a traditional toque, with flour lightly dusting his face and clothes. In his hands, he grips a large chef’s knife and a metal spatula, poised over an unseen cooking surface. The background is a dynamic blur of motion, with out-of-focus shapes of stainless steel counters, pots, and other kitchen equipment suggesting a busy environment. Warm ambient light from overhead fixtures casts a golden hue, creating highlights on the chef‘s jacket and the tools. Realistic photography style, characterized by a shallow depth of field that emphasizes the subject while conveying the energy and creativity of the kitchen. \u003C\u002Ftd>  \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_71eaa0c693ba.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fp>\n\n\u003C!-- \u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_bfba4f227c8b.jpg\" width=100% alt=\"Human Evaluation with Other Models\">\n\u003C\u002Fp> -->\n\n\n\n## 📈 Comparisons\n\n### SSAE Evaluation\nSSAE (Structured Semantic Alignment Evaluation) is an intelligent evaluation metric for image-text alignment based on advanced multimodal large language models (MLLMs). We extracted 3500 key points across 12 categories, then used multimodal large language models to automatically evaluate and score by comparing the generated images with these key points based on the visual content of the images. Mean Image Accuracy represents the image-wise average score across all key points, while Global Accuracy directly calculates the average score across all key points.\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 rowspan=\"2\">Mean Image Accuracy\u003C\u002Fth> \u003Cth rowspan=\"2\">Global Accuracy\u003C\u002Fth> \u003Cth colspan=\"4\" style=\"text-align: center;\">Primary Subject\u003C\u002Fth> \u003Cth colspan=\"3\" style=\"text-align: center;\">Secondary Subject\u003C\u002Fth> \u003Cth colspan=\"2\" style=\"text-align: center;\">Scene\u003C\u002Fth> \u003Cth colspan=\"3\" style=\"text-align: center;\">Other\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Cth>Noun\u003C\u002Fth> \u003Cth>Key Attributes\u003C\u002Fth> \u003Cth>Other Attributes\u003C\u002Fth> \u003Cth>Action\u003C\u002Fth> \u003Cth>Noun\u003C\u002Fth> \u003Cth>Attributes\u003C\u002Fth> \u003Cth>Action\u003C\u002Fth> \u003Cth>Noun\u003C\u002Fth> \u003Cth>Attributes\u003C\u002Fth> \u003Cth>Shot\u003C\u002Fth> \u003Cth>Style\u003C\u002Fth> \u003Cth>Composition\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n    \u003Ctd>FLUX-dev\u003C\u002Ftd> \u003Ctd>✅\u003C\u002Ftd> \u003Ctd>0.7122\u003C\u002Ftd> \u003Ctd>0.6995\u003C\u002Ftd> \u003Ctd>0.7965\u003C\u002Ftd> \u003Ctd>0.7824\u003C\u002Ftd> \u003Ctd>0.5993\u003C\u002Ftd> \u003Ctd>0.5777\u003C\u002Ftd> \u003Ctd>0.7950\u003C\u002Ftd> \u003Ctd>0.6826\u003C\u002Ftd> \u003Ctd>0.6923\u003C\u002Ftd> \u003Ctd>0.8453\u003C\u002Ftd> \u003Ctd>0.8094\u003C\u002Ftd> \u003Ctd>0.6452\u003C\u002Ftd> \u003Ctd>0.7096\u003C\u002Ftd> \u003Ctd>0.6190\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>Seedream-3.0\u003C\u002Ftd> \u003Ctd>❌\u003C\u002Ftd> \u003Ctd>0.8827\u003C\u002Ftd> \u003Ctd>0.8792\u003C\u002Ftd> \u003Ctd>0.9490\u003C\u002Ftd> \u003Ctd>0.9311\u003C\u002Ftd> \u003Ctd>0.8242\u003C\u002Ftd> \u003Ctd>0.8177\u003C\u002Ftd> \u003Ctd>0.9747\u003C\u002Ftd> \u003Ctd>0.9103\u003C\u002Ftd> \u003Ctd>0.8400\u003C\u002Ftd> \u003Ctd>0.9489\u003C\u002Ftd> \u003Ctd>0.8848\u003C\u002Ftd> \u003Ctd>0.7582\u003C\u002Ftd> \u003Ctd>0.8726\u003C\u002Ftd> \u003Ctd>0.7619\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>Qwen-Image\u003C\u002Ftd> \u003Ctd>✅\u003C\u002Ftd> \u003Ctd>0.8854\u003C\u002Ftd> \u003Ctd>0.8828\u003C\u002Ftd> \u003Ctd>0.9502\u003C\u002Ftd> \u003Ctd>0.9231\u003C\u002Ftd> \u003Ctd>0.8351\u003C\u002Ftd> \u003Ctd>0.8161\u003C\u002Ftd> \u003Ctd>0.9938\u003C\u002Ftd> \u003Ctd>0.9043\u003C\u002Ftd> \u003Ctd>0.8846\u003C\u002Ftd> \u003Ctd>0.9613\u003C\u002Ftd> \u003Ctd>0.8978\u003C\u002Ftd> \u003Ctd>0.7634\u003C\u002Ftd> \u003Ctd>0.8548\u003C\u002Ftd> \u003Ctd>0.8095\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>GPT-Image\u003C\u002Ftd>  \u003Ctd>❌\u003C\u002Ftd> \u003Ctd> 0.8952\u003C\u002Ftd> \u003Ctd>0.8929\u003C\u002Ftd> \u003Ctd>0.9448\u003C\u002Ftd> \u003Ctd>0.9289\u003C\u002Ftd> \u003Ctd>0.8655\u003C\u002Ftd> \u003Ctd>0.8445\u003C\u002Ftd> \u003Ctd>0.9494\u003C\u002Ftd> \u003Ctd>0.9283\u003C\u002Ftd> \u003Ctd>0.8800\u003C\u002Ftd> \u003Ctd>0.9432\u003C\u002Ftd> \u003Ctd>0.9017\u003C\u002Ftd> \u003Ctd>0.7253\u003C\u002Ftd> \u003Ctd>0.8582\u003C\u002Ftd> \u003Ctd>0.7143\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>\u003Cstrong>HunyuanImage 2.1\u003C\u002Fstrong>\u003C\u002Ftd> \u003Ctd>✅\u003C\u002Ftd> \u003Ctd>\u003Cstrong>0.8888\u003C\u002Fstrong>\u003C\u002Ftd> \u003Ctd>\u003Cstrong>0.8832\u003C\u002Fstrong>\u003C\u002Ftd> \u003Ctd>0.9339\u003C\u002Ftd> \u003Ctd>0.9341\u003C\u002Ftd> \u003Ctd>0.8363\u003C\u002Ftd> \u003Ctd>0.8342\u003C\u002Ftd> \u003Ctd>0.9627\u003C\u002Ftd> \u003Ctd>0.8870\u003C\u002Ftd> \u003Ctd>0.9615\u003C\u002Ftd> \u003Ctd>0.9448\u003C\u002Ftd> \u003Ctd>0.9254\u003C\u002Ftd> \u003Ctd>0.7527\u003C\u002Ftd> \u003Ctd>0.8689\u003C\u002Ftd> \u003Ctd>0.7619\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fp>\n\nFrom the SSAE evaluation results, our model has currently achieved the optimal performance among open-source models in terms of semantic alignment, and is very close to the performance of closed-source commercial models (GPT-Image).\n\n### GSB Evaluation\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_9d676d66074b.png\" width=70% alt=\"Human Evaluation with Other Models\">\n\u003C\u002Fp>\n\nWe adopted the GSB evaluation method commonly used to assess the relative performance between two models from an overall image perception perspective. In total, we utilized 1000 text prompts, generating an equal number of image samples for all compared models in a single run. For a fair comparison, we conducted inference only once for each prompt, avoiding any cherry-picking of results. When comparing with the baseline methods, we maintained the default settings for all selected models. The evaluation was performed by more than 100 professional evaluators.\nFrom the results, HunyuanImage 2.1 achieved a relative win rate of -1.36% against Seedream3.0 (closed-source) and 2.89% outperforming Qwen-Image (open-source). The GSB evaluation results demonstrate that HunyuanImage 2.1, as an open-source model, has reached a level of image generation quality comparable to closed-source commercial models (Seedream3.0), while showing certain advantages in comparison with similar open-source models (Qwen-Image). This fully validates the technical advancement and practical value of HunyuanImage 2.1 in text-to-image generation tasks.\n\n\n### Contact\nFeel free to join our Discord server or join our WeChat groups—not only to exchange ideas and explore collaboration, but also to ask any questions you might have. You're welcome to open an issue or submit a pull request on GitHub. Your feedback is valuable to us and helps drive HunyuanImage forward. Thank you for being a part of our community!\n\n\n## 🔗 BibTeX\n\nIf you find this project useful for your research and applications, please cite as:\n\n```BibTeX\n@misc{HunyuanImage-2.1,\n  title={HunyuanImage 2.1: An Efficient Diffusion Model for High-Resolution (2K) Text-to-Image Generation},\n  author={Tencent Hunyuan Team},\n  year={2025},\n  howpublished={\\url{https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1}},\n}\n```\n\n## Acknowledgements\n\nWe would like to thank the following open-source projects and communities for their contributions to open research and exploration: [Qwen](https:\u002F\u002Fhuggingface.co\u002FQwen), [FLUX](https:\u002F\u002Fgithub.com\u002Fblack-forest-labs\u002Fflux), [diffusers](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fdiffusers) and [HuggingFace](https:\u002F\u002Fhuggingface.co).\n\n## Github Star History\n\u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#Tencent-Hunyuan\u002FHunyuanImage-2.1&Date\">\n \u003Cpicture>\n   \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_690e23645023.png&theme=dark\" \u002F>\n   \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_690e23645023.png\" \u002F>\n   \u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_690e23645023.png\" \u002F>\n \u003C\u002Fpicture>\n\u003C\u002Fa>\n","[中文阅读](.\u002FREADME_CN.md)\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_3a7747850603.png\"  height=100>\n\u003C\u002Fp>\n\n\u003Cdiv align=\"center\">\n\n# HunyuanImage-2.1：用于高分辨率（2K）文生图的高效扩散模型​\n\n\u003C\u002Fdiv>\n\n\n\u003Cp align=\"center\"> &nbsp&nbsp🤗 \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Ftencent\u002FHunyuanImage-2.1\">HuggingFace\u003C\u002Fa>&nbsp&nbsp | \n💻 \u003Ca href=\"https:\u002F\u002Fhunyuan.tencent.com\u002FmodelSquare\u002Fhome\u002Fplay?modelId=286&from=\u002Fvisual\">官方网站（官网）试用我们的模型！\u003C\u002Fa>&nbsp&nbsp\n\u003C\u002Fp>\n\n\n\n\u003Cp align=\"center\">\n    👏 加入我们的\u003Ca href=\"assets\u002FWECHAT.md\" target=\"_blank\">微信\u003C\u002Fa>和\u003Ca href=\"https:\u002F\u002Fdiscord.com\u002Finvite\u002FdNBrdrGGMa\">Discord\u003C\u002Fa>\n\u003C\u002Fp>\n\n\n-----\n\n本仓库包含我们HunyuanImage-2.1的PyTorch模型定义、预训练权重以及推理\u002F采样代码。您可以在[官方网站（官网）](https:\u002F\u002Fhunyuan.tencent.com\u002FmodelSquare\u002Fhome\u002Fplay?modelId=286&from=\u002Fvisual)上\u003Cspan style=\"color:red\">**直接试用我们的模型**\u003C\u002Fspan>,并在我们的[项目页面](https:\u002F\u002Fhunyuan.tencent.com\u002Fimage\u002Fen?tabIndex=0)上找到更多可视化效果。\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_775580210737.jpg\" width=100% alt=\"HunyuanImage 2.1 Demo\">\n\u003C\u002Fdiv>\n\n## 🔥🔥🔥 最新动态\n- 2025年9月18日：✨ 试用[PromptEnhancer-32B模型](https:\u002F\u002Fhuggingface.co\u002FPromptEnhancer\u002FPromptEnhancer-32B)，获得更高质量的提示词增强！​。\n- 2025年9月18日：✨ [HunyuanImage-2.1的ComfyUI工作流](https:\u002F\u002Fgithub.com\u002FKimbingNg\u002FComfyUI-HunyuanImage2.1)现已可用！\n- 2025年9月16日：👑 我们在Arena的文生图开源模型排行榜上夺得第一名。[排行榜](https:\u002F\u002Fartificialanalysis.ai\u002Ftext-to-image\u002Farena\u002Fleaderboard-text)\n- 2025年9月12日：🚀 发布了FP8量化模型！现在仅需24GB显存即可生成2K图像！\n- 2025年9月8日：🚀 发布了HunyuanImage-2.1的推理代码和模型权重。\n\n## 简介\n我们非常高兴地推出**HunyuanImage-2.1**，这是一款170亿参数的文生图模型，能够生成**2K（2048 × 2048）分辨率**的图像。\n\n\u003C!-- 借助大规模数据集和多专家模型参与构建的结构化标题，我们显著提升了文本与图像的对齐能力。该模型采用具有(32 × 32)空间压缩比的高表达力VAE，大幅降低了计算成本。 -->\n\n我们的架构分为两个阶段：\n1. **基础文生图模型**：第一阶段是一个文生图模型，使用了两个文本编码器：一个多模态大语言模型（MLLM），用于提升图像与文本的对齐效果；另一个是多语言、字符感知编码器，用于增强多种语言下的文本渲染能力。\n2. **精修模型**：第二阶段引入了一个精修模型，进一步提升图像质量和清晰度，同时减少伪影。\n\n👑 我们在Arena的文生图开源模型排行榜上获得了**第一名**。\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_9a864444c52d.png\" width=70% alt=\"HunyuanImage 2.1 Demo\">\n\u003C\u002Fdiv>\n \n\n## 🎉 HunyuanImage-2.1 主要特性\n\n- **高质量生成**：高效生成超高清（2K）图像，构图极具电影感。\n- **多语言支持**：原生支持中文和英文提示词。\n- **先进架构**：基于多模态、单流与双流结合的DiT（扩散Transformer）骨干网络。\n- **字形感知处理**：利用ByT5的文本渲染能力，提升文本生成的准确性。\n- **灵活的宽高比**：支持多种图像宽高比（1:1、16:9、9:16、4:3、3:4、3:2、2:3）。\n- **提示词增强**：自动改写提示词，以提高描述准确性和视觉质量。\n\n\n\n\n\n## 📜 系统要求\n\n**硬件和操作系统要求：**\n- 支持CUDA的NVIDIA GPU。\n\n  **目前最低要求：** 生成2048×2048图像需24GB显存。\n  \n  > **注意：** 上述显存要求是在启用模型CPU卸载和FP8量化的情况下测得的。如果您的显存充足，可以关闭卸载以提升推理速度。\n- 支持的操作系统：Linux。\n\n\n## 🛠️ 依赖与安装\n\n1. 克隆仓库：\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1.git\ncd HunyuanImage-2.1\n```\n\n2. 安装依赖：\n```bash\npip install -r requirements.txt\npip install flash-attn==2.7.3 --no-build-isolation\n```\n\n## 🧱 下载预训练模型\n\n预训练模型的下载详情请见[此处](ckpts\u002Fcheckpoints-download.md)。\n\n## 🔑 使用方法\n\n### 提示词增强\n\n提示词增强在使我们的模型生成高质量图像方面起着**关键作用**。通过撰写更长、更详细的提示词，生成的图像将得到显著提升。我们鼓励您编写全面且富有描述性的提示词，以获得最佳的图像质量。\n\n我们强烈推荐您试用[PromptEnhancer-32B模型](https:\u002F\u002Fhuggingface.co\u002FPromptEnhancer\u002FPromptEnhancer-32B)，以获得更高质量的提示词增强效果。\n\n\n### 文生图\nHunyuanImage-2.1**仅支持2K**图像生成（例如，1:1图像为2048×2048，16:9图像为2560×1536等）。生成1K分辨率的图像会导致伪影。\n\n此外，我们**强烈建议**使用完整的生成流程以获得更好的质量（即启用提示词增强和精修）。\n\n\n| 模型类型               | 模型名称                | 描述                             | num_inference_steps | guidance_scale | shift |\n|--------------------------|---------------------------|-----------------------------------------|---------------------|----------------|-------|\n| 基础文生图模型 | hunyuanimage2.1           | 未蒸馏模型，用于获得最佳质量。 | 50                  | 3.5            | 5     |\n| 蒸馏文生图模型 | hunyuanimage2.1-distilled | 蒸馏模型，用于更快的推理    | 8                   | 3.25           | 4     |\n| 精修模型                 | hunyuanimage-refiner      | 精修模型                       | N\u002FA                 | N\u002FA            | N\u002FA   |\n\n\n```python\nimport os\nos.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True'\nimport torch\nfrom hyimage.diffusion.pipelines.hunyuanimage_pipeline import HunyuanImagePipeline\n\n# 支持的模型名称：hunyuanimage-v2.1，hunyuanimage-v2.1-distilled\nmodel_name = \"hunyuanimage-v2.1\"\npipe = HunyuanImagePipeline.from_pretrained(model_name=model_name，use_fp8=True)\npipe = pipe.to(\"cuda\")\n\n# 输入提示\nprompt = \"一只可爱、卡通风格的拟人企鹅毛绒玩具，有着蓬松柔软的毛发，正站在一间画室里，戴着一条红色针织围巾和一顶印有‘腾讯’二字的红色贝雷帽，神情专注地拿着画笔，正在绘制一幅蒙娜丽莎的油画，画面以写实的摄影风格呈现。\"\n\n\n# 使用不同宽高比生成图像\naspect_ratios = {\n    \"16:9\": (2560, 1536),\n    \"4:3\": (2304, 1792),\n    \"1:1\": (2048, 2048),\n    \"3:4\": (1792, 2304),\n    \"9:16\": (1536, 2560),\n}\n\nwidth, height = aspect_ratios[\"1:1\"]\n\nimage = pipe(\n    prompt=prompt,\n    width=width,\n    height=height,\n    # 如果已经使用提示增强功能来优化提示，则禁用重新提示\n    use_reprompt=False,  # 启用提示增强功能（可能会增加显存占用）\n    use_refiner=True,   # 启用精修模型\n    # 对于蒸馏模型，使用8步以加快推理速度。\n    # 对于非蒸馏模型，使用50步以获得更好的质量。\n    num_inference_steps=8 if \"distilled\" in model_name else 50, \n    guidance_scale=3.25 if \"distilled\" in model_name else 3.5,\n    shift=4 if \"distilled\" in model_name else 5,\n    seed=649151,\n)\n\nimage.save(\"generated_image.png\")\n```\n\n## 更多案例\n我们的模型能够遵循复杂的指令，生成高质量、富有创意的图像。\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_6d98286deece.jpg\" width=100% alt=\"HunyuanImage 2.1 演示\">\n\u003C\u002Fdiv>\n\n我们建议使用更长、更详细的提示词。您也可以尝试我们提供的提示词。\n\n\u003Cp align=\"center\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n    \u003Cth>序号\u003C\u002Fth>  \u003Cth>用户提示\u003C\u002Fth> \u003Cth>图像\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n    \u003Ctd>1\u003C\u002Ftd> \u003Ctd>一座宏伟教堂的内部，穹顶下方的中央矗立着一尊小巧的维纳斯雕像，微微侧对镜头。雕像没有双手，布满裂纹，表面若干古老的水泥片剥落，露出内部真人质感的牛奶肌肤。雕像穿着薄薄的白色婚纱，在雕像的身后，一只浮空水泥断手轻轻提起长长的婚纱拖尾；在雕像的头顶上方，另一只浮空水泥断手正为她戴上一个由白色花朵组成的花环，雕像本身是没有双手的。教堂穹顶上布满彩色玻璃窗，一束阳光从上往下照射到雕像上，形成丁达尔效应，光斑点点洒在雕像的脸庞和胸前。充满神性的光辉，背景微微虚化，物体的边缘模糊柔和。拉斐尔前派的梦幻朦胧美学风格。\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_bd7e81239c40.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>2\u003C\u002Ftd> \u003Ctd>一张超写实的照片，展示了一个水晶球立体模型，它坐落在柔软的森林苔藓之上，周围洒满了散射的阳光。模型内部精细地还原了一间腾讯会议室、一座会说话的聊天气泡雕塑，以及几只欢快的企鹅——其中一只戴着毕业帽，其余的则在踢足球并挥舞着小旗帜。水晶球的底座上用醒目的白色立体大字写着“腾讯”。背景柔和地虚化，充满焦外光斑效果，更加突出了球体中那些可爱而生动的细节。\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_121d0dfc9b48.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>3\u003C\u002Ftd> \u003Ctd>一位年迈意大利男士的特写肖像，他皮肤深深褶皱，眼神深邃而富有表现力，留着修剪整齐的白色小胡子。他的橄榄色肤色透露出岁月与阳光的痕迹，头戴一顶微微歪向一侧的平顶帽。他嘴角微扬，流露出温暖与智慧，手中端着一小杯浓缩咖啡。背景是柔和虚化的质朴石墙，上面爬满了常春藤，整体以写实的摄影风格呈现。\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_4014da80d47b.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>4\u003C\u002Ftd> \u003Ctd>一只打开的复古旅行箱，置于中性且光线柔和的背景之上。箱子由深棕色的旧皮革制成，表面可见明显的磨损和折痕，内衬则是深色的柔软织物。箱内精心打造了一幅中国微型景观，其中包括蜿蜒于模型山峦之间的长城、故宫的宝塔屋顶，以及兵马俑的缩影，这些元素与生机勃勃的绿色稻田交织在一起。箱子侧面还标注着“China”字样。整个场景沐浴在温暖而空灵的光线下，镜头晕影营造出梦幻般的氛围，亮点柔和而明亮。写实风格，纹理极其细腻，光影极具电影感。\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_2dc04155c6a4.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fp>\n\n为提升生成图像的质量和细节，我们使用了一个提示重写模型。该模型会自动增强用户提供的文本提示，添加详细且描述性的信息。\n\u003Cp align=\"center\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n    \u003Cth>序号\u003C\u002Fth>  \u003Cth>用户提示\u003C\u002Fth> \u003Cth>增强后的提示\u003C\u002Fth> \u003Cth>图像\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n    \u003Ctd>1\u003C\u002Ftd> \u003Ctd>塞伦盖蒂平原的野生动物海报。大眼睛的Q版探险家骑着友好的小狮子。“塞伦盖蒂：冒险的咆哮”采用奇幻风格字体。“梦想在此肆意奔腾”标语。温暖的黄色和柔和的棕色。\u003C\u002Ftd> \u003Ctd> 这是一张以塞伦盖蒂平原为主题的野生动物海报设计，画面中央是一位骑在小狮子背上的Q版探险家，背景则是起伏的山丘。构图顶部用大号、充满趣味的装饰性卷曲字母写着标题“塞伦盖蒂：冒险的咆哮”。主体场景中，一位大头小身的Q版探险家戴着绿色的探险帽，背着背包，双手抓住小狮子的鬃毛，面带惊喜地向前望去。小狮子则有着浅棕色的鬃毛和微笑的表情，正迈步向前，身体以温暖的橙色为主色调。背景部分描绘了塞伦盖蒂平原的连绵丘陵与稀树草原，整体色调为温暖的黄色和柔和的棕色。主图下方用较小而优雅的字体写着标语“梦想在此肆意奔腾”。整幅作品呈现出一种将可爱Q版插画风格与俏皮奇幻字体相结合的海报设计感。\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_458df54b23d2.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>2\u003C\u002Ftd> \u003Ctd>纽约市活力四射的海报。动漫风格的女商人正在路边招手拦出租车，周围是摩天大楼和时代广场的广告牌。“纽约：璀璨抱负”采用都市涂鸦字体。“成就每一个梦想”标语。饱和的黄色、红色和鲜明的蓝色。\u003C\u002Ftd> \u003Ctd>这是一张充满活力的纽约市海报，画面中央是一位正在招手拦出租车的动漫风格女商人。她有着大而富有表现力的眼睛，一头黑色短发，身穿带有动感线条的职业蓝色西装套装，站在繁忙的街道上，双臂伸展呼唤一辆迎面驶来的经典黄色出租车。背景中，高耸入云的摩天大楼拥有流畅的动漫风格建筑造型，上面布满了时代广场标志性的鲜艳发光广告牌和霓虹灯招牌。海报顶部用大型、风格化的都市涂鸦字体写着“纽约：璀璨抱负”，边缘仿佛喷漆效果一般。在这句主标题下方，用较小而简洁的字体写着标语“成就每一个梦想”。整个画面运用了饱和度极高的色彩，以明亮的黄色、红色和锐利的蓝色为主调。整体呈现出动漫插画与平面设计相融合的效果。\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_c20d2afdbe3c.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>3\u003C\u002Ftd> \u003Ctd>一幅艺术工作室人像，捕捉到一位高级时装模特极具冲击力的动态姿势。她的脸庞宛如一块前卫妆容的画布，以大胆的几何形状和原色点缀。她身着一件雕塑感十足的非常规服装，强调干净利落的线条与形态。现场由戏剧性的灯光照明，形成强烈的明暗对比，使她的面部特征在抽象模糊的彩色背景中格外突出。照片以写实风格呈现。\u003C\u002Ftd> \u003Ctd> 一幅艺术工作室人像，拍摄了一位高级时装模特极具冲击力的动态姿势，她身体扭转，一只手臂高高举起，展现出力量与动感。她的脸部成为前卫妆容的画布，以大胆的几何图形和原色进行创作：额头处绘有鲜艳的黄色三角形，眼窝周围则用电光蓝线条勾勒。她身着一件由硬挺哑光白色面料制成的雕塑感十足的非常规服装，不对称的衣片环绕躯干，凸显出干净利落的线条与形态。摄影师使用了戏剧性的灯光效果，侧方强光投下清晰的阴影，将她的面部轮廓与身体曲线从紫色和橙色交织的抽象模糊背景中凸显出来，营造出散景般的视觉效果。照片以写实风格呈现。\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_f85798ed2b7c.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>4\u003C\u002Ftd> \u003Ctd>一位厨师的环境肖像，定格在他专注神情的繁忙厨房之中。他手中握着厨具，目光牢牢锁定在工作上，尽显热情与创造力。背景则是一片流动的模糊影像，不锈钢操作台等元素若隐若现，在温暖的环境光映衬下显得格外柔和。照片以写实风格呈现。\u003C\u002Ftd> \u003Ctd> 一张男性厨师在繁忙厨房中工作的环境肖像。作为画面主体，厨师自胸部以上被拍摄，他眉头紧锁，目光低垂，专注地看着手中的厨具。他身着白色厨师服和传统厨师帽，脸上和衣服上还沾着些许面粉。他的手中握着一把巨大的厨师刀和一把金属铲，似乎正准备在看不见的烹饪台上施展厨艺。背景则是一片动态模糊的影像，不锈钢操作台、锅具等厨房设备的轮廓若隐若现，暗示着这里一片忙碌的景象。头顶暖光灯散发出金色光芒，为厨师的制服和工具镀上一层光晕。照片采用写实风格，通过浅景深突出主体，同时传达出厨房内的活力与创意。\u003C\u002Ftd> \u003Ctd>\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_71eaa0c693ba.png\" width=100%>\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fp>\n\n\u003C!-- \u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_bfba4f227c8b.jpg\" width=100% alt=\"与其他模型的人工评估\">\n\u003C\u002Fp> -->\n\n\n\n\n\n## 📈 对比\n\n### SSAE 评估\nSSAE（结构化语义对齐评估）是一种基于先进多模态大语言模型（MLLM）的智能图像-文本对齐评估指标。我们提取了12个类别下的3500个关键点，然后利用多模态大语言模型，通过比较生成的图像与这些关键点，并根据图像的视觉内容进行自动评估和打分。平均图像准确率表示所有关键点上的逐张图像平均得分，而全局准确率则直接计算所有关键点的平均得分。\n\u003Cp align=\"center\">\n\u003Ctable>\n\u003Cthead>\n\u003Ctr>\n    \u003Cth rowspan=\"2\">模型\u003C\u002Fth>  \u003Cth rowspan=\"2\">开源\u003C\u002Fth> \u003Cth rowspan=\"2\">平均图像准确率\u003C\u002Fth> \u003Cth rowspan=\"2\">全局准确率\u003C\u002Fth> \u003Cth colspan=\"4\" style=\"text-align: center;\">主要主体\u003C\u002Fth> \u003Cth colspan=\"3\" style=\"text-align: center;\">次要主体\u003C\u002Fth> \u003Cth colspan=\"2\" style=\"text-align: center;\">场景\u003C\u002Fth> \u003Cth colspan=\"3\" style=\"text-align: center;\">其他\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Cth>名词\u003C\u002Fth> \u003Cth>关键属性\u003C\u002Fth> \u003Cth>其他属性\u003C\u002Fth> \u003Cth>动作\u003C\u002Fth> \u003Cth>名词\u003C\u002Fth> \u003Cth>属性\u003C\u002Fth> \u003Cth>动作\u003C\u002Fth> \u003Cth>名词\u003C\u002Fth> \u003Cth>属性\u003C\u002Fth> \u003Cth>镜头\u003C\u002Fth> \u003Cth>风格\u003C\u002Fth> \u003Cth>构图\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\n    \u003Ctd>FLUX-dev\u003C\u002Ftd> \u003Ctd>✅\u003C\u002Ftd> \u003Ctd>0.7122\u003C\u002Ftd> \u003Ctd>0.6995\u003C\u002Ftd> \u003Ctd>0.7965\u003C\u002Ftd> \u003Ctd>0.7824\u003C\u002Ftd> \u003Ctd>0.5993\u003C\u002Ftd> \u003Ctd>0.5777\u003C\u002Ftd> \u003Ctd>0.7950\u003C\u002Ftd> \u003Ctd>0.6826\u003C\u002Ftd> \u003Ctd>0.6923\u003C\u002Ftd> \u003Ctd>0.8453\u003C\u002Ftd> \u003Ctd>0.8094\u003C\u002Ftd> \u003Ctd>0.6452\u003C\u002Ftd> \u003Ctd>0.7096\u003C\u002Ftd> \u003Ctd>0.6190\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>Seedream-3.0\u003C\u002Ftd> \u003Ctd>❌\u003C\u002Ftd> \u003Ctd>0.8827\u003C\u002Ftd> \u003Ctd>0.8792\u003C\u002Ftd> \u003Ctd>0.9490\u003C\u002Ftd> \u003Ctd>0.9311\u003C\u002Ftd> \u003Ctd>0.8242\u003C\u002Ftd> \u003Ctd>0.8177\u003C\u002Ftd> \u003Ctd>0.9747\u003C\u002Ftd> \u003Ctd>0.9103\u003C\u002Ftd> \u003Ctd>0.8400\u003C\u002Ftd> \u003Ctd>0.9489\u003C\u002Ftd> \u003Ctd>0.8848\u003C\u002Ftd> \u003Ctd>0.7582\u003C\u002Ftd> \u003Ctd>0.8726\u003C\u002Ftd> \u003Ctd>0.7619\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>Qwen-Image\u003C\u002Ftd> \u003Ctd>✅\u003C\u002Ftd> \u003Ctd>0.8854\u003C\u002Ftd> \u003Ctd>0.8828\u003C\u002Ftd> \u003Ctd>0.9502\u003C\u002Ftd> \u003Ctd>0.9231\u003C\u002Ftd> \u003Ctd>0.8351\u003C\u002Ftd> \u003Ctd>0.8161\u003C\u002Ftd> \u003Ctd>0.9938\u003C\u002Ftd> \u003Ctd>0.9043\u003C\u002Ftd> \u003Ctd>0.8846\u003C\u002Ftd> \u003Ctd>0.9613\u003C\u002Ftd> \u003Ctd>0.8978\u003C\u002Ftd> \u003Ctd>0.7634\u003C\u002Ftd> \u003Ctd>0.8548\u003C\u002Ftd> \u003Ctd>0.8095\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>GPT-Image\u003C\u002Ftd>  \u003Ctd>❌\u003C\u002Ftd> \u003Ctd> 0.8952\u003C\u002Ftd> \u003Ctd>0.8929\u003C\u002Ftd> \u003Ctd>0.9448\u003C\u002Ftd> \u003Ctd>0.9289\u003C\u002Ftd> \u003Ctd>0.8655\u003C\u002Ftd> \u003Ctd>0.8445\u003C\u002Ftd> \u003Ctd>0.9494\u003C\u002Ftd> \u003Ctd>0.9283\u003C\u002Ftd> \u003Ctd>0.8800\u003C\u002Ftd> \u003Ctd>0.9432\u003C\u002Ftd> \u003Ctd>0.9017\u003C\u002Ftd> \u003Ctd>0.7253\u003C\u002Ftd> \u003Ctd>0.8582\u003C\u002Ftd> \u003Ctd>0.7143\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n    \u003Ctd>\u003Cstrong>HunyuanImage 2.1\u003C\u002Fstrong>\u003C\u002Ftd> \u003Ctd>✅\u003C\u002Ftd> \u003Ctd>\u003Cstrong>0.8888\u003C\u002Fstrong>\u003C\u002Ftd> \u003Ctd>\u003Cstrong>0.8832\u003C\u002Fstrong>\u003C\u002Ftd> \u003Ctd>0.9339\u003C\u002Ftd> \u003Ctd>0.9341\u003C\u002Ftd> \u003Ctd>0.8363\u003C\u002Ftd> \u003Ctd>0.8342\u003C\u002Ftd> \u003Ctd>0.9627\u003C\u002Ftd> \u003Ctd>0.8870\u003C\u002Ftd> \u003Ctd>0.9615\u003C\u002Ftd> \u003Ctd>0.9448\u003C\u002Ftd> \u003Ctd>0.9254\u003C\u002Ftd> \u003Ctd>0.7527\u003C\u002Ftd> \u003Ctd>0.8689\u003C\u002Ftd> \u003Ctd>0.7619\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003C\u002Fp>\n\n从SSAE评估结果来看，我们的模型目前在语义对齐方面已达到开源模型中的最优水平，且与闭源商用模型（GPT-Image）的表现非常接近。\n\n### GSB 评估\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_9d676d66074b.png\" width=70% alt=\"与其他模型的人工评估\">\n\u003C\u002Fp>\n\n我们采用了GSB评估方法，该方法常用于从整体图像感知的角度评估两个模型之间的相对性能。总共使用了1000个文本提示，在一次运行中为所有对比模型生成了相同数量的图像样本。为了公平比较，我们对每个提示仅进行一次推理，避免挑选最佳结果。与基线方法比较时，我们保持所有选定模型的默认设置不变。评估由超过100名专业评估员完成。\n结果显示，HunyuanImage 2.1相对于Seedream3.0（闭源）的相对胜率为-1.36%，而优于Qwen-Image（开源）2.89%。GSB评估结果表明，作为一款开源模型，HunyuanImage 2.1的图像生成质量已达到与闭源商用模型（Seedream3.0）相当的水平，同时在与同类开源模型（Qwen-Image）的比较中展现出一定优势。这充分验证了HunyuanImage 2.1在文生图任务中的技术先进性和实际价值。\n\n\n### 联系方式\n欢迎加入我们的Discord服务器或微信交流群——不仅可交流想法、探讨合作，还可提出任何疑问。您也可以在GitHub上提交问题或拉取请求。您的反馈对我们至关重要，将推动HunyuanImage不断向前发展。感谢您成为我们社区的一员！\n\n\n## 🔗 BibTeX\n如果您发现本项目对您的研究和应用有所帮助，请引用如下：\n\n```BibTeX\n@misc{HunyuanImage-2.1,\n  title={HunyuanImage 2.1: 高分辨率（2K）文生图的高效扩散模型},\n  author={腾讯混元团队},\n  year={2025},\n  howpublished={\\url{https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1}},\n}\n```\n\n## 致谢\n我们衷心感谢以下开源项目和社区为开放研究与探索所作出的贡献：[Qwen](https:\u002F\u002Fhuggingface.co\u002FQwen)、[FLUX](https:\u002F\u002Fgithub.com\u002Fblack-forest-labs\u002Fflux)、[diffusers](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fdiffusers)以及[HuggingFace](https:\u002F\u002Fhuggingface.co)。\n\n## GitHub 星标历史\n\u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#Tencent-Hunyuan\u002FHunyuanImage-2.1&Date\">\n \u003Cpicture>\n   \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_690e23645023.png&theme=dark\" \u002F>\n   \u003Csource media=\"(prefers-color-scheme: light)\" srcset=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_690e23645023.png\" \u002F>\n   \u003Cimg alt=\"星标历史图表\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_readme_690e23645023.png\" \u002F>\n \u003C\u002Fpicture>\n\u003C\u002Fa>","# HunyuanImage-2.1 快速上手指南\n\nHunyuanImage-2.1 是腾讯混元团队开源的高效扩散模型，支持生成高达 **2K (2048×2048)** 分辨率的高质量图像。该模型原生支持中英文提示词，具备优秀的图文对齐能力和细节渲染能力。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux\n- **GPU**: 支持 CUDA 的 NVIDIA 显卡\n- **显存要求**: \n  - 最低 **24 GB** 显存（需开启 FP8 量化和 CPU Offloading）可生成 2K 图像。\n  - 若显存充足，可关闭 Offloading 以提升推理速度。\n\n### 前置依赖\n- Python 3.8+\n- PyTorch (支持 CUDA)\n- Git\n\n## 安装步骤\n\n### 1. 克隆仓库\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1.git\ncd HunyuanImage-2.1\n```\n\n### 2. 安装依赖\n建议先配置国内 pip 镜像源以加速下载：\n```bash\npip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\npip install flash-attn==2.7.3 --no-build-isolation -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n> **注意**: `flash-attn` 需要编译环境，请确保已安装对应的 CUDA Toolkit 和 C++ 编译器。\n\n### 3. 下载预训练模型\n模型权重文件较大，请参考官方文档 [ckpts\u002Fcheckpoints-download.md](ckpts\u002Fcheckpoints-download.md) 下载权重文件至本地指定目录。\n主要包含以下模型：\n- `hunyuanimage-v2.1`: 基础模型（50 步，画质最佳）\n- `hunyuanimage-v2.1-distilled`: 蒸馏模型（8 步，推理更快）\n- `hunyuanimage-refiner`: 精修模型（用于提升细节）\n\n## 基本使用\n\n以下是最小化的 Python 推理示例。代码默认启用 **FP8 量化** 以节省显存，并自动加载精修模型以获得最佳效果。\n\n```python\nimport os\n# 设置 PyTorch CUDA 内存分配策略，防止显存碎片化\nos.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True'\n\nimport torch\nfrom hyimage.diffusion.pipelines.hunyuanimage_pipeline import HunyuanImagePipeline\n\n# 选择模型名称：\"hunyuanimage-v2.1\" (高质量) 或 \"hunyuanimage-v2.1-distilled\" (快速)\nmodel_name = \"hunyuanimage-v2.1\"\n\n# 初始化管道，use_fp8=True 可在 24GB 显存下运行 2K 生成\npipe = HunyuanImagePipeline.from_pretrained(model_name=model_name, use_fp8=True)\npipe = pipe.to(\"cuda\")\n\n# 输入提示词 (支持中文或英文，建议描述详细)\nprompt = \"一只可爱的卡通风格拟人企鹅毛绒玩具，毛茸茸的，站在绘画工作室里，戴着红色针织围巾和一顶写有'Tencent'字样的红色贝雷帽，手持画笔，表情专注地绘制蒙娜丽莎的油画，照片级写实风格。\"\n\n# 设置分辨率 (2K 规格)\n# 支持比例：1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3\naspect_ratios = {\n    \"1:1\": (2048, 2048),\n    \"16:9\": (2560, 1536),\n    \"9:16\": (1536, 2560),\n}\nwidth, height = aspect_ratios[\"1:1\"]\n\n# 执行生成\nimage = pipe(\n    prompt=prompt,\n    width=width,\n    height=height,\n    use_reprompt=False,  # 若已手动优化提示词可设为 False，否则设为 True 启用自动改写\n    use_refiner=True,    # 启用精修模型以提升画质\n    # 根据模型类型调整步数和参数\n    num_inference_steps=8 if \"distilled\" in model_name else 50, \n    guidance_scale=3.25 if \"distilled\" in model_name else 3.5,\n    shift=4 if \"distilled\" in model_name else 5,\n    seed=649151,         # 固定随机种子以保证结果可复现\n)\n\n# 保存图像\nimage.save(\"generated_image.png\")\nprint(\"图像生成完毕：generated_image.png\")\n```\n\n### 使用建议\n1. **提示词优化**: 模型对长且详细的提示词响应更好。如需更佳效果，可结合 [PromptEnhancer-32B](https:\u002F\u002Fhuggingface.co\u002FPromptEnhancer\u002FPromptEnhancer-32B) 模型先对提示词进行扩充。\n2. **分辨率限制**: 请严格使用 **2K 级别** 的分辨率（如 2048x2048）。尝试生成 1K 分辨率图像可能会导致画面伪影。\n3. **显存优化**: 如遇显存不足（OOM），请确保 `use_fp8=True` 已开启，并检查系统是否支持 CPU Offloading。","某电商设计团队需要在短时间内为“中秋国潮”营销活动生成一系列高分辨率、包含精准中文书法字体的宣传海报。\n\n### 没有 HunyuanImage-2.1 时\n- **分辨率受限严重**：生成的图片通常仅为 1024×1024，放大后细节模糊，无法满足线下大屏或高清印刷的 2K 需求，后期需耗费大量时间进行超分修复。\n- **中文文字渲染失败**：主流模型对汉字理解能力弱，海报中的“月圆人团圆”等标语常出现笔画缺失、乱码或完全无法生成的情况。\n- **多物体控制力差**：当提示词包含“玉兔、月饼、灯笼”等多个特定元素时，画面容易出现物体融合、数量错误或位置混乱。\n- **跨语言理解偏差**：设计师使用中文描述复杂的国潮风格时，模型往往误解语义，导致生成的画面风格与预期大相径庭。\n\n### 使用 HunyuanImage-2.1 后\n- **原生 2K 高清直出**：直接生成 2048×2048 分辨率图像，画面纹理清晰、构图电影级精致，无需后期超分即可投入印刷和使用。\n- **精准汉字呈现**：依托 ByT5 字符感知编码器和 MLLM 架构，海报中的中文书法字体笔画准确、风格统一，完美还原设计意图。\n- **复杂场景精准掌控**：能够准确区分并布局多个独立物体，玉兔的姿态、月饼的纹样及灯笼的光影均能按提示词精确呈现，无奇怪伪影。\n- **原生中文语义对齐**：直接使用中文提示词即可精准捕捉“国潮”、“水墨”等风格特征，大幅降低了编写和翻译提示词的沟通成本。\n\nHunyuanImage-2.1 通过原生支持 2K 分辨率与高精度中文渲染，将电商海报的创作周期从“天”级缩短至“分钟”级，真正实现了创意到成品的无缝落地。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FTencent-Hunyuan_HunyuanImage-2.1_3a774785.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",[82],{"name":83,"color":84,"percentage":85},"Python","#3572A5",100,672,55,"2026-03-26T01:11:05","NOASSERTION","Linux","必需 NVIDIA GPU (支持 CUDA)。生成 2K (2048x2048) 图像最低需 24GB 显存（需开启模型 CPU 卸载和 FP8 量化）；若显存充足可关闭卸载以提升速度。","未说明",{"notes":94,"python":92,"dependencies":95},"1. 该模型仅支持生成 2K 分辨率图像（如 2048x2048），生成 1K 图像会导致伪影。\n2. 强烈建议使用完整的生成流程（包含提示词增强 Prompt Enhancement 和精修模型 Refiner）以获得最佳质量。\n3. 提供了非蒸馏模型（50 步，高质量）和蒸馏模型（8 步，快速推理）两种选择。\n4. 支持多种宽高比（1:1, 16:9, 9:16 等）。\n5. 推荐使用 PromptEnhancer-32B 模型来优化提示词。",[96,97],"torch","flash-attn==2.7.3",[14,26],[100,101,102,103,104],"diffusion-models","diffusion-transformer","image-generation","text-to-image","aigc","2026-03-27T02:49:30.150509","2026-04-06T07:12:38.193878",[108,113,118,123,128,133],{"id":109,"question_zh":110,"answer_zh":111,"source_url":112},18255,"启用 use_refiner=True 时遇到 \"CUDA error: an illegal memory access\" 错误怎么办？","这通常是显存不足（GPU OOM）导致的。可以通过以下两种方法解决：\n1. 使用 fp8 量化模型（请参考 README 中的使用说明）。\n2. 开启 Refiner VAE 的分块处理（tiling），在代码中设置 `self.use_spatial_tiling = True`。\n参考代码位置：hyimage\u002Fmodels\u002Fvae\u002Frefiner_vae.py 第 657 行附近。","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1\u002Fissues\u002F9",{"id":114,"question_zh":115,"answer_zh":116,"source_url":117},18256,"Refiner 流水线导致显存无法释放或占用过高，如何解决？","如果您的显存充足（例如 96GB 或更高），可以在初始化 Pipeline 时将所有 offloading（卸载）选项设置为 `False` 以禁用显存卸载，从而避免频繁的内存分配释放问题或提升性能。代码如下：\n```python\npipe = HunyuanImagePipeline.from_pretrained(\n    model_name=model_name, torch_dtype='bf16',\n    enable_stage1_offloading=False,\n    enable_reprompt_model_offloading=False,\n    enable_refiner_offloading=False,\n    enable_text_encoder_offloading=False,\n    enable_full_dit_offloading=False,\n    enable_vae_offloading=False,\n    enable_byt5_offloading=False\n)\n```","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1\u002Fissues\u002F17",{"id":119,"question_zh":120,"answer_zh":121,"source_url":122},18257,"在 H100 (80GB) 等大显存显卡上运行带 Refiner 的模型时被系统 \"Killed\" 是什么原因？","\"Killed\" 通常意味着系统物理内存（RAM）耗尽，而不仅仅是显存（VRAM）不足。生成高分辨率图像（如 2048x2048）并启用 Refiner 时，除了需要大显存外，还需要大量的系统内存。\n建议解决方案：\n1. 增加系统物理内存。\n2. 设置较大的虚拟内存（Swap），建议配置 200GB 以上的物理内存 + 100GB 的虚拟内存。","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1\u002Fissues\u002F22",{"id":124,"question_zh":125,"answer_zh":126,"source_url":127},18258,"哪里可以找到完整的 ComfyUI 工作流以实现官网效果的出图？","社区已提供最新的代码和工作流实现，可以尝试使用以下仓库：https:\u002F\u002Fgithub.com\u002FKimbingNg\u002FComfyUI-HunyuanImage2.1。\n注意：由于底层代码仍在更新，工作流可能需要随之调整。如果生成的图片效果不佳，请检查是否使用了与当前代码版本匹配的正确设置。","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1\u002Fissues\u002F41",{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},18259,"本地运行的蒸馏版或开源版模型效果不如官网 Demo，甚至出现画面发灰、崩坏，如何优化？","本地效果差异通常由参数配置不当引起。官方建议：\n1. 确保使用推荐的优化配置参数，不要随意更改。\n2. 尝试启用提示词增强（Prompt Enhancement）和 Refiner（精炼器）模块，这对提升成图质量至关重要。\n3. 如果可能，分享您的提示词、参数和随机种子以便进一步排查是否是特定组合导致的问题。","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1\u002Fissues\u002F26",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},18260,"生成 1K 分辨率图片时质量差、人脸缺损且速度慢，有什么解决办法？","目前模型针对 2K 及以上分辨率进行了优化，1K 分辨率下的表现可能未达最佳状态且速度较慢。\n1. 建议直接尝试生成 2K 分辨率图片以获得更好的细节和质量。\n2. 如果使用 GGUF 量化版本，速度会有显著提升（例如 20 步约 2 分钟可出 2K 图）。\n3. 关注后续版本更新，官方正在开发支持实时性能和更优 1K 效果的 HunyuanImage 2.0 及加速 LoRA。","https:\u002F\u002Fgithub.com\u002FTencent-Hunyuan\u002FHunyuanImage-2.1\u002Fissues\u002F3",[]]