Archive of AI

Source Snapshot / 2024-05-14-hunyuan-dit-open-source-2

Tencent/HunyuanDiT

Linked event: 2024-05-14 · Tencent Hunyuan Open-Sources Native Bilingual Chinese-English Diffusion Transformer Text-to-Image Model Hunyuan-DiT

Publisher
GitHub
Archived
2026-11-23
Capture Method
Direct page capture
HTTP / SHA-256
200 / 705d2a9584d30fd9
Original URL
Open source ↗
Wayback Backup
Not archived
This page preserves a plain-text static snapshot against link rot. When citing figures, tables, or full legal terms, verify against the original URL and Wayback Machine archive.

[来源关键摘录] Hunyuan-DiT 官方开源代码仓库,提供模型推理脚本、LoRA 微调工具与社区生态集成说明。

[正文前段节选] Skip to content

Navigation Menu

Appearance settings

You signed in with another tab or window. Reload to refresh your session.

You signed out in another tab or window. Reload to refresh your session.

You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

Repository navigation

NotificationsYou must be signed in to change notification settings

Fork367 (367)

Star4.3k (4.3k)You must be signed in to star a repository

Hunyuan-DiT : A Powerful Multi-Resolution Diffusion Transformer with Fine-Grained Chinese Understanding

dit.hunyuan.tencent.com/

Custom properties

Report repository

BranchesTags

Open more actions menu

Latest commit

Folders and files

Last commit message

Last commit date

.github/ISSUE_TEMPLATE

dataset/yamls

kohya_ss-hydit

environment.yml

example_prompts.txt

requirements.txt

sample_controlnet.py

sample_ipadapter.py

sample_t2i.py

View all files

Repository files navigation

This repo contains PyTorch model definitions, pre-trained weights and inference/sampling code for our paper exploring Hunyuan-DiT. You can find more visualizations on our project page.

Hunyuan-DiT: A Powerful Multi-Resolution Diffusion Transformer with Fine-Grained Chinese Understanding

DialogGen: Multi-modal Interactive Dialogue System for Multi-turn Text-to-Image Generation

Dec 17, 2024: 🎉 Optimize Lora training with refined grad checkpoint and low-bit optimizer. Just use --lowbit-opt to get started.

Sep 13, 2024: 🎉 IPAdapter is officially supported by HunYuanDiT. Document for it: ./ipadapter. And scaled attention is utilized to replace flash attention on V100 GPUs.

Aug 26, 2024, 🎉 HunYuanDIT Controlnet and LoRA are officially supported by ComfyUI. Document for it: ./comfyui

Jul 15, 2024: 🚀 HunYuanDiT and Shakker.Ai have jointly launched a fine-tuning event based on the HunYuanDiT 1.2 model. By publishing a lora or fine-tuned model based on HunYuanDiT, you can earn up to $230 bonus from Shakker.Ai. See Shakker.Ai for more details.

Jul 15, 2024: 🎉 Update ComfyUI to support standardized workflows and compatibility with weights from t2i module and Lora training for versions 1.1/1.2, as well as those trained by Kohya or the official script.

Jul 15, 2024: ⚡ We offer Docker environments for CUDA 11/12, allowing you to bypass complex installations and play with a single click! See dockers for details.

Jul 08, 2024: 🎉 HYDiT-v1.2 version is released. Please check HunyuanDiT-v1.2 and Distillation-v1.2 for more details.

Jul 03, 2024: 🎉 Kohya-hydit version now available for v1.1 and v1.2 models, with GUI for inference. Official Kohya version is under review. See kohya for details.

Jun 27, 2024: 🎨 Hunyuan-Captioner is released, providing fine-grained caption for training data. See mllm for details.

Jun 27, 2024: 🎉 Support LoRa and ControlNet in diffusers. See diffusers for details.

Jun 27, 2024: 🎉 6GB GPU VRAM Inference scripts are released. See lite for details.

Jun 19, 2024: 🎉 ControlNet is released, supporting canny, pose and depth control. See training/inference codes for details.

Jun 13, 2024: ⚡ HYDiT-v1.1 version is released, which mitigates the issue of image oversaturation and alleviates the watermark issue. Please check HunyuanDiT-v1.1 and

Distillation-v1.1 for more details.

Jun 13, 2024: 🚚 The training code is released, offering full-parameter training and LoRA training.

Jun 06, 2024: 🎉 Hunyuan-DiT is now available in ComfyUI. Please check ComfyUI for more details.

Jun 06, 2024: 🚀 We introduce Distillation version for Hunyuan-DiT acceleration, which achieves 50% acceleration on NVIDIA GPUs. Please check Distillation for more details.

Jun 05, 2024: 🤗 Hunyuan-DiT is now available in 🤗 Diffusers! Please check the example below.

Jun 04, 2024: 🌐 Support Tencent Cloud links to download the pretrained models! Please check the links below.

May 22, 2024: 🚀 We introduce TensorRT version for Hunyuan-DiT acceleration, which achieves 47% acceleration on NVIDIA GPUs. Please check TensorRT-libs for instructions.

May 22, 2024: 💬 We support demo running multi-turn text2image generation now. Please check the script below.

🤖 Try it on the web

Welcome to our web-based Tencent Hunyuan Bot, where you can explore our innovative products! Just input the suggested prompts below or any other imaginative prompts containing drawing-related keywords to activate the Hunyuan text-to-image generation feature. Unleash your creativity and create any picture you desire, all for free!

You can use simple prompts similar to natural language text

draw a pig in a suit

生成一幅画,赛博朋克风,跑车

generate a painting, cyberpunk style, sports car

or multi-turn language interactions to create the picture.

draw a wooden bird

turn into glass

🤗 Community Contribution Leaderboard

By @TTPlanetPig

HunyuanDIT_v1.2 ControlNet models

Inpaint controlnet: https://huggingface.co/TTPlanet/HunyuanDiT_Controlnet_inpainting

Tile controlnet: https://huggingface.co/TTPlanet/HunyuanDiT_Controlnet_tile

Lineart controlnet: https://huggingface.co/TTPlanet/HunyuanDiT_Controlnet_lineart

HunyuanDIT_v1.2 ComfyUI nodes

Comfyui_TTP_CN_Preprocessor: https://github.com/TTPlanetPig/Comfyui_TTP_CN_Preprocessor

Comfyui_TTP_Toolset: https://github.com/TTPlanetPig/Comfyui_TTP_Toolset

By @sdbds (bilibili up 青龙圣者)

Kohya_ss-hydit train tools: https://github.com/zml-ai/HunyuanDIT-PRE/tree/main/kohya_ss-hydit

By @CrazyBoyM (bilibili up 飞鸟白菜)

ComfyUI support for HunyuanDIT_v1.2 Controlnet: Comfy-Org/ComfyUI#4245

HunyuanDIT_v1.2 base model for anime

Original hf: https://huggingface.co/Laxhar/Freeway_Animation_HunYuan_Demo

Converted ComfyUI model: https://huggingface.co/comfyanonymous/Freeway_Animation_Hunyuan_Demo_ComfyUI_Converted

📑 Open-source Plan

Hunyuan-DiT (Text-to-Image Model)

Distillation Version

TensorRT Version

Controlnet (Pose, Canny, Depth)

6GB GPU VRAM Inference

Hunyuan-DiT-S checkpoints (0.7B model)

Hunyuan-Captioner (Re-caption the raw image-text pairs)

Hunyuan-DialogGen (Prompt Enhancement Model)

Web Demo (Gradio)

Multi-turn T2I Demo (Gradio)

🎉 Hunyuan-DiT Key Features

Chinese-English Bilingual DiT Architecture

Multi-turn Text2Image Generation

📈 Comparisons

🎥 Visualization

📜 Requirements

🛠️ Dependencies and Installation

Installation Guide for Linux

🧱 Download Pretrained Models

- 1. Using HF-Mirror

- 2. Resume Download

Data Preparation

Full-parameter Training

Using Gradio

Using 🤗 Diffusers

Using Command Line

More Configurations

Using ComfyUI

Using Previous versions

🎨 Hunyuan-Captioner

Instructions

🚀 Acceleration (for Linux)

Start History

We present Hunyuan-DiT, a text-to-image diffusion transformer with fine-grained understanding of both English and Chinese. To construct Hunyuan-DiT, we carefully designed the transformer structure, text encoder, and positional encoding. We also build from scratch a whole data pipeline to update and evaluate data for iterative model optimization. For fine-grained language understanding, we train a Multimodal Large Language Model to refine the captions of the images. Finally, Hunyuan-DiT can perform multi-round multi-modal dialogue with users, generating and refining images according to the context.

Through our carefully designed holistic human evaluation protocol with more than 50 professional human evaluators, Hunyuan-DiT sets a new state-of-the-art in Chinese-to-image generation compared with other open-source models.

Hunyuan-DiT is a diffusion model in the latent space, as depicted in figure below. Following the Latent Diffusion Model, we use a pre-trained Variational Autoencoder (VAE) to compress the images into low-dimensional latent spaces and train a diffusion model to learn the data distribution with diffusion models. Our diffusion model is parameterized with a transformer. To encode the text prompts, we leverage a combination of pre-trained bilingual (English and Chinese) CLIP and multilingual T5 encoder.

[...内容已截断,完整版请查看原文或 Wayback 快照]