├── .gitignore ├── LICENSE ├── README.md ├── index.html └── style.css /.gitignore: -------------------------------------------------------------------------------- 1 | api.js -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Saurav Hathi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Image Generator using OpenAI API 2 | 3 | This is a simple image generator using [OpenAI API](https://openai.com/api/). you can generate images by entering short description of the image or by entering a keyword. 4 | 5 | ## Demo 6 | 7 | ### [https://sauravhathi.github.io/image-generator-using-openai-api/](https://sauravhathi.github.io/image-generator-using-openai-api/) 8 | 9 |  10 | ### images generated by AI 11 |  12 | 13 |  14 | 15 |  16 | 17 | ## How to use 18 | 19 | - Enter your OpenAI API key 20 | - Enter a short description of the image or a keyword 21 | - Select image size 22 | - Select number of images 23 | - Click on generate button 24 | - Double click on the image to download it 25 | 26 | ## API Reference 27 | 28 | [OpenAI API](https://openai.com/api/) 29 | 30 | `Note:` Sign up for an API key and add it to the `api.js` file 31 | 32 | ## Run Locally 33 | 34 | Clone the project 35 | 36 | ```bash 37 | git clone https://github.com/sauravhathi/image-generator-using-openai-api 38 | ``` 39 | 40 | Go to the project directory 41 | 42 | 1. Create api.js file in the root directory and add your API key 43 | 44 | ```javascript 45 | const api = "YOUR_API_KEY"; 46 | ``` 47 | 48 | ```bash 49 | cd image-generator-openai 50 | ``` 51 | 52 | Open `index.html` in your browser 53 | 54 | ## Authors 55 | 56 | - [@sauravhathi](https://www.github.com/sauravhathi) 57 | 58 | ## License 59 | 60 | [MIT](https://github.com/sauravhathi/image-generator-using-openai-api/blob/master/LICENSE) -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |20 | This is a simple image generator using 21 | OpenAI API. 22 | You can generate images by entering a short description of the image or by entering a keyword. 23 |
24 |