chenjian commited on
Commit
edf9866
1 Parent(s): dc1bdf4

add new style

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -8,7 +8,7 @@ model = hub.Module(name='ernie_vilg')
8
 
9
  def inference(text_prompts, style):
10
  results = model.generate_image(
11
- text_prompts=text_prompts, style=style)
12
  return results[:6]
13
 
14
 
@@ -159,7 +159,7 @@ with block:
159
  margin=False,
160
  rounded=(False, True, True, False),
161
  )
162
- styles = gr.Dropdown(label="style", choices=['水彩','油画', '粉笔画', '卡通', '蜡笔画', '儿童画'], value='油画')
163
  gallery = gr.Gallery(
164
  label="Generated images", show_label=False, elem_id="gallery"
165
  ).style(grid=[2, 3], height="auto")
@@ -178,15 +178,15 @@ with block:
178
  <div class="prompt">
179
  <p><h4>Prompt公式</h4>
180
  <span> Prompt = [形容词] [主语] ,[细节设定], [修饰语或者艺术家]。 </span>
181
- 关于各部分的构造方式和效果,可以参考<a href="https://github.com/OleNet/YouPromptMe/blob/gh-pages/you-prompt-me/README.md" style="text-decoration: underline;" target="_blank">YouPromptMe指南</a>。
182
  </p>
183
  </div>
184
  <div class="footer">
185
- <p>Model by <a href="https://wenxin.baidu.com" style="text-decoration: underline;" target="_blank">文心大模型</a> and <a href="https://github.com/PaddlePaddle/PaddleHub" style="text-decoration: underline;" target="_blank">PaddleHub</a> - Gradio Demo by 🤗 Hugging Face
186
  </p>
187
  </div>
188
 
189
  """
190
  )
191
 
192
- block.queue(max_size=20).launch()
 
8
 
9
  def inference(text_prompts, style):
10
  results = model.generate_image(
11
+ text_prompts=text_prompts, style=style, visualization=False)
12
  return results[:6]
13
 
14
 
 
159
  margin=False,
160
  rounded=(False, True, True, False),
161
  )
162
+ styles = gr.Dropdown(label="style", choices=['水彩','油画', '粉笔画', '卡通', '蜡笔画', '儿童画', '探索无限'], value='油画')
163
  gallery = gr.Gallery(
164
  label="Generated images", show_label=False, elem_id="gallery"
165
  ).style(grid=[2, 3], height="auto")
 
178
  <div class="prompt">
179
  <p><h4>Prompt公式</h4>
180
  <span> Prompt = [形容词] [主语] ,[细节设定], [修饰语或者艺术家]。 </span>
181
+ 关于各部分的构造方式和效果,可以参考<a href="https://github.com/PaddlePaddle/PaddleHub/tree/develop/modules/image/text_to_image/ernie_vilg#六-prompt-指南" style="text-decoration: underline;" target="_blank">YouPromptMe指南</a>。
182
  </p>
183
  </div>
184
  <div class="footer">
185
+ <p>Model by <a href="https://github.com/PaddlePaddle/PaddleHub" style="text-decoration: underline;" target="_blank">PaddleHub</a> and <a href="https://wenxin.baidu.com" style="text-decoration: underline;" target="_blank">文心大模型</a> - Gradio Demo by 🤗 Hugging Face
186
  </p>
187
  </div>
188
 
189
  """
190
  )
191
 
192
+ block.queue(max_size=100).launch()