Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available: 6.24.0
metadata
title: Image_Generator
app_file: UI.py
sdk: gradio
sdk_version: 5.49.1
README.md
# ๐จ DALLยทE AI Image Generator
Modern AI-powered Text-to-Image Generator built using:
- Python
- Gradio
- OpenAI DALLยทE API
- Modern Glassmorphism UI
---
# โจ Features
- Modern premium UI
- AI image generation
- OpenAI GPT Image API support
- Prompt history
- Download generated images
- Retry mechanism
- Error handling
- Responsive design
- Dark mode aesthetic
- Queue support
- Automatic image saving
---
# ๐ Project Structure
project/
โ
โโโ app.py
โโโ UI.py
โโโ requirements.txt
โโโ README.md
โโโ .env
โ
โโโ generated_images/
โ
โโโ logs/
โโโ app.log
---
# ๐ Installation
## 1. Clone Project
```bash
git clone <your-repository-url>
cd project
2. Create Virtual Environment
Windows
python -m venv venv
venv\\Scripts\\activate
Mac/Linux
python3 -m venv venv
source venv/bin/activate
3. Install Dependencies
pip install -r requirements.txt
๐ Environment Setup
Create a .env file in the root directory:
OPENAI_API_KEY=your_api_key_here
โถ๏ธ Run Application
python UI.py
Application will start locally at:
http://127.0.0.1:7860
๐ผ๏ธ Example Prompts
- A futuristic cyberpunk city at night
- Ultra realistic samurai warrior
- Fantasy floating island above clouds
- Anime-style Tokyo street
- Astronaut riding horse on Mars
โ๏ธ Supported Settings
Image Sizes
- 1024x1024
- 1024x1792
- 1792x1024
Quality
- low
- medium
- high
Styles
- vivid
- natural
๐ Generated Images
All generated images are automatically saved inside:
generated_images/
๐ Logs
Application logs are stored inside:
logs/app.log
โ Error Handling
The application handles:
- Empty prompts
- API failures
- Invalid API keys
- Network issues
- Timeout errors
- Rate limits
๐ ๏ธ Tech Stack
- Python 3.11+
- Gradio
- OpenAI SDK
- Pillow
- Requests
- python-dotenv
๐ฎ Future Improvements
- Multi-image generation
- Image editing
- AI upscaling
- Prompt enhancement
- Authentication system
- Database support
- Cloud deployment
- Docker support
โค๏ธ Credits
Built with:
- Gradio
- OpenAI
- Python
๐ License
MIT License