haodongli commited on
Commit
ddfdb2e
·
1 Parent(s): 3c86beb

Update gradio_demo.py

Browse files
Files changed (1) hide show
  1. gradio_demo.py +8 -2
gradio_demo.py CHANGED
@@ -55,8 +55,14 @@ def main(prompt, init_prompt, negative_prompt, num_iter, CFG, seed):
55
  op.iterations = num_iter
56
  gp.guidance_scale = CFG
57
  gp.noise_seed = int(seed)
58
- lp.workspace = 'gradio_demo'
59
- video_path = start_training(args, lp, op, pp, gcp, gp)
 
 
 
 
 
 
60
  return gr.Video(value=video_path, autoplay=True)
61
 
62
  with gr.Blocks() as demo:
 
55
  op.iterations = num_iter
56
  gp.guidance_scale = CFG
57
  gp.noise_seed = int(seed)
58
+ if os.environ.get('QUEUE_1') != "True":
59
+ os.environ['QUEUE_1'] = "True"
60
+ lp.workspace = 'gradio_demo_1'
61
+ video_path = start_training(args, lp, op, pp, gcp, gp)
62
+ os.environ['QUEUE_1'] = "False"
63
+ else:
64
+ lp.workspace = 'gradio_demo_2'
65
+ video_path = start_training(args, lp, op, pp, gcp, gp)
66
  return gr.Video(value=video_path, autoplay=True)
67
 
68
  with gr.Blocks() as demo: