JiantaoLin
commited on
Commit
·
08b5826
1
Parent(s):
dc89c53
new
Browse files
app.py
CHANGED
@@ -151,7 +151,7 @@ def text_to_detailed(prompt, seed=None):
|
|
151 |
|
152 |
@spaces.GPU(duration=120)
|
153 |
def text_to_image(prompt, seed=None, strength=1.0,lora_scale=1.0, num_inference_steps=20, redux_hparam=None, init_image=None, **kwargs):
|
154 |
-
subprocess.run("rm -rf /data-nvme/zerogpu-offload/*", env={}, shell=True)
|
155 |
# print(f"Before text_to_image: {torch.cuda.memory_allocated() / 1024**3} GB")
|
156 |
k3d_wrapper.renew_uuid()
|
157 |
init_image = None
|
@@ -237,12 +237,6 @@ def bundle_image_to_mesh(
|
|
237 |
|
238 |
if if_video:
|
239 |
video_path = recon_mesh_path.replace('.obj','.mp4').replace('.glb','.mp4')
|
240 |
-
# # 检查这个video_path文件大小是是否超过50KB,不超过的话就认为是空文件,需要重新渲染
|
241 |
-
# if os.path.exists(video_path):
|
242 |
-
# print(f"file size:{os.path.getsize(video_path)}")
|
243 |
-
# if os.path.getsize(video_path) > 50*1024:
|
244 |
-
# print(f"video path:{video_path}")
|
245 |
-
# return video_path
|
246 |
render_video_from_obj(recon_mesh_path, video_path)
|
247 |
print(f"After bundle_image_to_mesh: {torch.cuda.memory_allocated() / 1024**3} GB")
|
248 |
return video_path
|
|
|
151 |
|
152 |
@spaces.GPU(duration=120)
|
153 |
def text_to_image(prompt, seed=None, strength=1.0,lora_scale=1.0, num_inference_steps=20, redux_hparam=None, init_image=None, **kwargs):
|
154 |
+
# subprocess.run("rm -rf /data-nvme/zerogpu-offload/*", env={}, shell=True)
|
155 |
# print(f"Before text_to_image: {torch.cuda.memory_allocated() / 1024**3} GB")
|
156 |
k3d_wrapper.renew_uuid()
|
157 |
init_image = None
|
|
|
237 |
|
238 |
if if_video:
|
239 |
video_path = recon_mesh_path.replace('.obj','.mp4').replace('.glb','.mp4')
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
render_video_from_obj(recon_mesh_path, video_path)
|
241 |
print(f"After bundle_image_to_mesh: {torch.cuda.memory_allocated() / 1024**3} GB")
|
242 |
return video_path
|