This project is a Text-to-Image Generator application built using Python's Tkinter
for the graphical user interface (GUI) and the Stable Diffusion model for generating images from text. The app allows users to enter a description, click a button, and generate a corresponding image.
- Simple and easy-to-use GUI built with
Tkinter
. - Integration with the Stable Diffusion model for high-quality image generation.
- Ability to save generated images locally.
- Responsive layout that adjusts based on window size.
To run this project, you will need:
-
Python 3.7+
-
Create a virtual environment by using this command,
python -m venv venv
venv\Scripts\activate
-
Access to a Stable Diffusion API or local model (e.g., via Hugging Face, OpenAI, or another service)
-
The following Python libraries:
Tkinter
PIL
(Pillow for image handling)requests
(if using an API for Stable Diffusion)torch
(if using a local model)transformers
(for handling Stable Diffusion model)
-
Download
cuda
for fast execution, if not using cuda change the torch_dtype to fp32 to run in cpu
-
Clone this repository:
git clone https://github.com/Sreejith2003/Text_To_Image.git
-
Install required dependencies:
pip install -r requirements.txt
-
Set up Stable Diffusion:
- If using a local model, download it (e.g., from Hugging Face).
- If using an API, ensure you have the correct API key and access.
-
Run the application:
python main.py
- Open the app and enter a description or text prompt in the input box.
- Click the "Generate Image" button.
- The generated image will be displayed in the app window.
- You can save the image by clicking the "Save" button.
Happy Reading :)