Yw22 commited on
Commit
895216a
·
1 Parent(s): 8f811c3
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -288,7 +288,7 @@ class ImageConductor:
288
 
289
  self.blur_kernel = blur_kernel
290
 
291
- @spaces.GPU(duration=200)
292
  def run(self, first_frame_path, tracking_points, prompt, drag_mode, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, personalized, examples_type):
293
  print("Run!")
294
  if examples_type != "":
@@ -402,7 +402,7 @@ def preprocess_image(image, tracking_points):
402
  first_frame_path = os.path.join(output_dir, f"first_frame_{id}.jpg")
403
  image_pil.save(first_frame_path, quality=95)
404
  tracking_points = gr.State([])
405
- return {input_image: first_frame_path, first_frame_path_var: first_frame_path, tracking_points_var: tracking_points}
406
 
407
 
408
  def add_tracking_points(tracking_points, first_frame_path, drag_mode, evt: gr.SelectData): # SelectData is a subclass of EventData
@@ -638,7 +638,7 @@ with block:
638
  gr.Markdown(citation)
639
 
640
 
641
- image_upload_button.upload(preprocess_image, [image_upload_button, tracking_points_var], [input_image, first_frame_path_var, tracking_points_var])
642
 
643
  add_drag_button.click(add_drag, tracking_points_var, tracking_points_var)
644
 
 
288
 
289
  self.blur_kernel = blur_kernel
290
 
291
+ @spaces.GPU(duration=300)
292
  def run(self, first_frame_path, tracking_points, prompt, drag_mode, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, personalized, examples_type):
293
  print("Run!")
294
  if examples_type != "":
 
402
  first_frame_path = os.path.join(output_dir, f"first_frame_{id}.jpg")
403
  image_pil.save(first_frame_path, quality=95)
404
  tracking_points = gr.State([])
405
+ return {input_image: first_frame_path, first_frame_path_var: first_frame_path, tracking_points_var: tracking_points, personalized:""}
406
 
407
 
408
  def add_tracking_points(tracking_points, first_frame_path, drag_mode, evt: gr.SelectData): # SelectData is a subclass of EventData
 
638
  gr.Markdown(citation)
639
 
640
 
641
+ image_upload_button.upload(preprocess_image, [image_upload_button, tracking_points_var], [input_image, first_frame_path_var, tracking_points_var, personalized])
642
 
643
  add_drag_button.click(add_drag, tracking_points_var, tracking_points_var)
644