Yinhong Liu
commited on
Commit
·
fdf14cf
1
Parent(s):
676a9c3
empty cuda
Browse files- app.py +4 -0
- sid/pipeline_sid_sd3.py +1 -0
app.py
CHANGED
|
@@ -79,6 +79,10 @@ def infer(
|
|
| 79 |
generator=generator,
|
| 80 |
time_scale=time_scale,
|
| 81 |
).images[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
return image, seed
|
| 84 |
|
|
|
|
| 79 |
generator=generator,
|
| 80 |
time_scale=time_scale,
|
| 81 |
).images[0]
|
| 82 |
+
|
| 83 |
+
pipe.maybe_free_model_hooks()
|
| 84 |
+
torch.cuda.empty_cache()
|
| 85 |
+
del pipe
|
| 86 |
|
| 87 |
return image, seed
|
| 88 |
|
sid/pipeline_sid_sd3.py
CHANGED
|
@@ -807,6 +807,7 @@ class SiDSD3Pipeline(
|
|
| 807 |
image = self.image_processor.postprocess(image, output_type=output_type)
|
| 808 |
|
| 809 |
self.maybe_free_model_hooks()
|
|
|
|
| 810 |
|
| 811 |
# 6. Return output
|
| 812 |
if not return_dict:
|
|
|
|
| 807 |
image = self.image_processor.postprocess(image, output_type=output_type)
|
| 808 |
|
| 809 |
self.maybe_free_model_hooks()
|
| 810 |
+
|
| 811 |
|
| 812 |
# 6. Return output
|
| 813 |
if not return_dict:
|