No project description provided
Project description
ruDALL-E
Generate images from texts
pip install rudalle==0.0.1rc6
🤗 HF Models:
Minimal Example:
generation by ruDALLE:
from rudalle.pipelines import generate_images, show, super_resolution, cherry_pick_by_clip
from rudalle import get_rudalle_model, get_tokenizer, get_vae, get_realesrgan, get_ruclip
from rudalle.utils import seed_everything
# prepare models
device = 'cuda'
dalle = get_rudalle_model('Malevich', pretrained=True, fp16=True, device=device)
realesrgan = get_realesrgan('x4', device=device)
tokenizer = get_tokenizer()
vae = get_vae().to(device)
ruclip, ruclip_processor = get_ruclip('ruclip-vit-base-patch32-v5')
ruclip = ruclip.to(device)
text = 'изображение радуги на фоне ночного города'
seed_everything(42)
pil_images = []
scores = []
for top_k, top_p, images_num in [
(2048, 0.995, 3),
(1536, 0.99, 3),
(1024, 0.99, 3),
(1024, 0.98, 3),
(512, 0.97, 3),
(384, 0.96, 3),
(256, 0.95, 3),
(128, 0.95, 3),
]:
_pil_images, _scores = generate_images(text, tokenizer, dalle, vae, top_k=top_k, images_num=images_num, top_p=top_p)
pil_images += _pil_images
scores += _scores
show(pil_images, 6)
auto cherry-pick by ruCLIP:
top_images, clip_scores = cherry_pick_by_clip(pil_images, text, ruclip, ruclip_processor, device=device, count=6)
show(top_images, 3)
super resolution:
sr_images = super_resolution(top_images, realesrgan)
show(sr_images, 3)
text, seed = 'красивая тян из аниме', 6955
Image Prompt
see jupyters/ruDALLE-image-prompts-A100.ipynb
text, seed = 'Храм Василия Блаженного', 42
skyes = [red_sky, sunny_sky, cloudy_sky, night_sky]
🚀 Contributors 🚀
- @neverix thanks a lot for contributing for speed up of inference
- @Igor Pavlov trained model and prepared code with super-resolution
- @oriBetelgeuse thanks a lot for easy API of generation using image prompt
- @Alex Wortega created first FREE version colab notebook with fine-tuning ruDALL-E Malevich (XL) on sneakers domain 💪
- @Anton Lozhkov Integrated to Huggingface Spaces with Gradio, see here
Social Media
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rudalle-0.0.1rc6.tar.gz
(28.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rudalle-0.0.1rc6.tar.gz.
File metadata
- Download URL: rudalle-0.0.1rc6.tar.gz
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
642a7acb1c6f86d9822d9e13e1809273ed296286a012b82e31be3241a375217e
|
|
| MD5 |
d059c2f6c5c67ea27bb997877bcb5e91
|
|
| BLAKE2b-256 |
6b07f07e1502281d84d1477ab6b369ed128cc311e2c1e959d417a9c2dce099ae
|
File details
Details for the file rudalle-0.0.1rc6-py3-none-any.whl.
File metadata
- Download URL: rudalle-0.0.1rc6-py3-none-any.whl
- Upload date:
- Size: 32.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b910478d90a8642428ecb7a98e773457ca52ec8213e47b927da671ad44726ef
|
|
| MD5 |
b7ef7eda588693242f1f694f40cad4f2
|
|
| BLAKE2b-256 |
e9cdc05d7799927f6f24b0c264535930dc223824265167a3837d470eacb80af1
|