- render_utils_rl.to_glb: fill_holes_num_views 1000 -> 200
- render_utils_rl.to_glb: render_multiview nviews 100 -> 50
- postprocessing_utils.bake_texture: Adam steps 2500 -> 500
- app.py: default simplify 0.95 -> 0.90 (smaller mesh = faster everything)
These should cut GLB bake time from ~60-80s to ~20-30s,
keeping the total @GPU callback well under the 120s limit.
revert: disable NeAR main-process preload; restore torchvision weights=...
NeAR CPU preload via hdri_encoder.py hack broke ZeroGPU again.
Revert to the working pattern:
- hdri_encoder.py: restore convnext_tiny(weights=ConvNeXt_Tiny_Weights...)
- app.py: do NOT preload NeAR in main process (snapshot_download only)
UI title, frame defaults, and split videos/glb architecture are kept.
fix: enable NeAR CPU preload by bypassing torchvision weights CUDA init
- hdri_encoder.py: replace torchvision.convnext_tiny(weights=...) with
weights=None + manual torch.load(map_location='cpu', weights_only=True).
torchvision's weights enum triggered torch._C._cuda_init even when the
checkpoint was already cached, breaking ZeroGPU's main-process isolation.
- app.py: re-enable NeAR CPU preload in _preload_worker. With convnext
fixed, NeAR can safely load in the background thread like Hunyuan3D,
eliminating the ~25s from_pretrained penalty on every @GPU click.
fix(zerogpu): lazy-import nvdiffrast in postprocessing_utils
`import nvdiffrast.torch as dr` at module top level triggered CUDA init
in the main process via the import chain:
app.py
→ trellis.pipelines.NeARImageToRelightable3DPipeline
→ trellis.utils.render_utils_rl
→ trellis.utils.postprocessing_utils
→ import nvdiffrast.torch as dr ← CUDA init here
This caused ZeroGPU's stateless-GPU enforcement to fire even before any
@spaces.GPU callback ran, blocking every GPU callback silently.
Fix: remove top-level import; add `import nvdiffrast.torch as dr` lazily
inside the `mode == 'opt'` branch where it is actually used.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(near): defer renderer/tone-mapper init to first GPU ensure
- HDRI preview uses standalone ToneMapper(view=); dropdown calls setup_tone_mapper
- Image workflow stores SLaT in _SESSION_SLAT; file path still for uploaded npz
- Move NeAR and Hunyuan to CUDA when available on __main__
- export_glb and export_glb_from_slat run under inference_mode for slat_decoder_mesh
- setup_tone_mapper uses ToneMapper(view=) to avoid missing .cpu after OCIO errors
- spconv SparseTensor.replace: align feat buffer with spconv tensor storage
Made-with: Cursor
Export GLB keeps grad on for bake_texture(opt); slat may still carry
inference-mode feats. _linear now materializes feats with clone() only
when is_grad_enabled() and feats.is_inference().
Made-with: Cursor
fix(sparse): spconv replace() must wire new feats into data.features
replace() previously rebuilt SparseConvTensor with old self.data.features and
only set _features; SparseTensor.feats reads .features, so clone/detach in
export_glb never replaced inference tensors.
Made-with: Cursor
fix(export): clone slat feats instead of inference_mode on full export
Whole-method inference_mode broke bake_texture(opt) loss.backward().
detach().clone() feats to drop inference tensors while keeping backward for texture opt.
Made-with: Cursor
fix(export): inference_mode for export_glb_from_slat (inference tensor slat)
- No snapshot_download unless NEAR_AUX_REPO or NEAR_DINO_LOCAL_REPO is set
- Optional NEAR_DINO_TORCH_HUB_REPO overrides github repo id
- Tests: github default path; resolve() without mirror raises
Made-with: Cursor
fix(spaces): Hdri torch.load after ConvNeXt; default off CPU preload with spaces
- hdri_encoder: torch.load(..., weights_only=False, map_location=cpu) so Stateless
GPU WeightsUnpickler does not run after torchvision may have touched CUDA
- app: default NEAR_MODEL_CPU_PRELOAD_AT_START=0 when spaces is installed
- test: assert Hdri load_weights uses full unpickle on CPU
Made-with: Cursor
fix(load): CPU-only checkpoint load for ZeroGPU main process
- trellis from_pretrained: always map_location=cpu, avoid torch.cuda probe
- clear_session_dir: drop cuda empty_cache on main process
- test: assert from_pretrained stays CPU-safe for HF Stateless GPU
Made-with: Cursor
fix(pipeline): do not treat ckpts/... as Hugging Face org/model id
- _is_hub_model_id: exclude ckpts/, weights/, configs/, checkpoints/
- Load models from snapshot root only for relative paths; remove broad try/except fallback
- Fixes 404 on hf.co/ckpts/... when NeAR CPU preload runs on Space
Made-with: Cursor
fix(space): split ZeroGPU cold-start paths and add timing diagnostics
Keep page load and HDRI preview off the heavy model path, separate Hunyuan, NeAR, and gsplat initialization, and add targeted timing logs plus docs/tests so first-request bottlenecks are easier to isolate on Hugging Face Spaces.
Made-with: Cursor
- Sync from hf-near mirror for trellis, hy3dshape, assets (LFS), etc.
- README: python_version + quoted short_description for Hub YAML
- requirements: spaces, gradio[oauth,mcp], kaolin find-links; drop --no-build-isolation line for Gradio builder
Made-with: Cursor