Skip to main content

ruDALL-E generate images from texts in Russian language

Project description

ruDALL-E

Generate images from texts

Apache license Downloads Coverage Status pipeline pre-commit.ci status

pip install rudalle==1.1.1

🤗 HF Models:

ruDALL-E Malevich (XL)
ruDALL-E Emojich (XL) (readme here)
ruDALL-E Surrealist (XL)
ruDALL-E Kandinsky (XXL) (soon)

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:

import ruclip
from rudalle.pipelines import generate_images, show, super_resolution, cherry_pick_by_ruclip
from rudalle import get_rudalle_model, get_tokenizer, get_vae, get_realesrgan
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)
clip, processor = ruclip.load('ruclip-vit-base-patch32-384', device=device)
clip_predictor = ruclip.Predictor(clip, processor, device, bs=8)
text = 'радуга на фоне ночного города'

seed_everything(42)
pil_images = []
scores = []
for top_k, top_p, images_num in [
    (2048, 0.995, 24),
]:
    _pil_images, _scores = generate_images(text, tokenizer, dalle, vae, top_k=top_k, images_num=images_num, bs=8, 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_ruclip(pil_images, text, clip_predictor, 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]

VideoDALL-E | ruCogVideo by @cene555

Video generation example Open In Colab Finetuning example Open In Colab

Aspect ratio images -->NEW<--

Kandinsky

роботы акварелью в стиле ван гога

FID = 15.4 (COCO Valid)

🚀 Contributors 🚀

Supported by

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-1.1.1.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

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

rudalle-1.1.1-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file rudalle-1.1.1.tar.gz.

File metadata

  • Download URL: rudalle-1.1.1.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for rudalle-1.1.1.tar.gz
Algorithm Hash digest
SHA256 b0560ce1cfe549ab810f2bc44cb97a27f5cb37094fb4b65acfe7fbcce47910de
MD5 de905a5d5245e2cd4ed583333db6d770
BLAKE2b-256 e384eb4b1b40c56f7f7639bc95152997c18a39945d1cf61aa65a002603e4e546

See more details on using hashes here.

File details

Details for the file rudalle-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: rudalle-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for rudalle-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 997f490b0accd97ae2e08e8ea3b8c0d2335fb4378d572d655e2a87187c54a7a0
MD5 6b57ec86d1c5bb04ceb61019eef3a507
BLAKE2b-256 54bc547243ab3c62b87f27eec59bf65e136685aaf2a205cebafaa1aadd19d301

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