RageshAntony commited on
Commit
886f105
·
verified ·
1 Parent(s): a0e45a8

added spaces

Browse files
Files changed (1) hide show
  1. check_app.py +4 -3
check_app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import torch
2
  from diffusers import (
3
  FluxPipeline,
@@ -87,9 +88,9 @@ def generate_image_with_progress(pipe, prompt, num_steps, guidance_scale=None, s
87
 
88
  return image
89
 
90
-
91
  def create_pipeline_logic(model_name, config):
92
- def logic(prompt_text):
93
  print(f"starting {model_name}")
94
  progress = gr.Progress()
95
  num_steps = 30
@@ -123,7 +124,7 @@ def main():
123
  img = gr.Image(label=model_name, height=300)
124
 
125
  logic = create_pipeline_logic(model_name, config)
126
- button.click(fn=logic, inputs=[prompt_text], outputs=[output, img])
127
 
128
  app.launch()
129
 
 
1
+ import spaces
2
  import torch
3
  from diffusers import (
4
  FluxPipeline,
 
88
 
89
  return image
90
 
91
+ @spaces.GPU(duration=170)
92
  def create_pipeline_logic(model_name, config):
93
+ def start_process(prompt_text):
94
  print(f"starting {model_name}")
95
  progress = gr.Progress()
96
  num_steps = 30
 
124
  img = gr.Image(label=model_name, height=300)
125
 
126
  logic = create_pipeline_logic(model_name, config)
127
+ button.click(fn=start_process, inputs=[prompt_text], outputs=[output, img])
128
 
129
  app.launch()
130