Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -98,7 +98,8 @@ def infer(prompt, neg, seed, rand, w, h, cfg, steps, scheduler_type,
|
|
| 98 |
history.insert(0, (img, caption_text))
|
| 99 |
progress(1.0, desc="Done!")
|
| 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 |
|
|
@@ -253,7 +254,7 @@ window.addEventListener('load', () => {
|
|
| 253 |
fo.setAttribute('width', '100%'); // SVG 内の表示エリア幅に合わせて調整
|
| 254 |
fo.setAttribute('height', '100%'); // SVG 内の表示エリア高さに合わせて調整
|
| 255 |
fo.setAttribute('x', '0');
|
| 256 |
-
fo.setAttribute('y', '
|
| 257 |
|
| 258 |
// HTML 部分を innerHTML で一発挿入
|
| 259 |
fo.innerHTML = `
|
|
@@ -282,7 +283,7 @@ window.addEventListener('load', () => {
|
|
| 282 |
</script>
|
| 283 |
"""
|
| 284 |
)
|
| 285 |
-
img_out = gr.Image(interactive=None)
|
| 286 |
state = gr.State([])
|
| 287 |
history_gallery = gr.Gallery(
|
| 288 |
label="生成履歴",
|
|
@@ -290,10 +291,11 @@ window.addEventListener('load', () => {
|
|
| 290 |
height=280,
|
| 291 |
show_label=False,
|
| 292 |
interactive=None,
|
| 293 |
-
type="auto"
|
|
|
|
| 294 |
)
|
| 295 |
# テーブル部分だけを下にまとめて生HTMLレンダー
|
| 296 |
-
history_tables = gr.HTML()
|
| 297 |
|
| 298 |
run.click(
|
| 299 |
fn=infer,
|
|
|
|
| 98 |
history.insert(0, (img, caption_text))
|
| 99 |
progress(1.0, desc="Done!")
|
| 100 |
|
| 101 |
+
# gallery_items = [(item[0], make_html_table(item[1])) for item in history]
|
| 102 |
+
gallery_items = [(item[0], item[1]) for item in history]
|
| 103 |
tables_html = "".join(f'<div style="margin-bottom:12px">{make_html_table(item[1])}</div>' for item in history)
|
| 104 |
return img, gallery_items
|
| 105 |
|
|
|
|
| 254 |
fo.setAttribute('width', '100%'); // SVG 内の表示エリア幅に合わせて調整
|
| 255 |
fo.setAttribute('height', '100%'); // SVG 内の表示エリア高さに合わせて調整
|
| 256 |
fo.setAttribute('x', '0');
|
| 257 |
+
fo.setAttribute('y', '-200');
|
| 258 |
|
| 259 |
// HTML 部分を innerHTML で一発挿入
|
| 260 |
fo.innerHTML = `
|
|
|
|
| 283 |
</script>
|
| 284 |
"""
|
| 285 |
)
|
| 286 |
+
img_out = gr.Image(interactive=None,value=[])
|
| 287 |
state = gr.State([])
|
| 288 |
history_gallery = gr.Gallery(
|
| 289 |
label="生成履歴",
|
|
|
|
| 291 |
height=280,
|
| 292 |
show_label=False,
|
| 293 |
interactive=None,
|
| 294 |
+
type="auto",
|
| 295 |
+
value=[]
|
| 296 |
)
|
| 297 |
# テーブル部分だけを下にまとめて生HTMLレンダー
|
| 298 |
+
history_tables = gr.HTML(value="")
|
| 299 |
|
| 300 |
run.click(
|
| 301 |
fn=infer,
|