Skip to main content

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 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.

VersionParametersVRAMContextNotes
HunyuanDiT-v1.2 / v1.2-Diffusers1.5B (DiT backbone)fp16 peak 11GB (A100) / 14GB (RTX 3090·4090)1024x1024, 10 resolution bucketsThe current mainline weights with the most reliable Chinese semantics. Start new projects here.
HunyuanDiT-v1.2-Diffusers-Distilled1.5BSame as v1.2, fp16 peak around 14GB25 steps / 1024x1024Distilled 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.11.5Bfp16 peak around 14GB on consumer cards1024x1024Its 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.5Bfp16 peak 32GB; 22GB with --load-4bitMulti-turn rewrite then generateDialogGen 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 path1.5B (distilled weights)About 6GB (bitsandbytes quantisation + 8-bit mT5)1024x1024Requires 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.

  1. 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
  2. 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
  3. 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
  4. 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's batch=1 table is explicit: HunyuanDiT on its own peaks at 11GB on A100 and 14GB on RTX 3090/RTX 4090. Getting down to 6GB means the lite/inference.py path — bitsandbytes quantisation plus 8-bit mT5 loading — which requires PyTorch 2.7.1+ and an Ampere-or-newer card (RTX 3070/3080/4080/4090, A100). Rather than fight OOM at 6GB, NexGPU's RTX 3090 24GB is $0.193/GPU-hour, which puts that 14GB peak inside 24GB with no quantisation flags to tune at all.

Tencent is up to HunyuanImage 3.0 — is HunyuanDiT still worth deploying?

These are three different weight classes. HunyuanImage 2.1 is 17B and 2K-only (forcing 1K produces artifacts), needing FP8 plus CPU offload to reach 24GB. HunyuanImage 3.0 is an 80B MoE with 13B active parameters, with an official floor of 3x80GB and 8x80GB for the Instruct variant. HunyuanDiT is 1.5B, one consumer card, roughly 9GB of weights, with mature ControlNet and LoRA support — still the cheapest option for high-volume Chinese image generation. All three run on NexGPU: 3090/4090 for the DiT, RTX 5090 32GB or A6000 48GB for 2.1, and multi-GPU H200 141GB for 3.0, with up to 14 GPUs and 2,152GB of VRAM in a single node.

v1.0, v1.1, v1.2 or the distilled build — which should I pick?

v1.1's headline change over v1.0 was mitigating oversaturation, and v1.2 is the mainline, so new projects should just start on v1.2. For batch output take HunyuanDiT-v1.2-Diffusers-Distilled, which generates in 25 steps for roughly 50% acceleration on NVIDIA GPUs, with a TensorRT build at roughly 47%. Stack torch.compile on top for more: on an A100 80GB, Tencent measured 20.57 seconds per image at the default 50 steps versus 12.47 seconds after max-autotune compilation. NexGPU's A100 PCIE 80GB is $0.824/GPU-hour, so those two numbers are your per-image cost baseline directly.

Can I use HunyuanDiT commercially? What is in the licence?

The weights ship under the Tencent Hunyuan Community License Agreement, which does permit commercial use but carries two hard constraints you should verify against LICENSE.txt yourself: the licensed territory is worldwide excluding the European Union, and the agreement states plainly that it does not apply in the EU; and if, in the calendar month preceding the version release date, your products and services together exceed 100 million monthly active users, you must request a separate licence from Tencent. On the compute side there is no approval step at all — NexGPU requires no quota request or support ticket, and you choose your landing region across 51 countries and regions and 1,175 verified rentable nodes.

Why does my output fall apart when I change the resolution?

HunyuanDiT is multi-resolution trained, but only on a fixed set of buckets. In diffusers, use_resolution_binning defaults to True and snaps your request to the nearest legal size: 1024x1024, 1280x1280, 1024x768, 1152x864, 1280x960, 768x1024, 864x1152, 960x1280, 1280x768 and 768x1280. Turn it off, pass 1344x768, and composition degrades. The other frequent trap is forgetting --no-enhance: DialogGen quietly rewrites your prompt into something else entirely, and takes peak memory from 11GB to 32GB while doing it. To sweep all ten buckets at once, NexGPU bills per second — four RTX 4090 24GB in parallel for an hour is $2.16.

What GPU do I need to LoRA fine-tune HunyuanDiT?

Tencent's stated floor for full-parameter training is a single GPU with at least 20GB, with about 30GB recommended so you avoid memory offloading. LoRA runs through lora/train_lora_with_fa.sh in the repo, which ships with the porcelain sample dataset — rank 64 and a few thousand steps is enough to see the style transfer land. That 20GB floor makes a 24GB card marginal in practice, so use RTX A6000 48GB ($0.817/GPU-hour) or A100 PCIE 80GB ($0.824/GPU-hour); the gap between them is under a cent, so take the A100. NexGPU meters per second, compute billing stops when the run stops, and the finished LoRA sits in your storage volume ready to mount back onto an inference instance.

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.