Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

Add NIM image-to-3D output gallery viewer

nirholas74ec263e59c4
diff --git a/scripts/nim-gallery.html b/scripts/nim-gallery.html
new file mode 100644
index 000000000..3ce76024d
--- /dev/null
+++ b/scripts/nim-gallery.html
@@ -0,0 +1,105 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>three.ws · NVIDIA NIM image→3D gallery</title>
+<style>
+ :root { color-scheme: dark; }
+ * { margin: 0; box-sizing: border-box; }
+ html, body { height: 100%; overflow: hidden; font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; color: #e8edf7; }
+ #app { display: grid; grid-template-columns: 220px 1fr; height: 100%; }
+ #rail { background: #0a0d16; border-right: 1px solid rgba(255,255,255,.07); padding: 18px 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
+ #rail h1 { font-size: 13px; letter-spacing: .5px; color: #76b900; text-transform: uppercase; margin-bottom: 6px; }
+ #rail .sub { font-size: 11px; color: #5a6478; margin-bottom: 14px; line-height: 1.4; }
+ .item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: #121724; cursor: pointer; transition: all .15s; font-size: 14px; text-transform: capitalize; }
+ .item:hover { background: #1a2031; border-color: rgba(118,185,0,.3); }
+ .item.active { background: rgba(118,185,0,.12); border-color: rgba(118,185,0,.55); color: #cfe8a0; }
+ .item .dot { width: 7px; height: 7px; border-radius: 50%; background: #44506a; }
+ .item.active .dot { background: #76b900; box-shadow: 0 0 8px #76b900; }
+ #stage { position: relative; background: radial-gradient(120% 120% at 50% 20%, #1a2238 0%, #0b0e18 55%, #05060c 100%); }
+ canvas { display: block; }
+ .badge { position: absolute; left: 22px; bottom: 20px; display: flex; align-items: center; gap: 9px; padding: 9px 15px; border-radius: 999px; background: rgba(12,16,28,.62); backdrop-filter: blur(10px); border: 1px solid rgba(118,185,0,.35); font-size: 13px; }
+ .badge b { color: #76b900; }
+ .bdot { width: 8px; height: 8px; border-radius: 50%; background: #76b900; box-shadow: 0 0 9px #76b900; }
+ .loading { position: absolute; inset: 0; display: grid; place-items: center; color: #76b900; font-size: 13px; letter-spacing: 2px; }
+ .loading.hide { display: none; }
+</style>
+</head>
+<body>
+<div id="app">
+ <aside id="rail">
+ <h1>NIM · image→3D</h1>
+ <div class="sub">Self-hosted NVIDIA TRELLIS (large:image) · A100 · 50 steps</div>
+ <div id="list"></div>
+ </aside>
+ <div id="stage">
+ <div class="loading" id="loading">LOADING…</div>
+ <div class="badge"><span class="bdot"></span> image → 3D · <b>NVIDIA TRELLIS</b></div>
+ </div>
+</div>
+<script type="importmap">
+{ "imports": {
+ "three": "https://unpkg.com/[email protected]/build/three.module.js",
+ "three/addons/": "https://unpkg.com/[email protected]/examples/jsm/"
+} }
+</script>
+<script type="module">
+import * as THREE from 'three';
+import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
+import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
+
+const MODELS = ['gem', 'robot', 'potion', 'rocket', 'cube', 'face'];
+
+const stage = document.getElementById('stage');
+const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
+renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
+renderer.toneMapping = THREE.ACESFilmicToneMapping; renderer.toneMappingExposure = 1.05;
+stage.appendChild(renderer.domElement);
+const scene = new THREE.Scene();
+const pmrem = new THREE.PMREMGenerator(renderer);
+scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
+const camera = new THREE.PerspectiveCamera(38, 1, 0.01, 100);
+camera.position.set(0, 0.35, 3.1);
+scene.add(Object.assign(new THREE.DirectionalLight(0xffffff, 2.4), { position: new THREE.Vector3(3,5,4) }));
+scene.add(Object.assign(new THREE.DirectionalLight(0x86b6ff, 1.5), { position: new THREE.Vector3(-4,2,-4) }));
+scene.add(new THREE.AmbientLight(0xffffff, 0.3));
+const controls = new OrbitControls(camera, renderer.domElement);
+controls.enableDamping = true; controls.dampingFactor = 0.06; controls.autoRotate = true; controls.autoRotateSpeed = 2.2;
+
+function resize() {
+ const w = stage.clientWidth, h = stage.clientHeight;
+ renderer.setSize(w, h); camera.aspect = w / h; camera.updateProjectionMatrix();
+}
+addEventListener('resize', resize); resize();
+
+const loader = new GLTFLoader();
+let current = null;
+function load(name) {
+ document.getElementById('loading').classList.remove('hide');
+ loader.load(`/demo/${name}.glb`, (g) => {
+ if (current) scene.remove(current);
+ const o = g.scene;
+ const box = new THREE.Box3().setFromObject(o), size = box.getSize(new THREE.Vector3()), c = box.getCenter(new THREE.Vector3());
+ const k = 1.8 / (Math.max(size.x, size.y, size.z) || 1);
+ o.scale.setScalar(k); o.position.sub(c.multiplyScalar(k));
+ scene.add(o); current = o;
+ controls.target.set(0, 0, 0); controls.autoRotateSpeed = 6; setTimeout(() => controls.autoRotateSpeed = 2, 2200);
+ document.getElementById('loading').classList.add('hide');
+ }, undefined, () => { document.getElementById('loading').textContent = 'FAILED'; });
+}
+
+const list = document.getElementById('list');
+MODELS.forEach((name, i) => {
+ const el = document.createElement('div');
+ el.className = 'item' + (i === 0 ? ' active' : '');
+ el.innerHTML = `<span class="dot"></span>${name}`;
+ el.onclick = () => { document.querySelectorAll('.item').forEach(x => x.classList.remove('active')); el.classList.add('active'); load(name); };
+ list.appendChild(el);
+});
+load(MODELS[0]);
+renderer.setAnimationLoop(() => { controls.update(); renderer.render(scene, camera); });
+</script>
+</body>
+</html>