PSNbst commited on
Commit
fb13f87
·
verified ·
1 Parent(s): 55fd4b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -20,6 +20,7 @@ QUALITY_PROMPTS = ["cinematic lighting", "sharp shadow", "award-winning", "maste
20
  # Hugging Face DTR 数据集路径(示例,若不可用请忽略)
21
  DTR_DATASET_PATTERN = "https://huggingface.co/datasets/X779/Danbooruwildcards/resolve/main/*DTR*.txt"
22
 
 
23
  # ========== 工具函数 ==========
24
  def load_candidates_from_files(files, excluded_tags=None):
25
  """
@@ -240,7 +241,7 @@ def gradio_interface():
240
  dtr_enabled = gr.Checkbox(label="Enable DTR (如不可用请勿勾选)")
241
 
242
  # 上传文件部分
243
- with gr.Box():
244
  gr.Markdown("**上传文件 (可选):**")
245
  action_file = gr.File(label="Action File", file_types=[".txt"])
246
  style_file = gr.File(label="Style File", file_types=[".txt"])
@@ -264,7 +265,7 @@ def gradio_interface():
264
  )
265
 
266
  # 各种数量
267
- with gr.Box():
268
  gr.Markdown("**随机数量设置:**")
269
  expression_count = gr.Slider(label="Number of Expressions", minimum=0, maximum=10, step=1, value=1)
270
  item_count = gr.Slider(label="Number of Items", minimum=0, maximum=10, step=1, value=1)
@@ -326,9 +327,8 @@ def gradio_interface():
326
  outputs=[favorites_box, favorites_state],
327
  )
328
 
329
- # 整个界面启动
330
  return demo
331
 
332
  # 启动 Gradio 应用(在 Hugging Face Spaces 上只需要保留最后的 launch 即可)
333
  if __name__ == "__main__":
334
- gradio_interface().launch()
 
20
  # Hugging Face DTR 数据集路径(示例,若不可用请忽略)
21
  DTR_DATASET_PATTERN = "https://huggingface.co/datasets/X779/Danbooruwildcards/resolve/main/*DTR*.txt"
22
 
23
+
24
  # ========== 工具函数 ==========
25
  def load_candidates_from_files(files, excluded_tags=None):
26
  """
 
241
  dtr_enabled = gr.Checkbox(label="Enable DTR (如不可用请勿勾选)")
242
 
243
  # 上传文件部分
244
+ with gr.Group(variant="box"):
245
  gr.Markdown("**上传文件 (可选):**")
246
  action_file = gr.File(label="Action File", file_types=[".txt"])
247
  style_file = gr.File(label="Style File", file_types=[".txt"])
 
265
  )
266
 
267
  # 各种数量
268
+ with gr.Group(variant="box"):
269
  gr.Markdown("**随机数量设置:**")
270
  expression_count = gr.Slider(label="Number of Expressions", minimum=0, maximum=10, step=1, value=1)
271
  item_count = gr.Slider(label="Number of Items", minimum=0, maximum=10, step=1, value=1)
 
327
  outputs=[favorites_box, favorites_state],
328
  )
329
 
 
330
  return demo
331
 
332
  # 启动 Gradio 应用(在 Hugging Face Spaces 上只需要保留最后的 launch 即可)
333
  if __name__ == "__main__":
334
+ gradio_interface().launch()