mpatel57 commited on
Commit
30af39b
Β·
verified Β·
1 Parent(s): 81ccb79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -67,6 +67,8 @@ def process_image(
67
  optimization_steps=optimization_steps,
68
  ).images[0]
69
  pipe.vae = pipe.vae.to(torch.float16)
 
 
70
  return result, f"βœ… Inpainting completed with seed {seed}."
71
  elif mode == "Editing":
72
  if not edit_prompt:
@@ -94,6 +96,8 @@ def process_image(
94
  negative_prompt=prompt,
95
  source_steps=max_source_steps,
96
  ).images[0]
 
 
97
  return result, f"βœ… Editing completed with seed {seed}."
98
  else:
99
  return None, f"❌ Invalid mode selected."
 
67
  optimization_steps=optimization_steps,
68
  ).images[0]
69
  pipe.vae = pipe.vae.to(torch.float16)
70
+ torch.cuda.empty_cache()
71
+
72
  return result, f"βœ… Inpainting completed with seed {seed}."
73
  elif mode == "Editing":
74
  if not edit_prompt:
 
96
  negative_prompt=prompt,
97
  source_steps=max_source_steps,
98
  ).images[0]
99
+ torch.cuda.empty_cache()
100
+
101
  return result, f"βœ… Editing completed with seed {seed}."
102
  else:
103
  return None, f"❌ Invalid mode selected."