Uni T2 I X L
UnicomAIIntroduction
UniT2IXL is a large-scale text-to-image generation model developed by the China Unicom AI Innovation Center team. It is based on latent diffusion and features an improved SDXL encoder. The model uses Chinese CLIP for native Chinese language support and incorporates the mt5 architecture for enhanced comprehension of long text. It is fully adapted for training and inference on the domestic Ascend AI software and hardware platform.
Architecture
UniT2IXL enhances the SDXL encoder and integrates Chinese CLIP to support native Chinese text. The mt5 architecture is introduced to improve the understanding of lengthy text inputs. The model is designed to operate seamlessly on the Ascend AI platform, from fine-tuning to inference.
Training
The model training leverages the Ascend AI software and hardware ecosystem, integrating improvements to handle Chinese text natively and process long texts efficiently. The adaptation ensures optimal performance during both training and inference stages.
Guide: Running Locally
To run UniT2IXL locally, follow these steps:
-
Set Up Environment
- Ensure Python 3.8 or later is installed.
- Install PyTorch 2.4.0 or later.
- Install Transformers 4.43.3 or later.
- Install Diffusers 0.31.0.
- Recommended: Use CUDA 11.7 or later for GPU acceleration.
-
Installation
git clone https://github.com/UnicomAI/UniT2IXL.git cd UniT2IXL conda create -n unit2ixl python=3.10 conda activate unit2ixl pip install -r requirements.txt
-
Download Model Weights
- Use the command:
huggingface-cli download --resume-download UnicomAI/UniT2IXL
- Use the command:
-
Inference
- Use
demo.py
for inference:from pipeline_unit2ixl import UniT2IXLPipeline pipeline = UniT2IXLPipeline.from_pretrained("UnicomAI/UniT2IXL") pipeline = pipeline.to("cuda:0") prompt = "在绿色的森林中,隐藏着一座白色的哥特式教堂,教堂的尖塔直指蓝色的天空,教堂周围是五彩斑斓的野花和浅黄色的草坪。" image = pipeline(prompt=prompt, guidance_scale=7.5, target_size=(1024,1024)).images[0]
- Use
-
Suggested Cloud GPUs
- Consider using cloud GPU services such as AWS, Azure, or Google Cloud for better performance if local resources are insufficient.
License
UniT2IXL is licensed under the Apache-2.0 license.