prithivMLmods commited on
Commit
eb53be6
·
verified ·
1 Parent(s): 5dd61a0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +78 -20
app.py CHANGED
@@ -37,6 +37,41 @@ style_list = [
37
  "prompt": "hyper-realistic 4K image of {prompt}. ultra-detailed, lifelike, high-resolution, sharp, vibrant colors, photorealistic",
38
  "negative_prompt": "cartoonish, low resolution, blurry, simplistic, abstract, deformed, ugly",
39
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  {
41
  "name": "(No style)",
42
  "prompt": "{prompt}",
@@ -176,17 +211,32 @@ with gr.Blocks(css=css, theme="xiaobaiyuan/theme_brief") as demo:
176
  placeholder="Enter your prompt",
177
  container=False,
178
  )
179
- run_button = gr.Button("Run", scale=0)
180
- result = gr.Gallery(label="Result", columns=NUM_IMAGES_PER_PROMPT, show_label=False)
181
  with gr.Accordion("Advanced options", open=False):
 
 
 
 
 
 
 
 
182
  with gr.Row():
183
- use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True, visible=True)
184
- negative_prompt = gr.Text(
185
- label="Negative prompt",
186
- max_lines=1,
187
- placeholder="Enter a negative prompt",
188
- value="(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, NSFW",
189
- visible=True,
 
 
 
 
 
 
 
190
  )
191
  seed = gr.Slider(
192
  label="Seed",
@@ -194,33 +244,41 @@ with gr.Blocks(css=css, theme="xiaobaiyuan/theme_brief") as demo:
194
  maximum=MAX_SEED,
195
  step=1,
196
  value=0,
 
197
  )
198
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
199
- style = gr.Dropdown(label="Style", choices=STYLE_NAMES, value=DEFAULT_STYLE_NAME)
200
  with gr.Row(visible=True):
201
  width = gr.Slider(
202
  label="Width",
203
- minimum=256,
204
- maximum=MAX_IMAGE_SIZE,
205
- step=32,
206
  value=1024,
207
  )
208
  height = gr.Slider(
209
  label="Height",
210
- minimum=256,
211
- maximum=MAX_IMAGE_SIZE,
212
- step=32,
213
  value=1024,
214
  )
215
  with gr.Row():
216
  guidance_scale = gr.Slider(
217
  label="Guidance Scale",
218
  minimum=0.1,
219
- maximum=20,
220
  step=0.1,
221
- value=3.0,
222
  )
223
-
 
 
 
 
 
 
 
 
224
  gr.Examples(
225
  examples=examples,
226
  inputs=prompt,
@@ -247,7 +305,7 @@ with gr.Blocks(css=css, theme="xiaobaiyuan/theme_brief") as demo:
247
  prompt,
248
  negative_prompt,
249
  use_negative_prompt,
250
- style,
251
  seed,
252
  width,
253
  height,
 
37
  "prompt": "hyper-realistic 4K image of {prompt}. ultra-detailed, lifelike, high-resolution, sharp, vibrant colors, photorealistic",
38
  "negative_prompt": "cartoonish, low resolution, blurry, simplistic, abstract, deformed, ugly",
39
  },
40
+ {
41
+ "name": "HDR",
42
+ "prompt": "HDR photo of {prompt}. high dynamic range, vivid colors, sharp contrast, realistic, detailed, high resolution, professional",
43
+ "negative_prompt": "dull, low contrast, blurry, unrealistic, cartoonish, ugly, deformed",
44
+ },
45
+ {
46
+ "name": "Cinematic",
47
+ "prompt": "cinematic still {prompt}. emotional, harmonious, vignette, highly detailed, high budget, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy",
48
+ "negative_prompt": "anime, cartoon, graphic, text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured",
49
+ },
50
+ {
51
+ "name": "Photo",
52
+ "prompt": "cinematic photo {prompt}. 35mm photograph, film, bokeh, professional, 4k, highly detailed",
53
+ "negative_prompt": "drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly",
54
+ },
55
+ {
56
+ "name": "Anime",
57
+ "prompt": "anime artwork {prompt}. anime style, key visual, vibrant, studio anime, highly detailed",
58
+ "negative_prompt": "photo, deformed, black and white, realism, disfigured, low contrast",
59
+ },
60
+ {
61
+ "name": "Manga",
62
+ "prompt": "manga style {prompt}. vibrant, high-energy, detailed, iconic, Japanese comic style",
63
+ "negative_prompt": "ugly, deformed, noisy, blurry, low contrast, realism, photorealistic, Western comic style",
64
+ },
65
+ {
66
+ "name": "Digital",
67
+ "prompt": "concept art {prompt}. digital artwork, illustrative, painterly, matte painting, highly detailed",
68
+ "negative_prompt": "photo, photorealistic, realism, ugly",
69
+ },
70
+ {
71
+ "name": "3D Model",
72
+ "prompt": "professional 3d model {prompt}. octane render, highly detailed, volumetric, dramatic lighting",
73
+ "negative_prompt": "ugly, deformed, noisy, low poly, blurry, painting",
74
+ },
75
  {
76
  "name": "(No style)",
77
  "prompt": "{prompt}",
 
211
  placeholder="Enter your prompt",
212
  container=False,
213
  )
214
+ run_button = gr.Button("Run")
215
+ result = gr.Gallery(label="Result", columns=1, preview=True)
216
  with gr.Accordion("Advanced options", open=False):
217
+ use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True, visible=True)
218
+ negative_prompt = gr.Text(
219
+ label="Negative prompt",
220
+ max_lines=1,
221
+ placeholder="Enter a negative prompt",
222
+ value="(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation, NSFW",
223
+ visible=True,
224
+ )
225
  with gr.Row():
226
+ num_inference_steps = gr.Slider(
227
+ label="Steps",
228
+ minimum=10,
229
+ maximum=60,
230
+ step=1,
231
+ value=30,
232
+ )
233
+ with gr.Row():
234
+ num_images_per_prompt = gr.Slider(
235
+ label="Images",
236
+ minimum=1,
237
+ maximum=5,
238
+ step=1,
239
+ value=2,
240
  )
241
  seed = gr.Slider(
242
  label="Seed",
 
244
  maximum=MAX_SEED,
245
  step=1,
246
  value=0,
247
+ visible=True
248
  )
249
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
 
250
  with gr.Row(visible=True):
251
  width = gr.Slider(
252
  label="Width",
253
+ minimum=512,
254
+ maximum=2048,
255
+ step=8,
256
  value=1024,
257
  )
258
  height = gr.Slider(
259
  label="Height",
260
+ minimum=512,
261
+ maximum=2048,
262
+ step=8,
263
  value=1024,
264
  )
265
  with gr.Row():
266
  guidance_scale = gr.Slider(
267
  label="Guidance Scale",
268
  minimum=0.1,
269
+ maximum=20.0,
270
  step=0.1,
271
+ value=6,
272
  )
273
+ with gr.Row(visible=True):
274
+ style_selection = gr.Radio(
275
+ show_label=True,
276
+ container=True,
277
+ interactive=True,
278
+ choices=STYLE_NAMES,
279
+ value=DEFAULT_STYLE_NAME,
280
+ label="Image Style",
281
+ )
282
  gr.Examples(
283
  examples=examples,
284
  inputs=prompt,
 
305
  prompt,
306
  negative_prompt,
307
  use_negative_prompt,
308
+ style_selection,
309
  seed,
310
  width,
311
  height,