Downloads · 30 days
0
zhaxie/latent
latent is a machine learning model from zhaxie. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Apr 5, 2026
Repo size
704 MB
Likes
0
Public
Click a slice to open those files.
.safetensors704 MB · 100%
From the Hugging Face model README
latent (.npz)中文使用说明见:使用说明.md
整目录拷到新服务器即可用(无需 /mnt/zsn、无需拷贝整个 TRELLIS 11GB 仓库:utils3d 用 pip 安装)。
| 路径 | 说明 |
|---|---|
blender_flux_to_unilat.py | 主入口:体素化 + DINOv2 + encoder |
unilat_latent_to_video.py | 可选:latent → GS 视频(需 weights/ 内另有 gsdecoder.*,见下文) |
unilat3d/ | UniLat3D Python 包(仅推理所需代码) |
weights/ | encoder.json + encoder.safetensors(已打包) |
requirements.txt | 手写最小依赖 |
requirements-frozen.txt | 若用 build_from_workspace.sh 生成,可与源机器完全一致 |
GPU 驱动 + CUDA 与 PyTorch wheel 匹配(示例为 cu124)。
新建虚拟环境,进入本目录(含 unilat3d 子目录的这一层):
cd /path/to/latent_package
pip install -r requirements-frozen.txt
# 若无 frozen,则: pip install -r requirements.txt
安装 flash-attn(与 torch 版本匹配;若失败请查 UniLat3D / flash-attention 文档)。
自检:
python blender_flux_to_unilat.py --about
应显示 utils3d 在 site-packages、UNILAT_CKPT 指向本目录下 weights/。
编码:
python blender_flux_to_unilat.py \
--scene_dir /path/to/blender_flux_2/foo/edit \
--output /path/to/out.npz \
--device cuda:0
权重默认从 ./weights/ 读取,无需再设 UNILAT_CKPT_DIR。
export WORKSPACE=/root/workspace # 按需修改
export CKPT=/mnt/zsn/ckpts/UniLat3D
bash latent_package/build_from_workspace.sh
带上 gsdecoder(多约 1GB,用于 unilat_latent_to_video.py 验证):
COPY_DECODER=1 bash latent_package/build_from_workspace.sh
torch.hub 下载,新机器需能访问外网或自行准备 hub 缓存。requirements.txt 中的 spconv-cu* 版本或按 UniLat3D README 安装 spconv-int32 子模块(高级)。不能把 torch、spconv、flash-attn 变成「纯 Python 文件」塞进小包里——它们是带 CUDA 的 .so,和 glibc、驱动、CUDA 版本绑定。要做的是:在打包机把环境整体带走,而不是指望目标机现装。
conda-pack 整环境 —— 目标机不必再执行 pip在与目标机同架构(如都是 Linux x86_64)、CUDA 大版本接近的打包机上:
conda install -n base -c conda-forge conda-pack
bash latent_package/scripts/pack_conda_env.sh
# 得到 bundled_env/unilat3d_conda_packed.tar.gz(体积通常数 GB)
把 latent_package 整个目录 + 该 tar 拷到目标机:
mkdir -p ~/latent_runtime && tar -xzf unilat3d_conda_packed.tar.gz -C ~/latent_runtime
cd ~/latent_runtime && ./bin/conda-unpack
cd /path/to/latent_package
~/latent_runtime/bin/python blender_flux_to_unilat.py --scene_dir ... --output ... --device cuda:0
之后只用打包里的 python,不需要在目标机 pip。
注意:若目标机 glibc 更老、无 GPU 或 CUDA 与打包机差太多,可能直接跑不起来,需要在与生产机尽量同镜像的机器上打包。
python -m pip,只是不联网)在有网的打包机:
bash latent_package/scripts/download_offline_wheels.sh
会把依赖 wheel 下到 vendor/wheels/。把整个 latent_package 拷过去后,在目标机一次性离线安装:
cd /path/to/latent_package
python -m pip install --no-index --find-links=vendor/wheels -r requirements-frozen.txt
这仍然调用 pip 模块;若策略是「禁止任何 pip」,请用 方案 A。
在镜像里装好依赖,目标机只装容器运行时,宿主机无需 pip。适合有容器平台的情况。
| 能直接放进包里的 | 不能单靠「拷贝几份 .py」解决的 |
|---|---|
unilat3d/ 源码、encoder 权重、脚本 | PyTorch、spconv、flash-attn、open3d 等 预编译二进制 |
可选:vendor/wheels/(离线装) | 二进制与 CUDA/驱动/系统 必须匹配 |
因此:「必不可少」的编译依赖要么用 conda-pack / 容器 整体搬运,要么用 离线 wheel + 本地 pip。