File size: 2,659 Bytes
fbb9523
 
b5e1f4a
fbb9523
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
---

title: Image_Generator
app_file: UI.py
sdk: gradio
sdk_version: 5.49.1
---

# README.md

````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

```bash

python -m venv venv

venv\\Scripts\\activate

```

### Mac/Linux

```bash

python3 -m venv venv

source venv/bin/activate

```

---

## 3. Install Dependencies

```bash

pip install -r requirements.txt

```

---

# ๐Ÿ”‘ Environment Setup

Create a `.env` file in the root directory:

```env

OPENAI_API_KEY=your_api_key_here

```

---

# โ–ถ๏ธ Run Application

```bash

python UI.py

```

Application will start locally at:

```txt

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:

```txt

generated_images/

```

---

# ๐Ÿ“œ Logs

Application logs are stored inside:

```txt

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

```

```