# hunyuan-dit > A high-performance implementation of the HunyuanDiT model for text-to-image generation. > This project provides an environment setup, dependency installation, and usage instructions to reproduce and run the model efficiently using Docker and optimized hardware libraries. ## 🔥 复现指南 (Reproduction Guide) ### 1. 环境准备 (Prepare Environment) Pull the required Docker image: ```bash docker pull image.sourcefind.cn:5000/dcu/admin/base/vllm:0.9.2-ubuntu22.04-dtk25.04.1-rc5-rocblas101839-0811-das1.6-py3.10-20250908-rc1 ``` ### 2. 创建容器 (Create Container) Run a Docker container with proper configurations: ```bash docker run -it \ --network=host \ --hostname=localhost \ --name=HUNYUAN \ -v /opt/hyhal:/opt/hyhal:ro \ -v $PWD:/workspace \ --ipc=host \ --device=/dev/kfd \ --device=/dev/mkfd \ --device=/dev/dri \ --shm-size=512G \ --privileged \ --group-add video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ image.sourcefind.cn:5000/dcu/admin/base/vllm:0.9.2-ubuntu22.04-dtk25.04.1-rc5-rocblas101839-0811-das1.6-py3.10-20250908-rc1 \ /bin/bash ``` ### 3. 拉取代码 (Clone Repository) ```bash git clone http://developer.sourcefind.cn/codes/bw_bestperf/hunyuan-dit.git cd hunyuan-dit ``` ### 4. 获取 & 安装依赖 (Download & Install Dependencies) Download required custom wheels: ```bash # Apex curl -f -C - -o apex-1.5.0+das.opt1.dtk25041-cp310-cp310-linux_x86_64.whl https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/e759f4e7fbb64b10 # Lightop curl -f -C - -o lightop-0.5.0+das.dtk25041.unknown-cp310-cp310-linux_x86_64.whl https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/3ca9654a8fc1b0b5 # Deepspeed wget https://download.sourcefind.cn:65024/directlink/4/deepspeed/DAS1.6/deepspeed-0.14.2+das.opt1.dtk25041-cp310-cp310-manylinux_2_28_x86_64.whl ``` Install the wheels and requirements: ```bash pip install apex-1.5.0+das.opt1.dtk25041-cp310-cp310-linux_x86_64.whl pip install lightop-0.5.0+das.dtk25041.unknown-cp310-cp310-linux_x86_64.whl pip install deepspeed-0.14.2+das.opt1.dtk25041-cp310-cp310-manylinux_2_28_x86_64.whl pip install -r requirements.txt -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple ``` ### 5. 下载优化包 (Download Optimization Packages) ```bash curl -f -C - -o hipblaslt-install0925.tar.gz https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/5857030947151012 curl -f -C - -o package_0915_ubuntu.tar.gz https://ksefile.hpccube.com:65241/efile/s/d/amVycnJycnk=/0c80d0e60b9af80d ``` Extract and install them accordingly as per your environment needs. ### 6. 下载模型 (Download Model) Refer to the model page on ModelScope: https://modelscope.cn/models/dengcao/HunyuanDiT-v1.2 Commands to download and prepare: ```bash pip install modelscope modelscope download --model dengcao/HunyuanDiT-v1.2 --local_dir ./HunyuanDiT-v1.2 cd HunyuanDiT-v1.2 wget https://dit.hunyuan.tencent.com/download/HunyuanDiT/tokenizer.zip wget https://dit.hunyuan.tencent.com/download/HunyuanDiT/sdxl-vae-fp16-fix.zip wget https://dit.hunyuan.tencent.com/download/HunyuanDiT/clip_text_encoder.zip ``` Model directory structure after download: