This repository contains a Python application named dalle_image_editor
which acts as an AI Image Generator and Editor using OpenAI's DALL-E models. The application is built using the Tkinter
library for the GUI and uses various other libraries for handling images and API requests.
Note: The README file is completely AI-generated, while the Python script is written with the help of AI tools.
- Generate New Image: Create a new image based on a textual description using OpenAI's DALL-E model.
- Edit Selected Image: Edit an existing image by marking areas that should be modified and providing a new description.
- Create Variation of Selected Image: Generate variations of an existing image.
- Open Image File: Open and display an image file from your local system.
- Save Selected Image: Save the currently selected image to your local system.
- Remove Selected Image: Remove the currently selected image from the display.
- Clear All Images: Clear all displayed images.
- Python 3.x
tkinter
PIL
requests
easygui
openai
To install the required packages, run:
pip install tk pillow requests easygui openai
-
Run the Application:
python dalle_image_editor.py
-
Generate New Image:
- Click on the
Generate New Image
button. - Enter a description for the image in the prompt dialog.
- Wait for the image to be generated and displayed.
- Click on the
-
Edit Selected Image:
- Click on any image to select it.
- Click on the
Edit Selected Image
button. - A new window will open to mark the areas to be modified.
- Use the brush tools to mark the areas.
- Choose between
Erase
,Restore
,Circle Brush
,Square Brush
, andLine Brush
. - Click
Finish Marking
when done.
- Enter a description of the changes you want to make in the prompt dialog.
- Wait for the edited image to be generated and displayed.
-
Create Variation of Selected Image:
- Click on any image to select it.
- Click on the
Create Variation of Selected
button. - Enter the number of variations to generate in the dialog.
- Wait for the variations to be generated and displayed.
-
Open Image File:
- Click on the
Open Image File
button. - Select an image file from your local system.
- The image will be displayed in the application.
- Click on the
-
Save Selected Image:
- Click on any image to select it.
- Click on the
Save Selected Image
button. - Select the location to save the image in the file save dialog.
- The selected image will be saved to the specified location.
-
Remove Selected Image:
- Click on any image to select it.
- Click on the
Remove Selected Image
button. - The selected image will be removed from the display.
-
Clear All Images:
- Click on the
Clear All Images
button. - All images will be removed from the display.
- Click on the
- Ensure that you have a functional OpenAI API key and replace
"sk-xxx"
with your actual API key in the script.
This project is licensed under the MIT License. See the LICENSE file for more details.
This project was created with the help of AI tools like OpenAI's GPT-4. Special thanks to the developers of tkinter
, PIL
, requests
, easygui
, and openai
for their amazing libraries.
Please note that the generation and editing of images are done using OpenAI’s models, and their usage is subject to OpenAI’s terms and conditions.
Enjoy creating and editing your images with dalle_image_editor
! If you encounter any issues or have any suggestions, feel free to open an issue on the GitHub repository.