HunyuanImage 2.1 क्या है?
HunyuanImage 2.1 2K text-to-image जनरेशन के लिए ओपन 17B diffusion मॉडल. यह Multimodal Generation टूल्स की Image Generation श्रेणी में आता है; ओपन सोर्स है और Python में लिखा गया है। शुरू करने के लिए: repository clone करें.
सारांश
HunyuanImage 2.1 Tencent का एक ओपन text-to-image diffusion मॉडल है। यह 17B-parameter मॉडल है, जो 2K रिज़ॉल्यूशन पर इमेज बनाता है (उदाहरण के लिए, 1:1 के लिए 2048x2048 या 16:9 के लिए 2560x1536)। रेपो में PyTorch मॉडल डेफ़िनिशन, प्री-ट्रेन्ड वेट्स और inference कोड शामिल हैं, ताकि आप जनरेशन को लोकल तौर पर चला सकें।
यह उन developers और researchers के लिए बना है जो hosted API को कॉल करने के बजाय अपनी NVIDIA GPU पर हाई-रिज़ॉल्यूशन इमेज जनरेटर चलाना चाहते हैं। इस pipeline में दो चरण हैं: दो text encoders वाला एक base text-to-image मॉडल, और एक refiner मॉडल जो इमेज की क्वालिटी सुधारता है और artifacts कम करता है। Prompt enhancement छोटे prompts को लंबे और ज़्यादा विस्तृत prompts में बदल सकता है।
Image-generation कैटेगरी में यह native चीनी और अंग्रेज़ी सपोर्ट, glyph-aware text rendering, और FP8 quantization के लिए अलग दिखता है, जिससे CPU offloading चालू होने पर 2K जनरेशन के लिए GPU memory लगभग 24GB तक आ जाती है।
यह क्या करता है
- 2K (2048x2048) इमेज बनाता है; ध्यान दें कि मॉडल केवल 2K आउटपुट सपोर्ट करता है, और 1K रिज़ॉल्यूशन पर artifacts आते हैं
- अंग्रेज़ी और चीनी, दोनों प्रॉम्प्ट का native सपोर्ट
- दो-चरण वाली pipeline: एक base DiT text-to-image मॉडल और बेहतर स्पष्टता के लिए एक refiner मॉडल
- FP8 quantized weights की मदद से CPU offloading के साथ 24GB GPU पर 2K इमेज बनाई जा सकती हैं
- लचीले aspect ratios, जिनमें 1:1, 16:9, 9:16, 4:3, 3:4, 3:2 और 2:3 शामिल हैं
- ByT5 का उपयोग करके glyph-aware text rendering, ताकि इमेज में टेक्स्ट ज़्यादा सटीक हो, साथ ही वैकल्पिक automatic prompt enhancement
शुरू करें
HunyuanImage 2.1 Linux पर NVIDIA CUDA GPU के साथ चलता है (FP8 और offloading के साथ 2K के लिए न्यूनतम 24GB)। रेपो clone करें, dependencies install करें, weights डाउनलोड करें, फिर inference pipeline चलाएँ।
Repository clone करें
GitHub से सोर्स कोड लें और प्रोजेक्ट डायरेक्टरी में जाएँ।
git clone https://github.com/Tencent-Hunyuan/HunyuanImage-2.1.git
cd HunyuanImage-2.1Dependencies install करें
Python requirements के साथ एक मेल खाता flash-attn build install करें।
pip install -r requirements.txt
pip install flash-attn==2.7.3 --no-build-isolationPretrained models डाउनलोड करें
Inference चलाने से पहले base, distilled और refiner weights लाने के लिए रेपो में मौजूद checkpoint download guide (ckpts/checkpoints-download.md) का पालन करें।
2K इमेज जनरेट करें
FP8 चालू करके pipeline लोड करें, कोई सपोर्टेड 2K aspect ratio चुनें, और एक प्रॉम्प्ट चलाएँ। मॉडल केवल 2K आउटपुट सपोर्ट करता है।
import os
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'expandable_segments:True'
import torch
from hyimage.diffusion.pipelines.hunyuanimage_pipeline import HunyuanImagePipeline
# Supported model_name: hunyuanimage-v2.1, hunyuanimage-v2.1-distilled
model_name = "hunyuanimage-v2.1"
pipe = HunyuanImagePipeline.from_pretrained(model_name=model_name, use_fp8=True)
pipe = pipe.to("cuda")
prompt = "A cute, cartoon-style anthropomorphic penguin plush toy painting the Mona Lisa, photorealistic."
# 2K aspect ratios: 16:9=(2560,1536), 4:3=(2304,1792), 1:1=(2048,2048), 3:4=(1792,2304), 9:16=(1536,2560)
width, height = 2048, 2048
image = pipe(prompt=prompt, width=width, height=height)कमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।
कब इस्तेमाल करें
- पेड API के बजाय अपनी NVIDIA GPU पर हाई-रिज़ॉल्यूशन text-to-image जनरेटर self-host करना
- कई aspect ratios में 2K मार्केटिंग, concept-art या illustration इमेज बनाना
- ऐसी इमेज बनाना जिनमें अंदर सटीक चीनी या अंग्रेज़ी टेक्स्ट रेंडर होना ज़रूरी है
- diffusion-transformer pipelines, refiner मॉडल और prompt enhancement पर रिसर्च और प्रयोग
How HunyuanImage 2.1 compares
HunyuanImage 2.1 alongside other open-source image generation tools AI/TLDR tracks, ranked by GitHub stars.
| टूल | स्टार | यह क्या करता है |
|---|---|---|
| Stable Diffusion web UI (AUTOMATIC1111) | ★ 165k | अपनी मशीन पर Stable Diffusion से इमेज बनाने के लिए एक ब्राउज़र इंटरफ़ेस |
| ComfyUI | ★ 150k | लोकल इमेज और वीडियो जेनरेशन पाइपलाइन के लिए नोड-आधारित विज़ुअल एडिटर |
| Fooocus | ★ 54k | ऑफ़लाइन इमेज जनरेशन, जिसमें आप सेटिंग्स नहीं, प्रॉम्प्ट पर ध्यान दे सकें |
| InvokeAI | ★ 29.2k | ओपन डिफ्यूज़न मॉडल से इमेज बनाने के लिए सेल्फ-होस्टेड वेब UI और कैनवास |
| Stability-AI generative-models | ★ 27.4k | Stability AI का आधिकारिक कोड, जो Stable Diffusion और Stable Video मॉडल परिवार को सपोर्ट करता है |
| FLUX | ★ 26.1k | टेक्स्ट से इमेज बनाने और एडिट करने के लिए ओपन-वेट डिफ्यूज़न मॉडल और inference code |
| Z-Image | ★ 12.2k | Alibaba Tongyi का 6B ओपन इमेज मॉडल, जो एक कंज़्यूमर GPU पर फ़ोटोरियलिस्टिक तस्वीरें बनाता है |
| HunyuanImage 2.1 | ★ 677 | 2K text-to-image जनरेशन के लिए ओपन 17B diffusion मॉडल |

