Text-to-Image · Diffusion Transformer
Run HunyuanDiT locally in 14GB of VRAM
A 1.5B Chinese-native DiT backbone that peaks at 14GB in fp16 and starts from roughly 6GB quantised. RTX 3090 24GB at $0.193/GPU-hour, billed per second — first image for under $0.20.
HunyuanDiT · self-hosted
HunyuanDiT is Tencent Hunyuan's open-source text-to-image diffusion transformer, released in May 2024 (paper arXiv:2405.08748). The backbone is only 1.5B parameters, yet it was among the first open DiTs with genuinely fine-grained Chinese understanding — prompts like 渔舟唱晚 or 青花瓷风格 render directly, without a translation hop through English. The repo now lives at github.com/Tencent-Hunyuan/HunyuanDiT, v1.2 is the current mainline checkpoint, and both Diffusers and ComfyUI support it natively.
What makes it cheap and what makes it expensive are the same thing: the DiT backbone is tiny, but two text encoders sit in front of it — a 350M bilingual CLIP and a 1.6B multilingual mT5 (t5-v1_1-xxl family). The VAE is sdxl-vae-fp16-fix, so fp16 runs clean out of the box with none of the black-image workarounds the original SDXL VAE needed. Tencent's own batch=1 measurements for 1024x1024: 11GB peak on A100, 14GB peak on RTX 3090/RTX 4090. Load mT5 in 8-bit with bitsandbytes and the whole chain fits in about 6GB.
Worth being straight about where the Hunyuan image line has gone. HunyuanImage 2.1 (September 2025) is 17B and only generates 2K — forcing 1K produces artifacts — and needs FP8 plus CPU offloading to land at 24GB. HunyuanImage 3.0, released the same month, is an 80B MoE with 13B active parameters in a unified autoregressive framework, with a floor of 3x80GB. HunyuanDiT is not deprecated; its niche is simply clearer now: one consumer card, roughly 9GB of weights, native Chinese prompting, and a mature ecosystem of ControlNet (canny/depth/pose), LoRA and IP-Adapter. It remains the cheapest credible starting point for self-hosted Chinese image generation.
01 —
Variants and VRAM
Every memory figure below comes from Tencent's own batch=1 measurement table, not from estimates.
| Version | Parameters | VRAM | Context | Notes |
|---|---|---|---|---|
| HunyuanDiT-v1.2 / v1.2-Diffusers | 1.5B (DiT backbone) | fp16 peak 11GB (A100) / 14GB (RTX 3090·4090) | 1024x1024, 10 resolution buckets | The current mainline weights with the most reliable Chinese semantics. Start new projects here. |
| HunyuanDiT-v1.2-Diffusers-Distilled | 1.5B | Same as v1.2, fp16 peak around 14GB | 25 steps / 1024x1024 | Distilled checkpoint supporting 25-step generation; Tencent claims roughly 50% acceleration on NVIDIA GPUs, with a TensorRT build at roughly 47%. The default choice for batch production. |
| HunyuanDiT-v1.1 | 1.5B | fp16 peak around 14GB on consumer cards | 1024x1024 | Its headline change over v1.0 was mitigating image oversaturation. A fair amount of the older community LoRA ecosystem is still pinned to v1.1. |
| DialogGen + HunyuanDiT (prompt enhancement) | 7.0B + 1.5B | fp16 peak 32GB; 22GB with --load-4bit | Multi-turn rewrite then generate | DialogGen is the multimodal model that rewrites casual prompts into detailed ones. Pass --no-enhance if you do not want it, or your peak memory triples. |
| lite/inference.py low-VRAM path | 1.5B (distilled weights) | About 6GB (bitsandbytes quantisation + 8-bit mT5) | 1024x1024 | Requires PyTorch 2.7.1+ and an Ampere-or-newer card (RTX 3070/3080/4080/4090, A100). |
02 —
Which card to rent
Matched against the official peak-memory figures. Prices are NexGPU list rates per GPU-hour.
Single-card fp16 generation, quality evaluation, 1024x1024
RTX 3090 24GB$0.193/GPU-hour
Tencent measured a 14GB peak on 3090/4090, so 24GB leaves real headroom and you never touch a quantisation flag — and Ampere satisfies both the Flash Attention v2 and the 6GB lite-path requirements.
Batch production, ControlNet stacks, torch.compile for latency
RTX 4090 24GB$0.540/GPU-hour
Ada fp16 throughput is well ahead of the 3090, and pairing it with the 25-step distilled checkpoint gives the best cost per image while canny/depth/pose ControlNets still fit inside 24GB.
Full DialogGen prompt enhancement without dropping to 4-bit
RTX 5090 32GB$0.723/GPU-hour
The official peak for the 7B DialogGen co-resident with the DiT is exactly 32GB, so this card carries the complete multi-turn rewrite chain without --load-4bit.
LoRA fine-tuning, full-parameter training, ControlNet training
A100 PCIE 80GB$0.824/GPU-hour
Tencent's floor for full-parameter training is 20GB with ~30GB recommended to avoid offloading; A100 80GB costs less than a cent more per hour than the A6000 48GB at $0.817, so the extra VRAM is effectively free batch size.
03 —
Four steps to a running instance
On a NexGPU PyTorch image, boot to first image usually takes under forty minutes.
- 01
Boot a card, clone, install
Pick an RTX 3090 24GB in the console and a PyTorch (CUDA 12.x) image from the 2,000+ prebuilt catalogue. The repo wants CUDA 11.7+ (12.0+ recommended) on Linux; if you plan to use --infer-mode fa for Flash Attention v2 you need CUDA 11.6+ and an Ampere-or-newer GPU. SSH, Jupyter and the web terminal all get you in.
git clone https://github.com/Tencent-Hunyuan/HunyuanDiT && cd HunyuanDiT && pip install -r requirements.txt - 02
Pull the weights
Under t2i/model, pytorch_model_ema.pt is about 6GB and pytorch_model_module.pt about 3GB; add mT5 (1.6B), the bilingual CLIP (350M) and sdxl-vae-fp16-fix (83M) and budget roughly 10GB of disk. Storage bills separately at a $0.414/GB-month median, which is far cheaper than re-downloading the set every session.
huggingface-cli download Tencent-Hunyuan/HunyuanDiT-v1.2 --local-dir ./ckpts - 03
Generate the first image
--no-enhance is the flag that matters here: without it the 7B DialogGen loads alongside the DiT and peak memory jumps from 11GB to 32GB. Keep --image-size inside the ten official buckets — an arbitrary 1344x768 will fall apart compositionally.
python sample_t2i.py --infer-mode fa --prompt "a fishing boat at dusk" --no-enhance --image-size 1280 768 - 04
Wire it up: Diffusers or Gradio
For a service, go straight to the diffusers HunyuanDiTPipeline with the distilled checkpoint at 25 steps. To hand your team something clickable, run python app/hydit_app.py --infer-mode fa for the Gradio UI. If memory gets tight, pipeline.transformer.enable_forward_chunking(chunk_size=1, dim=1) trades runtime for VRAM.
python -c "import torch; from diffusers import HunyuanDiTPipeline; p=HunyuanDiTPipeline.from_pretrained('Tencent-Hunyuan/HunyuanDiT-v1.2-Diffusers-Distilled', torch_dtype=torch.float16).to('cuda'); p('an astronaut riding a horse').images[0].save('out.png')"
What an image actually costs
Use Tencent's own A100 80GB benchmark as the baseline: HunyuanDiT-v1.2 at the default 50 steps produces one 1024x1024 image in 20.57 seconds without torch.compile, and 12.47 seconds with max-autotune compilation. Against NexGPU's A100 PCIE 80GB at $0.824/GPU-hour that works out to 3600/20.57 = about 175 images per hour, or 0.824/175 = about $0.0047 per image uncompiled; compiled it becomes 3600/12.47 = about 289 images per hour, or 0.824/289 = about $0.0029 per image. Compilation itself costs a few minutes, so it pays for itself somewhere around the two-hundredth image. If you are only validating quality, the RTX 3090 24GB at $0.193/GPU-hour is the better buy: the 14GB peak fits comfortably, and image pull plus a 9GB weight download plus first generation is roughly 40 minutes, so 0.193 x 0.67 = about $0.13; leaving it running six more hours for batch output adds 0.193 x 6 = about $1.16. For LoRA work, where Tencent recommends 30GB or more, an A100 PCIE 80GB running eight straight hours is 0.824 x 8 = about $6.59 — and the repo's own porcelain rank-64 example finishes in the low thousands of steps, so you rarely use the full window. Billing is metered per second and priced per hour, with no minimum, no setup fee and no quota request; compute billing stops the moment the instance stops, and only the storage volume keeps accruing at $0.414/GB-month until you destroy it.
04 —
FAQ
How much VRAM does HunyuanDiT actually need — can 6GB really run it?
Tencent is up to HunyuanImage 3.0 — is HunyuanDiT still worth deploying?
v1.0, v1.1, v1.2 or the distilled build — which should I pick?
Can I use HunyuanDiT commercially? What is in the licence?
Why does my output fall apart when I change the resolution?
What GPU do I need to LoRA fine-tune HunyuanDiT?
More in Image generation
Start building on NexGPU
Enterprise R&D team or solo developer — either way, your first job can be running in minutes.
Sign up to browse live network pricing. No payment method required.
