cocoat commited on
Commit
9a2d25d
·
verified ·
1 Parent(s): bbb33ee
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -55,9 +55,12 @@ def make_html_table(caption):
55
  return html
56
 
57
  def update_history(img, gallery_items):
58
- # tables_html を作って返す
 
 
 
59
  return tables_html
60
-
61
  def infer(prompt, neg, seed, rand, w, h, cfg, steps, scheduler_type,
62
  progress=gr.Progress(track_tqdm=True)):
63
  if rand:
@@ -97,7 +100,7 @@ def infer(prompt, neg, seed, rand, w, h, cfg, steps, scheduler_type,
97
 
98
  gallery_items = [(item[0], make_html_table(item[1])) for item in history]
99
  tables_html = "".join(f'<div style="margin-bottom:12px">{make_html_table(item[1])}</div>' for item in history)
100
- return img, gallery_items, tables_html
101
 
102
  # CSS 設定(ダークモード強制防止+カフェ風テーマ)
103
  css = """
@@ -292,9 +295,9 @@ window.addEventListener('load', () => {
292
  inputs=[prompt, neg, seed_sl, rand, width, height, cfg, steps, scheduler_type],
293
  outputs=[img_out, history_gallery]
294
  ).then(
295
- fn=update_history,
296
- inputs=[img_out, history_gallery],
297
- outputs=[history_tables]
298
  )
299
 
300
  # ページロード時に history から初期表示
 
55
  return html
56
 
57
  def update_history(img, gallery_items):
58
+ tables_html = "".join(
59
+ f'<div style="margin-bottom:12px">{make_html_table(item[1])}</div>'
60
+ for item in history
61
+ )
62
  return tables_html
63
+
64
  def infer(prompt, neg, seed, rand, w, h, cfg, steps, scheduler_type,
65
  progress=gr.Progress(track_tqdm=True)):
66
  if rand:
 
100
 
101
  gallery_items = [(item[0], make_html_table(item[1])) for item in history]
102
  tables_html = "".join(f'<div style="margin-bottom:12px">{make_html_table(item[1])}</div>' for item in history)
103
+ return img, gallery_items
104
 
105
  # CSS 設定(ダークモード強制防止+カフェ風テーマ)
106
  css = """
 
295
  inputs=[prompt, neg, seed_sl, rand, width, height, cfg, steps, scheduler_type],
296
  outputs=[img_out, history_gallery]
297
  ).then(
298
+ fn=update_history,
299
+ inputs=[img_out, history_gallery],
300
+ outputs=[history_tables]
301
  )
302
 
303
  # ページロード時に history から初期表示