lucidrains / DALLE2-pytorch

Implementation of DALL-E 2, OpenAI's updated text-to-image synthesis neural network, in Pytorch
MIT License
11.06k stars 1.08k forks source link

How to use the pre-trained model #229

Closed hammerwang666 closed 2 years ago

hammerwang666 commented 2 years ago

Hi, I'm trying to use pre-trained model to generate images. And I downloaded some models in huggingface, then I use the cli tool.

dalle2_pytorch --model best.pth "a cat"

But it didn't show any result.

If the cli tool does not ready to use , how can I load pre-trained models and generate some images? Please show me some code demo.

Please help, thx!

Veldrovive commented 2 years ago

For loading and using models trained by LAION, like the one you linked, it is much easier to use this separate repo that was built for testing our models. In that repo you just need to run python example_inference.py dream and it will download the correct models and allow you to enter prompts. If you are having further issues with this, they should be opened in the inference repo since it is not possible to directly load the models you linked using this repo's cli.

If you wanted to use only this main repo, you would need to construct the state dict for the full model before trying to load it like this.