Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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."
|