prithivMLmods commited on
Commit
57709d9
1 Parent(s): b2d039c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +66 -58
app.py CHANGED
@@ -122,6 +122,7 @@ footer {
122
  visibility: hidden
123
  }
124
  '''
 
125
  with gr.Blocks(css=css, theme="prithivMLmods/Minecraft-Theme") as demo:
126
  gr.Markdown(DESCRIPTIONx)
127
  with gr.Row():
@@ -136,75 +137,82 @@ with gr.Blocks(css=css, theme="prithivMLmods/Minecraft-Theme") as demo:
136
  result = gr.Image(label="Result", show_label=False)
137
 
138
  with gr.Row(visible=True):
139
- grid_size_selection = gr.Dropdown(
140
- choices=["2x1", "1x2", "2x2", "2x3", "3x2", "1x1"],
141
- value="1x1",
142
- label="Grid Size"
143
- )
144
 
145
  with gr.Row(visible=True):
146
- style_selection = gr.Radio(
147
- show_label=True,
148
- container=True,
149
- interactive=True,
150
- choices=STYLE_NAMES,
151
- value=DEFAULT_STYLE_NAME,
152
- label="Quality Style",
153
- )
154
 
155
  with gr.Accordion("Advanced Settings", open=False):
156
- negative_prompt = gr.Text(
157
- label="Negative prompt",
158
- max_lines=1,
159
- placeholder="Enter a negative prompt",
160
- visible=False,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  )
162
 
163
- seed = gr.Slider(
164
- label="Seed",
165
- minimum=0,
166
- maximum=MAX_SEED,
167
- step=1,
168
- value=0,
169
  )
170
 
171
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
172
-
173
  with gr.Row():
174
- width = gr.Slider(
175
- label="Width",
176
- minimum=512,
177
- maximum=MAX_IMAGE_SIZE,
178
- step=32,
179
- value=1024,
180
- )
181
-
182
- height = gr.Slider(
183
- label="Height",
184
- minimum=512,
185
- maximum=MAX_IMAGE_SIZE,
186
- step=32,
187
- value=1024,
188
- )
189
 
190
- with gr.Row():
191
- guidance_scale = gr.Slider(
192
- label="Guidance scale",
193
- minimum=0.0,
194
- maximum=7.5,
195
- step=0.1,
196
- value=0.0,
197
- )
198
-
199
- num_inference_steps = gr.Slider(
200
- label="Number of inference steps",
201
- minimum=1,
202
- maximum=50,
203
- step=1,
204
- value=4,
205
- )
206
 
207
- gr.Examples(examples=examples, inputs=[prompt], outputs=[result, seed], fn=infer, cache_examples=True, cache_mode="lazy")
 
 
 
 
 
 
 
208
 
209
  gr.on(
210
  triggers=[run_button.click, prompt.submit],
 
122
  visibility: hidden
123
  }
124
  '''
125
+
126
  with gr.Blocks(css=css, theme="prithivMLmods/Minecraft-Theme") as demo:
127
  gr.Markdown(DESCRIPTIONx)
128
  with gr.Row():
 
137
  result = gr.Image(label="Result", show_label=False)
138
 
139
  with gr.Row(visible=True):
140
+ grid_size_selection = gr.Dropdown(
141
+ choices=["2x1", "1x2", "2x2", "2x3", "3x2", "1x1"],
142
+ value="1x1",
143
+ label="Grid Size"
144
+ )
145
 
146
  with gr.Row(visible=True):
147
+ style_selection = gr.Radio(
148
+ show_label=True,
149
+ container=True,
150
+ interactive=True,
151
+ choices=STYLE_NAMES,
152
+ value=DEFAULT_STYLE_NAME,
153
+ label="Quality Style",
154
+ )
155
 
156
  with gr.Accordion("Advanced Settings", open=False):
157
+ negative_prompt = gr.Text(
158
+ label="Negative prompt",
159
+ max_lines=1,
160
+ placeholder="Enter a negative prompt",
161
+ visible=False,
162
+ )
163
+
164
+ seed = gr.Slider(
165
+ label="Seed",
166
+ minimum=0,
167
+ maximum=MAX_SEED,
168
+ step=1,
169
+ value=0,
170
+ )
171
+
172
+ randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
173
+
174
+ with gr.Row():
175
+ width = gr.Slider(
176
+ label="Width",
177
+ minimum=512,
178
+ maximum=MAX_IMAGE_SIZE,
179
+ step=32,
180
+ value=1024,
181
  )
182
 
183
+ height = gr.Slider(
184
+ label="Height",
185
+ minimum=512,
186
+ maximum=MAX_IMAGE_SIZE,
187
+ step=32,
188
+ value=1024,
189
  )
190
 
 
 
191
  with gr.Row():
192
+ guidance_scale = gr.Slider(
193
+ label="Guidance scale",
194
+ minimum=0.0,
195
+ maximum=7.5,
196
+ step=0.1,
197
+ value=0.0,
198
+ )
 
 
 
 
 
 
 
 
199
 
200
+ num_inference_steps = gr.Slider(
201
+ label="Number of inference steps",
202
+ minimum=1,
203
+ maximum=50,
204
+ step=1,
205
+ value=4,
206
+ )
 
 
 
 
 
 
 
 
 
207
 
208
+ gr.Examples(
209
+ examples=examples,
210
+ inputs=[prompt],
211
+ outputs=[result, seed],
212
+ fn=infer,
213
+ cache_examples=True,
214
+ cache_mode="lazy"
215
+ )
216
 
217
  gr.on(
218
  triggers=[run_button.click, prompt.submit],