This is a small Django project used to automatically generate variations for an image uploaded by the user. This uses the OpenAI image variation api.
- Python/Django
- OpenAI API
- Create an OpenAI account and Generate an OpenAI API key to be able to access openAI services.
- Generate a .env file and add API_KEY=GENERATED_API_KEY
- Setup a virtualenv for the project
- Install the dependecies in the requirements.txt file
pip installl -r requirements.txt
- Run the project
python manage.py runserver
- You can only upload a PNG image that is less than 4MB.
- You can change the number of image variations generated by changing the VARIATIONS_NUMBER constant in settings file
- You can change the image quality by changing the IMAGE_SIZE in the settings file. This can be 256(256x256), 512(512x512) and 1024(1024x1024)
- In order for the images to be generated, you will have to pay for billing incase your free trial period is over. Without paying for billing, you will not be able to generate any image variations. An error you'd get related to this:
openai.error.InvalidRequestError: Billing hard limit has been reached
- Contributions, issues, and feature requests are welcome!