lzyhha commited on
Commit
feb5d4a
·
1 Parent(s): 8d207a2
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -4,6 +4,7 @@ import demo_tasks
4
  from functools import partial
5
  from data.prefix_instruction import get_layout_instruction
6
  from visualcloze import VisualClozeModel
 
7
 
8
 
9
  max_grid_h = 5
@@ -36,7 +37,7 @@ If you find VisualCloze is helpful, please consider to star ⭐ the <a href='htt
36
  If our work is useful for your research, please consider citing:
37
  ```bibtex
38
  @article{li2025visualcloze,
39
- title={VisualCloze : A Universal Image Generation Framework via Visual In-Context Learning},
40
  author={Li, Zhong-Yu and Du, ruoyi and Yan, Juncheng and Zhuo, Le and Li, Zhen and Gao, Peng and Ma, Zhanyu and Cheng, Ming-Ming},
41
  booktitle={arXiv preprint arxiv:},
42
  year={2025}
@@ -304,6 +305,7 @@ def create_demo(model):
304
  updates.append(gr.update(elem_id="layout_prompt", value=get_layout_instruction(w, actual_h)))
305
  return updates
306
 
 
307
  def generate_image(*inputs):
308
  images = []
309
  for i in range(model.grid_h):
 
4
  from functools import partial
5
  from data.prefix_instruction import get_layout_instruction
6
  from visualcloze import VisualClozeModel
7
+ import spaces
8
 
9
 
10
  max_grid_h = 5
 
37
  If our work is useful for your research, please consider citing:
38
  ```bibtex
39
  @article{li2025visualcloze,
40
+ title={VisualCloze: A Universal Image Generation Framework via Visual In-Context Learning},
41
  author={Li, Zhong-Yu and Du, ruoyi and Yan, Juncheng and Zhuo, Le and Li, Zhen and Gao, Peng and Ma, Zhanyu and Cheng, Ming-Ming},
42
  booktitle={arXiv preprint arxiv:},
43
  year={2025}
 
305
  updates.append(gr.update(elem_id="layout_prompt", value=get_layout_instruction(w, actual_h)))
306
  return updates
307
 
308
+ @spaces.GPU
309
  def generate_image(*inputs):
310
  images = []
311
  for i in range(model.grid_h):