[[Paper]](https://drive.google.com/file/d/1bN1pa6h9QO_po8VKSScNxAeWzV_nl_6W/view)
[[Colab]](https://colab.research.google.com/drive/124zC1w2qHR1ijfEPQVvLccLRBLD_3duG?usp=sharing)
[[Kaggle]](https://www.kaggle.com/code/shonenkov/usage-rudalle-aspect-ratio)
[[Model Card]](https://huggingface.co/shonenkov-AI/rudalle-xl-surrealist)
ruDALLE aspect ratio images
---
Generate any arbitrary aspect ratio images using the ruDALLE models
### Installing
```
pip install rudalle==1.1.1
git clone https://github.com/shonenkov-AI/rudalle-aspect-ratio
```
### Quick Start
Horizontal images:
```python3
import sys
sys.path.insert(0, './rudalle-aspect-ratio')
from rudalle_aspect_ratio import RuDalleAspectRatio, get_rudalle_model
from rudalle import get_vae, get_tokenizer
from rudalle.pipelines import show
device = 'cuda'
dalle = get_rudalle_model('Surrealist_XL', fp16=True, device=device)
vae, tokenizer = get_vae().to(device), get_tokenizer()
rudalle_ar = RuDalleAspectRatio(
dalle=dalle, vae=vae, tokenizer=tokenizer,
aspect_ratio=32/9, bs=4, device=device
)
_, result_pil_images = rudalle_ar.generate_images('готический квартал', 768, 0.99, 4)
show(result_pil_images, 1)
```
![](./pics/h_example.jpg)
Vertical images:
```python3
rudalle_ar = RuDalleAspectRatio(
dalle=dalle, vae=vae, tokenizer=tokenizer,
aspect_ratio=9/32, bs=4, device=device
)
_, result_pil_images = rudalle_ar.generate_images('голубой цветок', 768, 0.99, 4)
show(result_pil_images, 4)
```
![](./pics/v_example.jpg)
### Citation:
```
@MISC{rudalle_ar_github,
author = {Alex Shonenkov},
title = {Github ruDALLE aspect ratio images by shonenkovAI},
url = {https://github.com/shonenkov-AI/rudalle-aspect-ratio},
year = 2022,
note = {Accessed: 13-04-2022}
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像
共11个文件
py:4个
jpg:2个
md:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 111 浏览量
2022-07-07
11:42:11
上传
评论 1
收藏 2.06MB ZIP 举报
温馨提示
文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像文字生成图像
资源推荐
资源详情
资源评论
收起资源包目录
rudalle-aspect-ratio.zip (11个子文件)
rudalle-aspect-ratio-main
rudalle_aspect_ratio
models.py 2KB
__init__.py 229B
image_prompts.py 3KB
aspect_ratio.py 9KB
pics
v_example.jpg 1.09MB
h_example.jpg 981KB
setup.cfg 242B
requirements.txt 14B
.gitignore 2KB
README.md 2KB
.pre-commit-config.yaml 660B
共 11 条
- 1
资源评论
- aaaaalisa2023-01-11资源很实用,对我启发很大,有很好的参考价值,内容详细。
东方佑
- 粉丝: 7428
- 资源: 373
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功