Image_Generator / README.md
vishalvarkhede's picture
Upload folder using huggingface_hub
b5e1f4a verified
|
Raw
History Blame Contribute Delete
2.66 kB

A newer version of the Gradio SDK is available: 6.24.0

Upgrade
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