|
|
--- |
|
|
license: apache-2.0 |
|
|
--- |
|
|
# UniT2IXL |
|
|
|
|
|
<p align="center"> |
|
|
<a href="https://huggingface.co/UnicomAI/UniT2IXL">Hugging Face</a> <a href="https://www.modelscope.cn/UnicomAI/UniT2IXL">ModelScope</a> <a href="https://www.wisemodel.cn/models/UnicomAI/UniT2IXL">WiseModel</a> <a href="https://github.com/UnicomAI/UniT2IXL.git">github</a> |
|
|
</p> |
|
|
|
|
|
<figure> |
|
|
<img src="pic.png"> |
|
|
</figure> |
|
|
|
|
|
<br> |
|
|
|
|
|
## 📖 介绍 |
|
|
UniT2IXL是由中国联通AI创新中心团队开发的一款基于潜在扩散的大规模文本到图像生成模型。该模型改进了SDXL的编码器,采用中文CLIP实现对原生中文的支持,并引入mt5架构提升对长文本的理解能力。在国产昇腾AI基础软硬件平台实现了模型从微调训练到推理的一体化适配 |
|
|
<p style="text-align: center;"> |
|
|
<img src="unit2ixl.png" width="400"/> |
|
|
</p> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 🚀 快速开始 |
|
|
### 环境依赖 |
|
|
|
|
|
* Python 3.8 or later |
|
|
* PyTorch 2.4.0 or later |
|
|
* Transformers 4.43.3 or later |
|
|
* Diffusers 0.31.0 |
|
|
* Recommended: CUDA 11.7 or later |
|
|
<br> |
|
|
|
|
|
1. 快速安装 |
|
|
|
|
|
```bash |
|
|
git clone https://github.com/UnicomAI/UniT2IXL.git |
|
|
cd UniT2IXL |
|
|
conda create -n unit2i python=3.10 |
|
|
conda activate unit2ixl |
|
|
cd unit2ixl |
|
|
pip install -r requirements.txt |
|
|
``` |
|
|
2. 权重下载([link](https://huggingface.co/UnicomAI/UniT2IXL)): |
|
|
```bash |
|
|
huggingface-cli download --resume-download UnicomAI/UniT2IXL |
|
|
``` |
|
|
|
|
|
3. 推理`demo.py`: |
|
|
```bash |
|
|
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] |
|
|
``` |