Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kuprel/min-dalle-flax
This contains the Flax model of min(DALL·E) and code for converting it to PyTorch
https://github.com/kuprel/min-dalle-flax
Last synced: 30 days ago
JSON representation
This contains the Flax model of min(DALL·E) and code for converting it to PyTorch
- Host: GitHub
- URL: https://github.com/kuprel/min-dalle-flax
- Owner: kuprel
- License: mit
- Created: 2022-07-01T17:25:26.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-21T13:32:26.000Z (over 2 years ago)
- Last Synced: 2024-05-02T01:11:59.261Z (6 months ago)
- Language: Python
- Homepage:
- Size: 7.82 MB
- Stars: 46
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# min(DALL·E) Flax
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/kuprel/min-dalle/blob/main/min_dalle.ipynb)
[![Replicate](https://replicate.com/kuprel/min-dalle/badge)](https://replicate.com/kuprel/min-dalle)This is a minimal implementation of Boris Dayma's [DALL·E Mini](https://github.com/borisdayma/dalle-mini) in flax. It has been stripped to the bare essentials necessary for doing inference. This repository also contains code for converting the flax model to torch.
See [min(DALL·E)](https://github.com/kuprel/min-dalle) for the PyTorch version.
### Setup
Run `sh setup.sh` to install dependencies and download pretrained models. The flax models can be manually downloaded here:
[VQGan](https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384),
[DALL·E Mini](https://wandb.ai/dalle-mini/dalle-mini/artifacts/DalleBart_model/mini-1/v0/files),
[DALL·E Mega](https://wandb.ai/dalle-mini/dalle-mini/artifacts/DalleBart_model/mega-1-fp16/v14/files)### Usage
Use the python script `image_from_text.py` to generate images from the command line. Note: the command line script loads the models and parameters each time. To load a model once and generate multiple times, initialize `MinDalleFlax`, then call `generate_image` with some text and a seed.