Spaces:
orrinin
/
Runtime error

orrinin commited on
Commit
657a746
·
verified ·
1 Parent(s): 11d8762

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -25
app.py CHANGED
@@ -83,8 +83,8 @@ def apply_style(style_name: str, positive: str) -> Tuple[str]:
83
  def generate(
84
  prompt: str,
85
  seed: int = 0,
86
- width: int = 512,
87
- height: int = 512,
88
  style: str = DEFAULT_STYLE_NAME,
89
  num_images: int = 2,
90
  randomize_seed: bool = False,
@@ -166,37 +166,39 @@ with gr.Blocks(css=CSS, theme="soft") as demo:
166
  with gr.Row(visible=True):
167
  width = gr.Slider(
168
  label="宽",
169
- minimum=512,
170
- maximum=1024,
171
  step=8,
172
- value=512,
173
  )
174
  height = gr.Slider(
175
  label="高",
176
- minimum=512,
177
- maximum=1024,
178
  step=8,
179
- value=512,
180
  )
181
  with gr.Row(visible=True):
182
- style_selection = gr.Radio(
183
- show_label=True,
184
- container=True,
185
- interactive=True,
186
- choices=STYLE_NAMES,
187
- value=DEFAULT_STYLE_NAME,
188
- label="风格化",
189
- )
190
 
191
-
192
- gr.Examples(
193
- examples=examples,
194
- inputs=prompt,
195
- outputs=[result, seed],
196
- fn=generate,
197
- cache_examples='lazy',
198
- )
199
- gr.Markdown(LICENSE)
 
 
200
 
201
  gr.on(
202
  triggers=[
 
83
  def generate(
84
  prompt: str,
85
  seed: int = 0,
86
+ width: int = 1024,
87
+ height: int = 1024,
88
  style: str = DEFAULT_STYLE_NAME,
89
  num_images: int = 2,
90
  randomize_seed: bool = False,
 
166
  with gr.Row(visible=True):
167
  width = gr.Slider(
168
  label="宽",
169
+ minimum=640,
170
+ maximum=1280,
171
  step=8,
172
+ value=1024,
173
  )
174
  height = gr.Slider(
175
  label="高",
176
+ minimum=640,
177
+ maximum=1280,
178
  step=8,
179
+ value=1024,
180
  )
181
  with gr.Row(visible=True):
182
+ style_selection = gr.Radio(
183
+ show_label=True,
184
+ container=True,
185
+ interactive=True,
186
+ choices=STYLE_NAMES,
187
+ value=DEFAULT_STYLE_NAME,
188
+ label="风格化",
189
+ )
190
 
191
+ with gr.Row():
192
+ gr.Examples(
193
+ examples=examples,
194
+ inputs=prompt,
195
+ outputs=[result, seed],
196
+ fn=generate,
197
+ cache_examples='lazy',
198
+ label="示例",
199
+ )
200
+ with gr.Row():
201
+ gr.Markdown(LICENSE)
202
 
203
  gr.on(
204
  triggers=[