ChenoAi commited on
Commit
ae8c08f
1 Parent(s): e090b5d
Files changed (1) hide show
  1. app.py +62 -81
app.py CHANGED
@@ -159,88 +159,70 @@ examples = [
159
  "a close up of a woman wearing a transparent, prismatic, elaborate nemeses headdress, over the should pose, brown skin-tone"
160
  ]
161
 
162
- css = '''
163
- .gradio-container{max-width: 560px !important}
164
- h1{text-align:center}
165
- footer {
166
- visibility: hidden
167
- }
168
- '''
169
  with gr.Blocks(css=css, theme="soft") as demo:
170
- gr.Markdown(DESCRIPTION)
171
- gr.DuplicateButton(
172
- value="Duplicate Space for private use",
173
- elem_id="duplicate-button",
174
- visible=False,
175
- )
176
-
177
- with gr.Group():
178
- with gr.Row():
179
- prompt = gr.Text(
180
- label="Prompt",
181
- show_label=False,
182
- max_lines=1,
183
- placeholder="Enter your prompt",
184
- container=False,
185
- )
186
- run_button = gr.Button("Run")
187
- result = gr.Gallery(label="Result", columns=1, preview=True)
188
- with gr.Accordion("Advanced options", open=False):
189
- use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=False, visible=True)
190
- negative_prompt = gr.Text(
191
- label="Negative prompt",
192
- max_lines=1,
193
- placeholder="Enter a negative prompt",
194
- visible=True,
195
- )
196
- with gr.Row():
197
- num_inference_steps = gr.Slider(
198
- label="Steps",
199
- minimum=10,
200
- maximum=60,
201
- step=1,
202
- value=30,
203
- )
204
- with gr.Row():
205
- num_images_per_prompt = gr.Slider(
206
- label="Images",
207
- minimum=1,
208
- maximum=5,
209
  step=1,
210
- value=2,
211
- )
212
- seed = gr.Slider(
213
- label="Seed",
214
- minimum=0,
215
- maximum=MAX_SEED,
216
- step=1,
217
- value=0,
218
- visible=True
219
- )
220
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
221
- with gr.Row(visible=True):
222
- width = gr.Slider(
223
- label="Width",
224
- minimum=512,
225
- maximum=2048,
226
- step=8,
227
- value=1024,
228
- )
229
- height = gr.Slider(
230
- label="Height",
231
- minimum=512,
232
- maximum=2048,
233
- step=8,
234
- value=1024,
235
- )
236
- with gr.Row():
237
- guidance_scale = gr.Slider(
238
- label="Guidance Scale",
239
- minimum=0.1,
240
- maximum=20.0,
241
- step=0.1,
242
- value=6,
243
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  with gr.Row(visible=True):
245
  style_selection = gr.Radio(
246
  show_label=True,
@@ -249,8 +231,7 @@ with gr.Blocks(css=css, theme="soft") as demo:
249
  choices=STYLE_NAMES,
250
  value=DEFAULT_STYLE_NAME,
251
  label="Image Style",
252
- )
253
-
254
 
255
  gr.Examples(
256
  examples=examples,
 
159
  "a close up of a woman wearing a transparent, prismatic, elaborate nemeses headdress, over the should pose, brown skin-tone"
160
  ]
161
 
 
 
 
 
 
 
 
162
  with gr.Blocks(css=css, theme="soft") as demo:
163
+ gr.HTML("<h1><center>DALL•E 3 XL v2</center></h1>")
164
+ with gr.Row():
165
+ with gr.Column(scale=1):
166
+ result = gr.Gallery(label='Result', columns = 1, preview=True, height=400)
167
+ with gr.Row():
168
+ prompt = gr.Textbox(label='Enter Your Prompt', placeholder="Enter prompt...", scale=6)
169
+ run_button = gr.Button(scale=2, variant='primary')
170
+ with gr.Accordion("Advanced options", open=True):
171
+ use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=False, visible=True)
172
+ negative_prompt = gr.Text(
173
+ label="Negative prompt",
174
+ max_lines=1,
175
+ placeholder="Enter a negative prompt",
176
+ visible=True,
177
+ )
178
+ with gr.Row():
179
+ num_inference_steps = gr.Slider(
180
+ label="Steps",
181
+ minimum=10,
182
+ maximum=60,
183
+ step=1,
184
+ value=30,
185
+ )
186
+ with gr.Row():
187
+ num_images_per_prompt = gr.Slider(
188
+ label="Images",
189
+ minimum=1,
190
+ maximum=5,
191
+ step=1,
192
+ value=2,
193
+ )
194
+ seed = gr.Slider(
195
+ label="Seed",
196
+ minimum=0,
197
+ maximum=MAX_SEED,
 
 
 
 
198
  step=1,
199
+ value=0,
200
+ visible=True
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  )
202
+ randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
203
+ with gr.Row(visible=True):
204
+ width = gr.Slider(
205
+ label="Width",
206
+ minimum=512,
207
+ maximum=2048,
208
+ step=8,
209
+ value=1024,
210
+ )
211
+ height = gr.Slider(
212
+ label="Height",
213
+ minimum=512,
214
+ maximum=2048,
215
+ step=8,
216
+ value=1024,
217
+ )
218
+ with gr.Row():
219
+ guidance_scale = gr.Slider(
220
+ label="Guidance Scale",
221
+ minimum=0.1,
222
+ maximum=20.0,
223
+ step=0.1,
224
+ value=6,
225
+ )
226
  with gr.Row(visible=True):
227
  style_selection = gr.Radio(
228
  show_label=True,
 
231
  choices=STYLE_NAMES,
232
  value=DEFAULT_STYLE_NAME,
233
  label="Image Style",
234
+ )
 
235
 
236
  gr.Examples(
237
  examples=examples,