Lifeinhockey commited on
Commit
9738dce
·
verified ·
1 Parent(s): a20297c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -4
app.py CHANGED
@@ -69,8 +69,8 @@ def infer(
69
  height=512,
70
  num_inference_steps=20,
71
  model_id='stable-diffusion-v1-5/stable-diffusion-v1-5',
72
- seed=42,
73
- guidance_scale=7.0,
74
  lora_scale=0.5,
75
  progress=gr.Progress(track_tqdm=True)
76
  ):
@@ -103,6 +103,20 @@ def infer(
103
 
104
  return pipe(**params).images[0]
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  css = """
107
  #col-container {
108
  margin: 0 auto;
@@ -158,7 +172,7 @@ with gr.Blocks(css=css) as demo:
158
  minimum=0,
159
  maximum=MAX_SEED,
160
  step=1,
161
- value=42,
162
  )
163
 
164
  with gr.Row():
@@ -167,7 +181,7 @@ with gr.Blocks(css=css) as demo:
167
  minimum=1,
168
  maximum=50,
169
  step=1,
170
- value=20,
171
  )
172
 
173
  with gr.Accordion("Optional Settings", open=False):
@@ -189,6 +203,9 @@ with gr.Blocks(css=css) as demo:
189
  value=512,
190
  )
191
 
 
 
 
192
  run_button = gr.Button("Run", scale=1, variant="primary")
193
  result = gr.Image(label="Result", show_label=False)
194
 
 
69
  height=512,
70
  num_inference_steps=20,
71
  model_id='stable-diffusion-v1-5/stable-diffusion-v1-5',
72
+ seed=4,
73
+ guidance_scale=7.5,
74
  lora_scale=0.5,
75
  progress=gr.Progress(track_tqdm=True)
76
  ):
 
103
 
104
  return pipe(**params).images[0]
105
 
106
+ examples = [
107
+ "Young man in anime style. The image is of high sharpness and resolution. A handsome, thoughtful man. The man is depicted in the foreground, close-up or middle plan. The background is blurry, not sharp. The play of light and shadow is visible on the face and clothes."
108
+ "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k.",
109
+ "An astronaut riding a green horse.",
110
+ "A delicious ceviche cheesecake slice.",
111
+ "A futuristic sports car is located on the surface of Mars. Stars, planets, mountains and craters are visible.",
112
+ ]
113
+
114
+ examples_negative = [
115
+ "blurred details, low resolution, poor image of a man's face, poor quality, artifacts, black and white image"
116
+ "blurry details, low resolution, poorly defined edges",
117
+ "bad face, bad quality, artifacts, low-res, black and white",
118
+ ]
119
+
120
  css = """
121
  #col-container {
122
  margin: 0 auto;
 
172
  minimum=0,
173
  maximum=MAX_SEED,
174
  step=1,
175
+ value=4,
176
  )
177
 
178
  with gr.Row():
 
181
  minimum=1,
182
  maximum=50,
183
  step=1,
184
+ value=30,
185
  )
186
 
187
  with gr.Accordion("Optional Settings", open=False):
 
203
  value=512,
204
  )
205
 
206
+ gr.Examples(examples=examples, inputs=[prompt])
207
+ gr.Examples(examples=examples_negative, inputs=[negative_prompt])
208
+
209
  run_button = gr.Button("Run", scale=1, variant="primary")
210
  result = gr.Image(label="Result", show_label=False)
211