Daankular commited on
Commit
e02e823
·
1 Parent(s): c604238

Skip CPU texture bake fallback: raw mesh passes to rigging instead

Browse files

xatlas CPU bake takes 10+ min, causing ZeroGPU proxy token expiry.
On nvdiffrast failure just copy the raw TripoSG GLB — rigging/animation
don't require a UV-textured mesh. Texture can be improved later.

Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1186,10 +1186,11 @@ def apply_texture(glb_path, input_image, remove_background, variant, tex_seed,
1186
  )
1187
  print("[apply_texture] nvdiffrast texture baking succeeded.")
1188
  except Exception as _nv_err:
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)
 
1186
  )
1187
  print("[apply_texture] nvdiffrast texture baking succeeded.")
1188
  except Exception as _nv_err:
1189
+ # nvdiffrast unavailable on ZeroGPU (error 209); CPU xatlas bake
1190
+ # too slow (~10+ min) for ZeroGPU proxy token lifetime. Use raw mesh.
1191
  print(f"[apply_texture] nvdiffrast baking failed ({type(_nv_err).__name__}): {_nv_err}")
1192
+ print("[apply_texture] Skipping texture bake forwarding raw TripoSG mesh.")
1193
+ shutil.copy(glb_path, out_glb)
1194
 
1195
  final_path = "/tmp/triposg_textured.glb"
1196
  shutil.copy(out_glb, final_path)