🧭 hermit-trellis2

June 11, 2026 Β· View on GitHub

hermit-trellis2

🧭 hermit-trellis2

Training-free Hermite-cached acceleration for TRELLIS.2-4B image-to-3D β€” ~1.9Γ— fewer network evaluations, lossless, one line of code.

License: MIT base: TRELLIS.2 arXiv: TRELLIS.2 arXiv: HiCache arXiv: Adaptive Guidance

TRELLIS.2-4B Β· 1024_cascade (mesh + texture) Β· training-free Β· single RTX 5090 Β· MIT

HiCache++ variant: an exponential (DMD/Prony) forecast variant of this repo lives in hermit-trellis2-plus-plus β€” same carved-hybrid, with the sparse-structure velocity forecast on a Dynamic-Mode-Decomposition basis instead of the Hermite polynomial.

When to use this repo

These repos are complementary accelerators, not competing solutions β€” each speeds up a different base generator, and the + / ++ suffix is a method choice, not a rival product. Pick by (1) which base model you run, then (2) which forecast basis you want:

base generator+ = HiCache (Hermite)++ = HiCache++ (DMD)
Hunyuan3D-2.1hunyuan2.1-plushunyuan2.1-plus-plus
Hunyuan3D-2 minihunyuan2-plushunyuan2-plus-plus
SAM 3D Objectssam3d-plussam3d-plus-plus
Fast-SAM3Dfastsam3d-plusfastsam3d-plus-plus
TRELLIS (v1)faster-trellisfaster-trellis-plus-plus
TRELLIS.2-4B (v2)hermit-trellis2hermit-trellis2-plus-plus
  • + (HiCache / scaled-Hermite): the published polynomial velocity-forecast basis β€” conservative, reproduces the HiCache paper. Use it to deploy the established method.
  • ++ (HiCache++ / DMD exponential): our Dynamic-Mode-Decomposition basis β€” the same near-lossless quality at wider skip intervals, where the polynomial diverges. Use it when you push the cache interval for more speed.
  • standalone / model-agnostic: hicache-plus-plus β€” the forecaster itself, to add DMD caching to your own diffusion/flow model.
  • fast-trellis2 = the TaylorSeer baseline fork (the upstream "Fast" accel) β€” the v2 reference point, not a HiCache variant.

This repo: hermit-trellis2 β€” TRELLIS.2-4B Γ— HiCache (Hermite) β€” carved-hybrid on the 4B v2 model.

hermit-trellis2 is TRELLIS.2-4B image-to-3D with a training-free Hermite carved-hybrid built into the flow-matching sampler. It forecasts the model's final CFG-combined velocity with a dual-scaled Hermite basis on the sparse-structure stage and carves the structured-latent tokens β€” so the sampler spends far fewer network evaluations per asset, with the weights, decoders, and the full 1024_cascade mesh + texture left untouched. (The name is a nod to the Hermite forecast at its core β€” and yes, it's happy running on its own.)

pipe.enable_faster()        # the Hermite carved-hybrid β€” one line, lossless vs the base model
pipe.enable_faster("base")  # stock TRELLIS.2 sampler (kill-switch)

What it does. Two accelerations act on the velocity the samplers emit, one per stage class:

  • Hermite (HiCache) on the sparse-structure stage β€” a dual-scaled physicist's-Hermite forecast of the velocity that skips network calls fixing the coarse occupancy volume, while always computing the early steps where topology is decided.
  • Token-carved SLaT on the structured-latent stages β€” a learned-cadence temporal skip plus spatial token carving that recomputes only the high-frequency voxels each step.

Where it sits. hermit-trellis2 is the v2 instance of the Hermite carved-hybrid β€” the same method that on TRELLIS v1 beats Fast-TRELLIS on both speed and quality (sibling repo faster-trellis). On TRELLIS.2 it is a ~1.9Γ— lossless accelerator of the base model; the alternative TaylorSeer port, fast-trellis2, reaches comparable speed and is a touch ahead on the v2 mesh F-score below β€” TRELLIS.2's fast baseline is already strong, leaving the two on par on v2. The Hermite forecast's distinction is that it stays accurate at long skip horizons where the monomial TaylorSeer basis diverges. It ships as a single, lossless-target configuration β€” no mode menu.

See Results. GF_CARVE_RATIO / GF_HICACHE_SS_INTERVAL / GF_HICACHE_FIRST_ENHANCE override the defaults for tuning.


Quickstart

git clone https://github.com/Archerkattri/hermit-trellis2
cd hermit-trellis2
# TRELLIS.2 runtime deps (torch, flash-attn, spconv/flex_gemm, o-voxel, cumesh,
# nvdiffrast) per microsoft/TRELLIS.2. Place / symlink weights at ckpts/TRELLIS.2-4B.
from trellis2.pipelines import Trellis2ImageTo3DPipeline
from PIL import Image

pipe = Trellis2ImageTo3DPipeline.from_pretrained("ckpts/TRELLIS.2-4B").to("cuda")
pipe.enable_faster()                                  # ← the only added line

out  = pipe.run(Image.open("input_rgba.png"), pipeline_type="1024_cascade")
mesh = out[0]

example_faster.py is the runnable end-to-end script; example.py is the stock TRELLIS.2 demo.

RTX 50-series (sm_120) launch env

1024_cascade fits in 32 GB with expandable_segments:

SPARSE_CONV_BACKEND=spconv SPCONV_ALGO=native ATTN_BACKEND=flash_attn \
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True CUDA_VISIBLE_DEVICES=0 \
  python example_faster.py --image input_rgba.png

SPCONV_ALGO=native is recommended on newer GPU architectures.


Results

40 Toys4K objects, RTX 5090, TRELLIS.2-4B, full 1024_cascade (mesh + texture), seed 42. Geometry is scored on the o-voxel mesh decoder with area-weighted surface sampling, after a globally-optimal (Go-ICP) similarity alignment to the ground-truth mesh β€” the same harness across rows, over the 35 objects all three completed. Latency is end-to-end generation, weights resident.

F1@0.05 mean ↑F1 median ↑CD ↓latency ↓speedup
TRELLIS.2 (base)0.8600.9320.05711.75 s1.00Γ—
fast-trellis2 (TaylorSeer)0.9000.9590.0486.23 s1.89Γ—
hermit-trellis2 (Hermite)0.8690.9570.0596.26 s1.88Γ—

CD ↓ lower is better; F1 ↑ higher is better. hermit-trellis2 accelerates the base model ~1.9Γ— at near-lossless quality (F1 mean 0.869 vs 0.860; CD within run-to-run noise). On this v2 mesh F-score the TaylorSeer sibling fast-trellis2 is a touch ahead β€” TRELLIS.2's strong fast baseline leaves little headroom β€” so the two are best read as on par on v2. The Hermite forecast's decisive advantage shows on v1 (faster-trellis: 1.35Γ— faster and higher F-score than Fast-TRELLIS) and in its long-horizon stability, where TaylorSeer's monomials diverge.


Sign-convention update (2026-06-10)

The vendored Hermite forecast evaluated the basis at x = -k; the corrected convention from hicache-plus-plus 1.2.0 is x = +k (the upstream TaylorSeer distance convention; -k flips every odd-order term, extrapolating backwards). This fork now ships the corrected forecast. The published numbers above were measured with the as-released code and remain valid as-measured; re-validation on this model is pending. On the two family models re-validated so far on their published protocols (Hunyuan3D-2 mini and the SAM 3D Objects slat stage; see hunyuan2-plus and sam3d-plus), the corrected forecast matched the as-released quality at the published intervals.

How it works

TRELLIS.2 samples a shape in three flow-matching stages β€” sparse structure (SS), shape SLaT (the 512β†’1024 cascade), and texture SLaT (guidance = 1, no CFG) β€” each a short Euler sampler. Both accelerators act on the final velocity pred_v those samplers emit.

β‘  Hermite (HiCache) velocity forecast (replaces network calls on skipped steps)

At a compute step the sampler runs the model, caches F_t = pred_v, and keeps backward finite differences:

Δ⁰F_t = F_t
ΔⁱF_t = (Δⁱ⁻¹F_t βˆ’ Δⁱ⁻¹F_{tβˆ’N}) / N

At a skipped step (k past the last compute step) it forecasts the velocity with the dual-scaled physicist's Hermite basis instead of touching the network:

FΜ‚_{tβˆ’k} = F_t + Ξ£_{iβ‰₯1} (ΔⁱF_t / i!) Β· HΜƒ_i(βˆ’k)
HΜƒ_n(x) = σⁿ Β· H_n(σ·x),   Οƒ ∈ (0,1)
H_0 = 1,  H_1 = 2x,  H_{n+1} = 2xΒ·H_n βˆ’ 2nΒ·H_{nβˆ’1}

Why Hermite over Taylor? TaylorSeer is the special case HΜƒ_i(βˆ’k) = (βˆ’k)ⁱ. Those monomials blow up super-exponentially with order and horizon, so high-order terms dominate and the forecast diverges. The dual Οƒ-scaling (input scale Οƒx and coefficient scale σⁿ) contracts the basis into the bounded, oscillatory regime of the Hermite functions, so the forecast tracks the true velocity on the same cached anchors without diverging. For the dense SS latent pred_v is forecast directly; for the SLaT SparseTensors only .feats is forecast and coords carry through via .replace(feats). (arXiv:2508.16984)

β‘‘ Token-carved SLaT β€” recompute only the high-frequency voxels (SLaT stages)

The SLaT stages denoise a SparseTensor of voxel tokens, and most tokens change slowly between steps. On each computed step we score every token by spatial high-frequency energy (a 3D-FFT of the sparse-structure occupancy grid) together with its velocity magnitude and frame-to-frame motion, and recompute only the most active fraction; the smoothest tokens reuse their cached velocity, under a staleness bound that forces a periodic full refresh so no token drifts. On top of that a learned-k delta cache skips whole steps when the velocity field is locally linear (vβ‚œ β‰ˆ xβ‚œ + Ξ”). The SS occupancy's per-token frequency score is the same one the Hermite stage reads, so the two stages share one signal. (Fast-TRELLIS token selection, paired with our Hermite SS forecast; carving level = GF_CARVE_RATIO.)

β‘’ Per-stage split (Hermite on SS, token carving on SLaT)

The two accelerations are matched to what each stage costs. The sparse-structure stage is a small dense volume that fixes the asset's topology β€” the Hermite forecast thins it while always computing the first six steps (GF_HICACHE_FIRST_ENHANCE), so the occupancy can't be corrupted. The shape and texture SLaT stages are the sparse, expensive ones β€” token carving recomputes only their high-frequency voxels per step and the delta cache skips whole steps. The pipeline computes the SS occupancy's 3D-FFT frequency score once and hands it to the SLaT sampler (set_coords_scores), so the carving signal is the SS structure itself β€” wired in trellis2/pipelines/trellis2_image_to_3d.py.

The savings multiply: the SLaT sampler skips whole steps (delta cache) and carves tokens on the steps it does run, while the Hermite forecast independently thins the SS stage.


Tuning

One shipped configuration; each knob is overridable by env var (takes precedence) or directly on the swapped sampler instances:

knobenvdefaultmeaning
carving levelGF_CARVE_RATIO0.10fraction of SLaT tokens cached/skipped per step
SS intervalGF_HICACHE_SS_INTERVAL2sparse-structure: compute 1 step, forecast interval βˆ’ 1
SS first-enhanceGF_HICACHE_FIRST_ENHANCE6always compute the first N SS steps (protects topology)
import os; os.environ["GF_CARVE_RATIO"] = "0.15"
pipe.enable_faster()
# …or set the instances directly, after enable_faster():
pipe.sparse_structure_sampler.hicache_interval = 2
pipe.shape_slat_sampler.carving_ratio = 0.10

What's added on top of TRELLIS.2

All Microsoft TRELLIS.2 model / decoder / o-voxel code is unchanged. Added files only:

  • trellis2/pipelines/samplers/hicache.py β€” Hermite basis + finite-difference cache
  • trellis2/pipelines/samplers/hicache_freq.py β€” 3D-FFT high-frequency token scoring (the carving signal)
  • trellis2/pipelines/samplers/flow_euler_carved.py β€” the token-carved SLaT sampler (delta-cache step-skip + carving)
  • trellis2/pipelines/samplers/flow_euler.py β€” HiCacheMixin + the accelerated sampler classes
  • trellis2/pipelines/samplers/__init__.py β€” registers the accelerated samplers
  • trellis2/pipelines/trellis2_image_to_3d.py β€” enable_faster() (single config) + the per-stage wiring
  • example_faster.py

The accelerators are independent re-implementations of the cited papers on the TRELLIS.2 sampler API.


Credits & license

TRELLIS.2microsoft/TRELLIS β€” the pipeline, models, decoders this builds on (MIT)
HiCachearXiv:2508.16984 β€” Hermite-polynomial velocity forecasting
Fast-TRELLISwlfeng0509/Fast-SAM3D (Fast-TRELLIS branch) β€” the token-carving substrate the SLaT stage builds on

MIT. Accelerations Β© 2026 Krishi Attri; bundled TRELLIS.2 Β© Microsoft Corporation. See LICENSE and NOTICE.

Krishi Attri Β· krishiattriwork@gmail.com Β· github.com/Archerkattri

BibTeX
@software{attri2026hermittrellis2,
  author = {Krishi Attri},
  title  = {hermit-trellis2: Training-free Hermite carved-hybrid acceleration of TRELLIS.2 image-to-3D},
  year   = {2026},
  url    = {https://github.com/Archerkattri/hermit-trellis2}
}
@article{hicache2025,
  title   = {HiCache: Training-free Acceleration of Diffusion Models via
             Hermite Polynomial Feature Forecasting},
  journal = {arXiv preprint arXiv:2508.16984}, year = {2025}
}
@article{trellis2,
  title   = {Native and Compact Structured Latents for 3D Generation (TRELLIS.2)},
  journal = {arXiv preprint arXiv:2512.14692}, note = {microsoft/TRELLIS.2}
}

Family

Part of the HiCache++ acceleration family.

  • Family hub: hicache-plus-plus β€” the basis library behind this adapter.
  • Sibling: hermit-trellis2-plus-plus β€” the same base model with the HiCache++ (Dynamic Mode Decomposition / Prony) exponential-forecast variant.