File size: 1,839 Bytes
904e36a
 
 
 
 
 
 
 
 
 
93959a1
904e36a
 
 
 
 
 
 
93959a1
904e36a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14718dd
 
 
904e36a
14718dd
904e36a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
license: apache-2.0
---
# UniT2IXL

<p align="center">
    <a href="https://huggingface.co/UnicomAI/UniT2IXL">Hugging Face</a>&nbsp;&nbsp;<a href="https://www.modelscope.cn/UnicomAI/UniT2IXL">ModelScope</a>&nbsp;&nbsp; <a href="https://www.wisemodel.cn/models/UnicomAI/UniT2IXL">WiseModel</a>&nbsp;&nbsp;<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]
```