Spaces:
Running on Zero
Running on Zero
Increase apply_texture GPU duration to 600s; use 512px UV in CPU fallback
Browse filesCPU xatlas texture bake takes ~5-10 min for a dense mesh, exceeding the
old duration=300 limit and causing GPU task abort. Also reduce fallback
uv_size from 1024 to 512 to halve bake time (~4x fewer texels).
app.py
CHANGED
|
@@ -1024,7 +1024,7 @@ def _bake_texture_cpu(glb_path: str, mv_views: list, out_path: str,
|
|
| 1024 |
|
| 1025 |
# ββ Stage 2: Texture ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1026 |
|
| 1027 |
-
@spaces.GPU(duration=
|
| 1028 |
def apply_texture(glb_path, input_image, remove_background, variant, tex_seed,
|
| 1029 |
enhance_face, rembg_threshold=0.5, rembg_erode=2,
|
| 1030 |
progress=gr.Progress()):
|
|
@@ -1189,7 +1189,7 @@ def apply_texture(glb_path, input_image, remove_background, variant, tex_seed,
|
|
| 1189 |
# Fallback: CPU xatlas UV-unwrap + per-face numpy projection
|
| 1190 |
print(f"[apply_texture] nvdiffrast baking failed ({type(_nv_err).__name__}): {_nv_err}")
|
| 1191 |
print("[apply_texture] Falling back to CPU xatlas texture bake...")
|
| 1192 |
-
_bake_texture_cpu(glb_path, mv_views, out_glb)
|
| 1193 |
|
| 1194 |
final_path = "/tmp/triposg_textured.glb"
|
| 1195 |
shutil.copy(out_glb, final_path)
|
|
|
|
| 1024 |
|
| 1025 |
# ββ Stage 2: Texture ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1026 |
|
| 1027 |
+
@spaces.GPU(duration=600)
|
| 1028 |
def apply_texture(glb_path, input_image, remove_background, variant, tex_seed,
|
| 1029 |
enhance_face, rembg_threshold=0.5, rembg_erode=2,
|
| 1030 |
progress=gr.Progress()):
|
|
|
|
| 1189 |
# Fallback: CPU xatlas UV-unwrap + per-face numpy projection
|
| 1190 |
print(f"[apply_texture] nvdiffrast baking failed ({type(_nv_err).__name__}): {_nv_err}")
|
| 1191 |
print("[apply_texture] Falling back to CPU xatlas texture bake...")
|
| 1192 |
+
_bake_texture_cpu(glb_path, mv_views, out_glb, uv_size=512)
|
| 1193 |
|
| 1194 |
final_path = "/tmp/triposg_textured.glb"
|
| 1195 |
shutil.copy(out_glb, final_path)
|