ehristoforu commited on
Commit
e0a1f6f
1 Parent(s): 809d957

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -107,11 +107,15 @@ css = """
107
  theme = "Base"
108
 
109
  with gr.Blocks(css=css) as demo:
110
-
 
 
 
 
111
  with gr.Row():
112
  with gr.Column(scale=6, min_width=600):
113
- prompt = gr.Textbox("puppies in a cloud, 4k", placeholder="Prompt", show_label=False, lines=3)
114
- negative_prompt = gr.Textbox(placeholder="Negative Prompt", show_label=False, lines=3)
115
  with gr.Column():
116
  text_button = gr.Button("Generate", variant='primary', elem_id="generate")
117
  with gr.Row():
@@ -123,7 +127,7 @@ with gr.Blocks(css=css) as demo:
123
  with gr.Tab("Generation"):
124
  with gr.Row():
125
  with gr.Column(scale=1):
126
- sampler = gr.Dropdown(value="Euler a", show_label=True, label="Sampling Method", choices=[
127
  "Euler",
128
  "Euler a",
129
  "LMS",
@@ -146,7 +150,7 @@ with gr.Blocks(css=css) as demo:
146
  ])
147
 
148
  with gr.Column(scale=1):
149
- steps = gr.Slider(label="Sampling Steps", minimum=1, maximum=50, value=25, step=1)
150
 
151
  with gr.Row():
152
  with gr.Column(scale=1):
@@ -155,14 +159,15 @@ with gr.Blocks(css=css) as demo:
155
 
156
  with gr.Column(scale=1):
157
  batch_size = gr.Slider(label="Batch Size", maximum=1, value=1)
158
- batch_count = gr.Slider(label="Batch Count", maximum=1, value=1)
159
 
160
  cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, value=7, step=1)
161
- seed = gr.Number(label="Seed", value=-1)
162
 
163
 
164
  with gr.Column(scale=2):
165
- image_output = gr.Image()
 
166
 
167
  text_button.click(flip_text, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed], outputs=image_output)
168
 
 
107
  theme = "Base"
108
 
109
  with gr.Blocks(css=css) as demo:
110
+ with gr.Row():
111
+ gr.Markdown("""
112
+ <h1><center>Stable Diffusion</center></h1>
113
+
114
+ """)
115
  with gr.Row():
116
  with gr.Column(scale=6, min_width=600):
117
+ prompt = gr.Textbox(label="Prompt", placeholder="beautiful cat, 8k", show_label=False, lines=2)
118
+ negative_prompt = gr.Textbox(label="Negative Prompt", value="text, blurry, fuzziness", placeholder="What you don't want to see in the image", show_label=False, lines=3)
119
  with gr.Column():
120
  text_button = gr.Button("Generate", variant='primary', elem_id="generate")
121
  with gr.Row():
 
127
  with gr.Tab("Generation"):
128
  with gr.Row():
129
  with gr.Column(scale=1):
130
+ sampler = gr.Dropdown(value="DPM++ SDE", show_label=True, label="Sampler", choices=[
131
  "Euler",
132
  "Euler a",
133
  "LMS",
 
150
  ])
151
 
152
  with gr.Column(scale=1):
153
+ steps = gr.Slider(label="Steps", minimum=1, maximum=50, value=25, step=1)
154
 
155
  with gr.Row():
156
  with gr.Column(scale=1):
 
159
 
160
  with gr.Column(scale=1):
161
  batch_size = gr.Slider(label="Batch Size", maximum=1, value=1)
162
+ batch_count = gr.Slider(label="Batch Count", maximum=4, minimum=1, value=2, step=1)
163
 
164
  cfg_scale = gr.Slider(label="CFG Scale", minimum=1, maximum=20, value=7, step=1)
165
+ seed = gr.Number(label="Seed", value=-1, info = """'-1' is a random seed""")
166
 
167
 
168
  with gr.Column(scale=2):
169
+ image_output = gr.Gallery(label="Result Image(s)", show_download_button=False, show_share_button=True)
170
+
171
 
172
  text_button.click(flip_text, inputs=[prompt, negative_prompt, model, steps, sampler, cfg_scale, width, height, seed], outputs=image_output)
173