NeAR is a relightable 3D generation and rendering project built on top of TRELLIS-style Structured Latents (SLAT) and a lighting-aware neural renderer. Given a casually lit input image, NeAR estimates relightable neural assets and renders them under novel environment lighting and viewpoints.
This repository combines:
Relightable 3D generative rendering results. Columns from left to right depict the target illumination, the casually lit input image, Blender-rendered results from Trellis 3D, Hunyuan 3D-2.1 (with PBR materials), our method's estimated multi-view PBR materials back-projected onto the given mesh, our neural rendering results, and ground truth.
The following videos are produced by the local NeAR example pipeline and are useful for quickly previewing:
Different reference images can be used for mesh and SLaT in the Gradio app (app_gradio.py) — the mesh is locked to one image's geometry while the SLaT inherits the appearance of another, producing texture style transfer onto the same shape.
NeAR couples asset representation and renderer design:
Compared with a standard image-to-3D pipeline, NeAR focuses on:
Key files and directories:
example.py — minimal end-to-end inference example.app_web.py — launcher for the modern, high-performance FastAPI & WebSocket Neural Relighting Web App (replaces old Gradio/Viser viewers).app_gradio.py — local Gradio-style demo / app script.app_web/ — FastAPI backend and interactive HTML5 Canvas frontend implementation.DSCF-SR/ — integrated lightweight 4x spatial-frequency distillation super-resolution network model.pixi.toml — reproducible environment definition (conda + PyPI, CUDA toolchain).checkpoints/ — local pipeline configuration and model checkpoints.trellis/pipelines/near_image_to_relightable_3d.py — main NeAR inference pipeline.trellis/utils/render_utils_rl.py — relighting rendering utilities.trellis/datasets/hdri_processer.py — HDRI preprocessing and rotation helpers.hy3dshape/ — Hunyuan3D shape utilities from Tencent-Hunyuan/Hunyuan3D-2.1/hy3dshape.8.0;8.6;9.0)curl -fsSL https://pixi.sh/install.sh | bashThe environment uses Python 3.10, PyTorch 2.11.0+cu128, and xformers 0.0.35. All Python / conda dependencies (CUDA toolkit, compilers, system libs) are declared in pixi.toml; you do not need a system-wide CUDA install or conda.
git clone --recursive https://github.com/Luh1124/NeAR.git
cd NeAR
# 1. Resolve & install python, CUDA toolkit, torch, xformers, and all pure-python deps.
pixi install
# 2. (Optional) Stage Hunyuan3D-2.1's hy3dshape/ at the repo root for geometry generation.
pixi run fetch-hy3dshape
# 3. Build CUDA / torch-extension deps that need torch present at compile time:
# flash-attn, gsplat, vox2seq (local), diffoctreerast, hy3dshape requirements.
pixi run setup-cuda-ext
That's the whole install. Everything below assumes you prefix commands with pixi run (or use pixi shell for an interactive session):
pixi run python example.py --image assets/example_image/T.png \
--hdri assets/hdris/studio_small_03_1k.exr
pixi.toml sets UV_CACHE_DIR=$PIXI_PROJECT_ROOT/.pixi/uv-cache so the PyPI cache lives on the same filesystem as .pixi/envs/. This lets uv hardlink wheels into the env and avoids cross-mount copy fallbacks.nvdiffrast, flash-attn, vox2seq, diffoctreerast, gsplat) is compiled against a specific torch ABI. CUDA extensions are installed via pixi run setup-cuda-ext with --no-cache-dir --force-reinstall, so re-running the task after a torch pin change rebuilds them against the new ABI.flexicubes/examples/ demos do). If you need it, build from source.The local pipeline configuration is defined in:
checkpoints/pipeline.yamlIt references the main model components used by NeAR, including:
decoderhdri_encoderneural_basisrendererslat_flow_modelThe geometry model is currently run separately in example.py via:
tencent/Hunyuan3D-2.1Preprocessed HDR environment maps used for training and inference:
NeAR supports two inference paths:
.npz.For detailed instructions, command-line examples, output descriptions, and API usage, see doc/infer.md.
Quick start:
pixi run python example.py \
--image assets/example_image/T.png \
--hdri assets/hdris/studio_small_03_1k.exr \
--out_dir relight_out
We provide an interactive web app built with FastAPI and WebSockets for real-time 3DGS relighting and asset generation.
pixi run python app_web.py --port 8099 --share
--host / --port: Server bind options (default: 0.0.0.0:8080).--share: Create a secure public tunnel.This repository builds on and adapts ideas, codebases, and problem settings from several recent works on structured 3D latents, relighting, inverse rendering, and PBR-aware 3D generation, including:
If you find this project or data useful, please consider citing our paper:
@inproceedings{li2025near,
title={NeAR: Coupled Neural Asset-Renderer Stack},
author={Li, Hong and Ye, Chongjie and Chen, Houyuan and Xiao, Weiqing and Yan, Ziyang and Xiao, Lixing and Chen, Zhaoxi and Xiang, Jianfeng and Xu, Shaocong and Liu, Xuhui and Wang, Yikai and Zhang, Baochang and Han, Xiaoguang and Yang, Jiaolong and Zhao, Hao},
booktitle={CVPR},
year={2026}
}
22 commits
Jupyter Notebook
63.8%
Python
33.0%
HTML
2.8%
NeAR is a relightable 3D generation and rendering project built on top of TRELLIS-style Structured Latents (SLAT) and a lighting-aware neural renderer. Given a casually lit input image, NeAR estimates relightable neural assets and renders them under novel environment lighting and viewpoints.
This repository combines:
Relightable 3D generative rendering results. Columns from left to right depict the target illumination, the casually lit input image, Blender-rendered results from Trellis 3D, Hunyuan 3D-2.1 (with PBR materials), our method's estimated multi-view PBR materials back-projected onto the given mesh, our neural rendering results, and ground truth.
The following videos are produced by the local NeAR example pipeline and are useful for quickly previewing:
Different reference images can be used for mesh and SLaT in the Gradio app (app_gradio.py) — the mesh is locked to one image's geometry while the SLaT inherits the appearance of another, producing texture style transfer onto the same shape.
NeAR couples asset representation and renderer design:
Compared with a standard image-to-3D pipeline, NeAR focuses on:
Key files and directories:
example.py — minimal end-to-end inference example.app_web.py — launcher for the modern, high-performance FastAPI & WebSocket Neural Relighting Web App (replaces old Gradio/Viser viewers).app_gradio.py — local Gradio-style demo / app script.app_web/ — FastAPI backend and interactive HTML5 Canvas frontend implementation.DSCF-SR/ — integrated lightweight 4x spatial-frequency distillation super-resolution network model.pixi.toml — reproducible environment definition (conda + PyPI, CUDA toolchain).checkpoints/ — local pipeline configuration and model checkpoints.trellis/pipelines/near_image_to_relightable_3d.py — main NeAR inference pipeline.trellis/utils/render_utils_rl.py — relighting rendering utilities.trellis/datasets/hdri_processer.py — HDRI preprocessing and rotation helpers.hy3dshape/ — Hunyuan3D shape utilities from Tencent-Hunyuan/Hunyuan3D-2.1/hy3dshape.8.0;8.6;9.0)curl -fsSL https://pixi.sh/install.sh | bashThe environment uses Python 3.10, PyTorch 2.11.0+cu128, and xformers 0.0.35. All Python / conda dependencies (CUDA toolkit, compilers, system libs) are declared in pixi.toml; you do not need a system-wide CUDA install or conda.
git clone --recursive https://github.com/Luh1124/NeAR.git
cd NeAR
# 1. Resolve & install python, CUDA toolkit, torch, xformers, and all pure-python deps.
pixi install
# 2. (Optional) Stage Hunyuan3D-2.1's hy3dshape/ at the repo root for geometry generation.
pixi run fetch-hy3dshape
# 3. Build CUDA / torch-extension deps that need torch present at compile time:
# flash-attn, gsplat, vox2seq (local), diffoctreerast, hy3dshape requirements.
pixi run setup-cuda-ext
That's the whole install. Everything below assumes you prefix commands with pixi run (or use pixi shell for an interactive session):
pixi run python example.py --image assets/example_image/T.png \
--hdri assets/hdris/studio_small_03_1k.exr
pixi.toml sets UV_CACHE_DIR=$PIXI_PROJECT_ROOT/.pixi/uv-cache so the PyPI cache lives on the same filesystem as .pixi/envs/. This lets uv hardlink wheels into the env and avoids cross-mount copy fallbacks.nvdiffrast, flash-attn, vox2seq, diffoctreerast, gsplat) is compiled against a specific torch ABI. CUDA extensions are installed via pixi run setup-cuda-ext with --no-cache-dir --force-reinstall, so re-running the task after a torch pin change rebuilds them against the new ABI.flexicubes/examples/ demos do). If you need it, build from source.The local pipeline configuration is defined in:
checkpoints/pipeline.yamlIt references the main model components used by NeAR, including:
decoderhdri_encoderneural_basisrendererslat_flow_modelThe geometry model is currently run separately in example.py via:
tencent/Hunyuan3D-2.1Preprocessed HDR environment maps used for training and inference:
NeAR supports two inference paths:
.npz.For detailed instructions, command-line examples, output descriptions, and API usage, see doc/infer.md.
Quick start:
pixi run python example.py \
--image assets/example_image/T.png \
--hdri assets/hdris/studio_small_03_1k.exr \
--out_dir relight_out
We provide an interactive web app built with FastAPI and WebSockets for real-time 3DGS relighting and asset generation.
pixi run python app_web.py --port 8099 --share
--host / --port: Server bind options (default: 0.0.0.0:8080).--share: Create a secure public tunnel.This repository builds on and adapts ideas, codebases, and problem settings from several recent works on structured 3D latents, relighting, inverse rendering, and PBR-aware 3D generation, including:
If you find this project or data useful, please consider citing our paper:
@inproceedings{li2025near,
title={NeAR: Coupled Neural Asset-Renderer Stack},
author={Li, Hong and Ye, Chongjie and Chen, Houyuan and Xiao, Weiqing and Yan, Ziyang and Xiao, Lixing and Chen, Zhaoxi and Xiang, Jianfeng and Xu, Shaocong and Liu, Xuhui and Wang, Yikai and Zhang, Baochang and Han, Xiaoguang and Yang, Jiaolong and Zhao, Hao},
booktitle={CVPR},
year={2026}
}
22 commits
Jupyter Notebook
63.8%
Python
33.0%
HTML
2.8%