Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -299,8 +299,14 @@ def image_to_3d(trial_id: str, seed: int, randomize_seed: bool, ss_guidance_stre
|
|
299 |
return None, None
|
300 |
|
301 |
return generated_image
|
|
|
|
|
|
|
302 |
finally:
|
303 |
-
|
|
|
|
|
|
|
304 |
|
305 |
def clear_gpu_memory():
|
306 |
"""GPU 메모리를 더 철저하게 정리하는 함수"""
|
@@ -414,9 +420,15 @@ def text_to_image(prompt: str, height: int, width: int, steps: int, scales: floa
|
|
414 |
gc.collect()
|
415 |
|
416 |
return generated_image
|
|
|
|
|
|
|
417 |
finally:
|
418 |
-
|
419 |
-
|
|
|
|
|
|
|
420 |
css = """
|
421 |
footer {
|
422 |
visibility: hidden;
|
|
|
299 |
return None, None
|
300 |
|
301 |
return generated_image
|
302 |
+
except Exception as e:
|
303 |
+
print(f"Error in image generation: {str(e)}")
|
304 |
+
return None
|
305 |
finally:
|
306 |
+
if torch.cuda.is_available():
|
307 |
+
torch.cuda.empty_cache()
|
308 |
+
torch.cuda.synchronize()
|
309 |
+
gc.collect()
|
310 |
|
311 |
def clear_gpu_memory():
|
312 |
"""GPU 메모리를 더 철저하게 정리하는 함수"""
|
|
|
420 |
gc.collect()
|
421 |
|
422 |
return generated_image
|
423 |
+
except Exception as e:
|
424 |
+
print(f"Error in image generation: {str(e)}")
|
425 |
+
return None
|
426 |
finally:
|
427 |
+
if torch.cuda.is_available():
|
428 |
+
torch.cuda.empty_cache()
|
429 |
+
torch.cuda.synchronize()
|
430 |
+
gc.collect()
|
431 |
+
|
432 |
css = """
|
433 |
footer {
|
434 |
visibility: hidden;
|