Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: refresh rerendered 3D models

[._.]/ Adam Eivyf962458682c0
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index cd0d12e220..0ebf0fe07a 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -2,7 +2,7 @@
## 3D
-- **TRELLIS.2 models no longer render with transparent holes, and high-memory Macs use the sharper texture pipeline** — existing generated meshes now display as solid in the 3D viewer, while new downloads are normalized to the opaque material mode TRELLIS intended. Macs with at least 48 GB of unified memory now use 1024-cascade generation for better surface-detail placement; supported 24 GB systems stay on the proven lower-memory lane.
+- **TRELLIS.2 models no longer render with transparent holes, and high-memory Macs use the sharper texture pipeline** — existing generated meshes now display as solid in the 3D viewer, while newly generated GLBs are normalized to the opaque material mode TRELLIS intended. Macs with at least 48 GB of unified memory now use 1024-cascade generation for better surface-detail placement; supported 24 GB systems stay on the proven lower-memory lane. Re-rendering the same record also refreshes the viewer immediately instead of showing its URL-cached previous mesh.
- **[issue-3041] Installing TRELLIS.2 now fetches the Apple toolchain it needs, instead of telling you to run a command** — #2952 made the "correct shape, confetti surface" problem *visible*, but the fix was still a terminal command you had to copy out of a warning and run yourself — leaving every new install one manual step away from bad-looking renders. Installing (or repairing) TRELLIS.2 now downloads Apple's Xcode Metal Toolchain itself when it's missing, before the setup that needs it, so a fresh install produces properly textured meshes with nothing extra to do. No password is required and the download is skipped entirely when you already have it. **Repair install** on an existing degraded copy now genuinely fixes it rather than re-running the same broken setup. Two honest edge cases: if the download fails the install continues anyway (your geometry is unaffected, and the finished install tells you textures will be reduced), and on a Mac with only the Command Line Tools — where nothing PortOS runs can fetch the toolchain — you get a note naming Xcode as the prerequisite and no Repair button that would only fail.
- **[issue-2952] The 3D page now catches the install problem that made meshes come out as colorful static** — a TRELLIS.2 render could produce a perfectly accurate 3D shape wrapped in a scrambled, speckled surface, with nothing anywhere saying why. The cause is an install that only *looked* finished: TRELLIS.2's setup builds its high-quality texture painter from Metal source, and on a Mac without Apple's Xcode Metal Toolchain that build quietly fails, the setup still reports success, and every later render silently falls back to a low-resolution painter that can't cover a detailed mesh — so the shape is right and the paint job is confetti. PortOS now checks for the Metal Toolchain **before** you commit to the multi-hour install and warns you if it's missing, verifies after installing whether the good texture painter actually landed, and shows any already-installed copy as **Ready · degraded textures** with a plain explanation and a one-click **Repair install** that rebuilds just the missing piece (your downloaded models are kept). Renders also now bake textures at the highest resolution TRELLIS.2 offers, so surfaces hold more detail either way.
- **[issue-3032] The 3D page now uses the Hugging Face token you already saved — and lets you add one right there** — if you'd already given PortOS a Hugging Face token (for gated image models or local model downloads), the 3D page ignored it: it never handed the token to the render, so TRELLIS.2's first run still failed on the two gated models it downloads, and the page kept telling you to go authenticate in a terminal. Your saved token now travels into the render, and the notice reads your actual setup: with a token in place it collapses to a one-line confirmation telling you where that token came from, and with none it offers a paste-and-save field instead of terminal instructions. Either way the two gated models stay linked, since their terms still have to be accepted on your Hugging Face account — a token alone doesn't grant access.
diff --git a/client/src/pages/Media3DDetail.jsx b/client/src/pages/Media3DDetail.jsx
index 9e0f0b991b..c8784f30f8 100644
--- a/client/src/pages/Media3DDetail.jsx
+++ b/client/src/pages/Media3DDetail.jsx
@@ -98,6 +98,12 @@ export default function Media3DDetail() {
const isGenerating = record.status === 'generating';
const latestRun = Array.isArray(record.runs) && record.runs.length ? record.runs[record.runs.length - 1] : null;
const percent = Number.isFinite(latestRun?.percent) ? Math.round(latestRun.percent) : null;
+ // Re-renders overwrite the same model.glb path. Key the fetch to the completed
+ // generation so drei's URL cache loads the new bytes when this record is rendered
+ // again, while old records without generatedAt retain their historical URL.
+ const meshSrc = record.generatedAt
+ ? `${record.assetPath}?v=${encodeURIComponent(record.generatedAt)}`
+ : record.assetPath;
return (
<div className="mx-auto max-w-4xl">
@@ -163,7 +169,7 @@ export default function Media3DDetail() {
<span className="mb-1 block text-xs text-gray-400">Mesh</span>
{record.status === 'ready' && record.assetPath ? (
<GlbViewer
- src={record.assetPath}
+ src={meshSrc}
downloadHref={imageTo3dAssetUrl(record.id)}
forceOpaque
/>
diff --git a/client/src/pages/Media3DDetail.test.jsx b/client/src/pages/Media3DDetail.test.jsx
index 09b38a5654..7218da1c08 100644
--- a/client/src/pages/Media3DDetail.test.jsx
+++ b/client/src/pages/Media3DDetail.test.jsx
@@ -49,10 +49,12 @@ describe('Media3DDetail', () => {
beforeEach(() => vi.clearAllMocks());
it('renders the mesh viewer and source image for a ready record', async () => {
- getImageTo3dModel.mockResolvedValue(record());
+ getImageTo3dModel.mockResolvedValue(record({ generatedAt: '2026-07-25T12:34:56.000Z' }));
renderAt();
expect(await screen.findByText('Example Beacon')).toBeInTheDocument();
- expect(screen.getByTestId('glb-viewer')).toHaveTextContent('/data/image-to-3d/image3d-1/model.glb');
+ expect(screen.getByTestId('glb-viewer')).toHaveTextContent(
+ '/data/image-to-3d/image3d-1/model.glb?v=2026-07-25T12%3A34%3A56.000Z',
+ );
expect(screen.getByTestId('glb-viewer')).toHaveAttribute('data-force-opaque', 'true');
expect(screen.getByAltText('Source image')).toBeInTheDocument();
});
diff --git a/server/services/imageTo3d/trellis2.js b/server/services/imageTo3d/trellis2.js
index 4da5414305..af33d7ea4c 100644
--- a/server/services/imageTo3d/trellis2.js
+++ b/server/services/imageTo3d/trellis2.js
@@ -720,7 +720,7 @@ const HF_AUTH_HELP = 'TRELLIS.2 could not download a gated model dependency from
* pipelineType?: string, unifiedMemoryGb?: number,
* onProgress?: (frame: object) => void,
* spawnImpl?: Function, exists?: (p: string) => boolean,
- * env?: NodeJS.ProcessEnv, postprocessGlb?: (path: string) => Promise<void>}} opts
+ * env?: NodeJS.ProcessEnv, postprocessGlb?: (path: string) => void|Promise<void>}} opts
* @returns {{promise: Promise<{assetPath: string}>, kill: () => void}}
*/
export function runTrellis2Generate({
@@ -741,7 +741,7 @@ export function runTrellis2Generate({
err.code = 'TRELLIS2_NOT_INSTALLED';
return { promise: Promise.reject(err), kill: () => {} };
}
- const resolvedPipelineType = pipelineType || selectTrellis2PipelineType(unifiedMemoryGb);
+ const resolvedPipelineType = pipelineType ?? selectTrellis2PipelineType(unifiedMemoryGb);
const { command, args } = buildGenerateArgs({
imagePath,
outputPath,