AItool commited on
Commit
16dc057
·
verified ·
1 Parent(s): 4982b65

clear any previous output

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -34,6 +34,15 @@ def load_description(path: str) -> str:
34
  return Path(path).read_text(encoding="utf-8")
35
 
36
  def interpolate_image(img_a_path: str, img_b_path: str) -> str:
 
 
 
 
 
 
 
 
 
37
  subprocess.run([
38
  "python3", "inference_img.py",
39
  "--img", str(img_a_path), str(img_b_path),
 
34
  return Path(path).read_text(encoding="utf-8")
35
 
36
  def interpolate_image(img_a_path: str, img_b_path: str) -> str:
37
+ # --- clear any previous output ---
38
+ if OUTPUT_GIF.exists():
39
+ OUTPUT_GIF.unlink() # delete old GIF
40
+ if PALETTE_PNG.exists():
41
+ PALETTE_PNG.unlink() # delete old palette
42
+ # optional: clear any old frame PNGs
43
+ for f in TARGET_DIR.glob("img*.png"):
44
+ f.unlink()
45
+
46
  subprocess.run([
47
  "python3", "inference_img.py",
48
  "--img", str(img_a_path), str(img_b_path),