Krebzonide commited on
Commit
5626083
·
1 Parent(s): 75f237b

added examples

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -71,7 +71,24 @@ def set_base_model(base_model_id):
71
 
72
  def update_pixel_ratio(height, width):
73
  return round(height*width/1048576,3)
74
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  with gr.Blocks(css=css) as demo:
76
  with gr.Column():
77
  prompt = gr.Textbox(label="Prompt")
@@ -88,6 +105,7 @@ with gr.Blocks(css=css) as demo:
88
  pixels = gr.Number(label="Pixel Ratio", value=1, interactive=False)
89
  seed = gr.Number(label="Seed", value=-1, minimum=-1, precision=0)
90
  gallery = gr.Gallery(label="Generated images", height=800)
 
91
  submit_btn.click(generate, [prompt, negative_prompt, samp_steps, guide_scale, batch_size, seed, height, width], [gallery], queue=True)
92
  height.change(update_pixel_ratio, [height, width], [pixels], queue=False)
93
  width.change(update_pixel_ratio, [height, width], [pixels], queue=False)
 
71
 
72
  def update_pixel_ratio(height, width):
73
  return round(height*width/1048576,3)
74
+
75
+ examples = [
76
+ ['A serious capybara at work, wearing a suit',
77
+ 'low quality'],
78
+ ['a graffiti of a robot serving meals to people',
79
+ 'low quality'],
80
+ ['photo of a small cozy modern house in red woods on a mountain, solar panels, garage, driveway, great view, sunshine',
81
+ 'red house'],
82
+ ['cinematic photo of a woman sitting at a cafe. 35mm photograph, film, bokeh, professional, 4k, highly detailede',
83
+ 'drawing, painting, crayon, sketch, graphite, impressionist, noisy, blurry, soft, deformed, ugly'],
84
+ ['analog film photo of old woman on the streets of london . faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage',
85
+ 'painting, drawing, illustration, glitch, deformed, mutated, cross-eyed, ugly, disfigured'],
86
+ ['nude photo of a 20 year old model in the back seat of a car',
87
+ 'big boobs'],
88
+ ['nude photo of a 20 year old man, penis and testicles, dick and balls, erection',
89
+ 'woman']
90
+ ]
91
+
92
  with gr.Blocks(css=css) as demo:
93
  with gr.Column():
94
  prompt = gr.Textbox(label="Prompt")
 
105
  pixels = gr.Number(label="Pixel Ratio", value=1, interactive=False)
106
  seed = gr.Number(label="Seed", value=-1, minimum=-1, precision=0)
107
  gallery = gr.Gallery(label="Generated images", height=800)
108
+ ex = gr.Examples(examples=examples, input=[prompt, negative_prompt])
109
  submit_btn.click(generate, [prompt, negative_prompt, samp_steps, guide_scale, batch_size, seed, height, width], [gallery], queue=True)
110
  height.change(update_pixel_ratio, [height, width], [pixels], queue=False)
111
  width.change(update_pixel_ratio, [height, width], [pixels], queue=False)