Skip to main content

ruDALL-E generate images from texts in Russian language

Project description

ruDALL-E

Generate images from texts

Apache license Coverage Status pipeline pre-commit.ci status

pip install rudalle==0.0.1rc10

🤗 HF Models:

ruDALL-E Malevich (XL)

Minimal Example:

Open In Colab Kaggle Hugging Face Spaces

Example usage ruDALL-E Malevich (XL) with 3.5GB vRAM! Open In Colab

Finetuning example Open In Colab

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)
tokenizer = get_tokenizer()
vae = get_vae(dwt=True).to(device)

# pipeline utils:
realesrgan = get_realesrgan('x2', device=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 🚀

Social Media

Project details


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.1rc10.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rudalle-0.0.1rc10-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

File details

Details for the file rudalle-0.0.1rc10.tar.gz.

File metadata

  • Download URL: rudalle-0.0.1rc10.tar.gz
  • Upload date:
  • Size: 33.4 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

Hashes for rudalle-0.0.1rc10.tar.gz
Algorithm Hash digest
SHA256 6c10d0081fae593cca4ab7f5ee69e6f6224d1d781d6c8d4e7595670a1fcd25ff
MD5 34c031447a4b216eaef61c9eaec5e4ac
BLAKE2b-256 d8d1289cd1a8e1f445871dd56371cee7e0e4569f65672913b091adb3a263e004

See more details on using hashes here.

File details

Details for the file rudalle-0.0.1rc10-py3-none-any.whl.

File metadata

  • Download URL: rudalle-0.0.1rc10-py3-none-any.whl
  • Upload date:
  • Size: 38.0 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

Hashes for rudalle-0.0.1rc10-py3-none-any.whl
Algorithm Hash digest
SHA256 9bdc3843cd1644c8a7ea02ebbe41ce7fe7a1ea8eb0709aea33b9b2b0bbff6ace
MD5 4881e2a7c49814f31162199ead666928
BLAKE2b-256 7b725aaa909e87f3149f1d89f4213fa7ff460b60615760ee99479419158f37d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page