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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: centralize image-to-3d gated repositories (#3033)
[._.]/ Adam Eivye6cb3a9a8c25
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex e924493e28..1b3c6e2d09 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -6,6 +6,7 @@## 3D+- **[issue-3033] 3D setup notices now stay in sync with each model's Hugging Face requirements** — the server now describes which gated repositories each image-to-3D target needs, so the 3D page, install guidance, and render-error help all draw from the same source. Adding a target with different (or no) gated dependencies no longer risks showing stale setup instructions.- **Mesh preview display controls moved out of the render, and the lighting sliders now actually change the lighting** — the settings panel was an always-mounted overlay pinned inside the canvas, covering the upper-right quadrant of every model; it now lives behind a small toggle in the corner and expands as a strip *below* the render, so it can never occlude the mesh. Two of the controls it exposed were also effectively inert. The procedural studio environment lit the model at full strength and drowned out Ambient/Key/Fill — a new **Environment** slider dials the image-based lighting down (to 0 for lights-only), and the three light defaults were rebalanced against it. **Show HDRI background** revealed a cube map whose unlit areas were pure black, so the studio read as hard-edged white panels floating in a void (and only ever lit the model from three directions); an inward-facing backdrop sphere fills the gaps, and the map is rendered at 256 instead of 128. The scene-level background color was dropped in favor of the surface's CSS color it duplicated — a scene background raced the environment's own `scene.background` save/restore every time the HDRI toggle or the color picker changed.- **Generated meshes are easier to inspect and get a denser texture atlas on high-memory Macs** — the GLB preview now has a background color picker, and an offline procedural light environment makes TRELLIS's metallic PBR surfaces readable instead of turning details such as dark glass into black patches. Newly generated models use a 4K texture bake when at least 48 GB of unified memory is available (four times the 2K texel budget); supported 24 GB systems keep the proven 2K path.- **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.diff --git a/client/src/pages/Media3D.jsx b/client/src/pages/Media3D.jsxindex b88069a00d..64efeb63ca 100644--- a/client/src/pages/Media3D.jsx+++ b/client/src/pages/Media3D.jsx@@ -16,17 +16,6 @@ import { imageTo3dStatusMeta } from '../components/media/imageTo3dStatus';// Poll cadence while a render is in flight (a real TRELLIS.2 render is multi-minute).const POLL_INTERVAL_MS = 2500;-// Targets that download gated Hugging Face models on first run. Keyed by target id-// so the page can warn about the (free, one-time) HF sign-in + terms acceptance-// BEFORE a render fails opaquely. TRELLIS.2 pulls DINOv3 (image conditioning) and-// RMBG-2.0 (background removal), both gated Meta/BRIA repos.-const HF_GATED_MODELS = {- trellis2: [- { label: 'facebook/dinov3-vitl16-pretrain-lvd1689m', url: 'https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m' },- { label: 'briaai/RMBG-2.0', url: 'https://huggingface.co/briaai/RMBG-2.0' },- ],-};-// Prerequisite notice for a target that needs gated Hugging Face access. Driven by// the CENTRAL token store (GET /image-gen/setup/hf-token-status) — the same one the// Image Gen page writes — so a user who already pasted a token isn't told to go set@@ -333,7 +322,8 @@ export default function Media3D() {return null;})();- const gatedHfModels = selectedTarget?.available ? HF_GATED_MODELS[selectedTarget?.id] : null;+ const gatedHfModels = selectedTarget?.available ? selectedTarget.gatedRepos : null;+ const gatedRepoCount = installTarget?.gatedRepos?.length || 0;return (<div className="mx-auto max-w-4xl">@@ -402,7 +392,7 @@ export default function Media3D() {)}</div>- {gatedHfModels && (+ {gatedHfModels?.length > 0 && (<HfAccessNoticemodels={gatedHfModels}tokenPresent={hfTokenPresent}@@ -533,7 +523,7 @@ export default function Media3D() {params={installTarget?.textureBake?.quality === 'fallback' ? { repair: '1' } : undefined}description={installTarget?.textureBake?.quality === 'fallback'? 'Downloading the Xcode Metal Toolchain if it\'s missing, then re-running the TRELLIS.2 setup to rebuild its Metal texture-baking backends. Your already-downloaded models are kept, and no password is required.'- : 'Cloning the TRELLIS.2 (Apple Silicon) port and installing its Python environment (~15 GB on first run). If the Xcode Metal Toolchain is missing it is downloaded first, so textures bake at full quality. It also pulls two gated Hugging Face models on first render — accept their terms and add a Hugging Face token above (see the note on the 3D page).'}+ : `Cloning the TRELLIS.2 (Apple Silicon) port and installing its Python environment (~15 GB on first run). If the Xcode Metal Toolchain is missing it is downloaded first, so textures bake at full quality.${gatedRepoCount ? ` It also pulls ${gatedRepoCount} gated Hugging Face ${gatedRepoCount === 1 ? 'model' : 'models'} on first render — accept their terms and add a Hugging Face token above (see the note on the 3D page).` : ''}`}onClose={() => setInstallTarget(null)}onComplete={() => { setInstallTarget(null); load(); }}/>diff --git a/client/src/pages/Media3D.test.jsx b/client/src/pages/Media3D.test.jsxindex bee3125de7..4eb0b5eccf 100644--- a/client/src/pages/Media3D.test.jsx+++ b/client/src/pages/Media3D.test.jsx@@ -19,7 +19,9 @@ vi.mock('../services/api', () => ({// Stub the shared install modal so the test doesn't open a real EventSource;// assert only that it's opened with the chosen target.vi.mock('../components/install/RuntimeInstallModal', () => ({- default: ({ open, runtime }) => (open ? <div data-testid="install-modal">installing {runtime}</div> : null),+ default: ({ open, runtime, description }) => (open ? <div data-testid="install-modal">+ installing {runtime}<span data-testid="install-description">{description}</span>+ </div> : null),}));// GlbViewer wraps a WebGL canvas jsdom can't render — stub to a marker that@@ -48,6 +50,13 @@ const target = (over = {}) => ({unavailableReason: null,upstream: 'https://github.com/microsoft/TRELLIS.2',port: 'https://github.com/shivampkumar/trellis-mac',+ gatedRepos: [+ {+ label: 'facebook/dinov3-vitl16-pretrain-lvd1689m',+ url: 'https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m',+ },+ { label: 'briaai/RMBG-2.0', url: 'https://huggingface.co/briaai/RMBG-2.0' },+ ],...over,});@@ -81,6 +90,13 @@ describe('Media3D — models & install', () => {expect(await screen.findByTestId('install-modal')).toHaveTextContent('trellis2');});+ it('uses the selected target gated-repo count in the install description', async () => {+ getImageTo3dTargets.mockResolvedValue({ capabilities: {}, targets: [target()] });+ renderAt();+ fireEvent.click(await screen.findByRole('button', { name: /install/i }));+ expect(await screen.findByTestId('install-description')).toHaveTextContent('2 gated Hugging Face models');+ });+it('shows Ready and no Install button when the target is installed', async () => {getImageTo3dTargets.mockResolvedValue({ targets: [target({ installed: true })] });renderAt();@@ -208,6 +224,16 @@ describe('Media3D — generation workspace', () => {expect(screen.getByRole('link', { name: /RMBG-2\.0/i })).toBeInTheDocument();});+ it('renders no gated-access notice when the selected target omits gatedRepos', async () => {+ getImageTo3dTargets.mockResolvedValue({ targets: [target({ gatedRepos: undefined, installed: true })] });+ renderAt('/media/3d?image=example-robot.png');+ await screen.findByRole('button', { name: /Generate 3D/i });+ await waitFor(() => expect(getHfTokenStatus).toHaveBeenCalled());+ expect(screen.queryByPlaceholderText('hf_…')).toBeNull();+ expect(screen.queryByText(/Hugging Face token configured/i)).toBeNull();+ expect(screen.queryByRole('link', { name: /dinov3-vitl16-pretrain-lvd1689m/i })).toBeNull();+ });+it('collapses to a confirmation naming the source when a token already exists', async () => {// The user's real complaint: an HF_TOKEN set for imagegen/local-LLM downloads was// ignored here, so the page kept demanding a terminal login.diff --git a/server/routes/imageTo3d.test.js b/server/routes/imageTo3d.test.jsindex 290a641e1d..1bfa91bc25 100644--- a/server/routes/imageTo3d.test.js+++ b/server/routes/imageTo3d.test.js@@ -18,6 +18,13 @@ vi.mock('../services/imageTo3d/targets.js', () => ({outputKind: 'glb-mesh',available: caps.appleSilicon && caps.unifiedMemoryGb >= 24,unavailableReason: null,+ gatedRepos: [+ {+ label: 'facebook/dinov3-vitl16-pretrain-lvd1689m',+ url: 'https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m',+ },+ { label: 'briaai/RMBG-2.0', url: 'https://huggingface.co/briaai/RMBG-2.0' },+ ],},]),isTargetAvailable: vi.fn(() => true),@@ -84,7 +91,18 @@ describe('image-to-3d routes', () => {expect(res.status).toBe(200);expect(res.body.capabilities).toMatchObject({ appleSilicon: true, unifiedMemoryGb: 128 });expect(Array.isArray(res.body.targets)).toBe(true);- expect(res.body.targets[0]).toMatchObject({ id: 'trellis2', available: true, installed: false });+ expect(res.body.targets[0]).toMatchObject({+ id: 'trellis2',+ available: true,+ installed: false,+ gatedRepos: [+ {+ label: 'facebook/dinov3-vitl16-pretrain-lvd1689m',+ url: 'https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m',+ },+ { label: 'briaai/RMBG-2.0', url: 'https://huggingface.co/briaai/RMBG-2.0' },+ ],+ });});// #2952: an installed TRELLIS.2 whose Metal bake is missing still renders, butdiff --git a/server/services/imageTo3d/targets.js b/server/services/imageTo3d/targets.jsindex 108486d240..3efeb42d36 100644--- a/server/services/imageTo3d/targets.js+++ b/server/services/imageTo3d/targets.js@@ -69,6 +69,19 @@ export const IMAGE_TO_3D_TARGETS = Object.freeze({// Community MPS port that makes the CUDA-only upstream run on Apple Silicon.port: 'https://github.com/shivampkumar/trellis-mac',weightsRepo: 'microsoft/TRELLIS.2-4B',+ // Optional user-actionable prerequisites. The target descriptor is the source+ // for both the API/UI notice and runner auth guidance, so new targets do not+ // need their gated Hugging Face dependencies duplicated in either consumer.+ gatedRepos: Object.freeze([+ Object.freeze({+ label: 'facebook/dinov3-vitl16-pretrain-lvd1689m',+ url: 'https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m',+ }),+ Object.freeze({+ label: 'briaai/RMBG-2.0',+ url: 'https://huggingface.co/briaai/RMBG-2.0',+ }),+ ]),// Wired in later phases (issue #2951); referenced by path, never imported here.installerModule: 'server/services/imageTo3d/trellis2Install.js',runnerModule: 'server/services/imageTo3d/trellis2.js',diff --git a/server/services/imageTo3d/targets.test.js b/server/services/imageTo3d/targets.test.jsindex a7e5e79507..abc0803f18 100644--- a/server/services/imageTo3d/targets.test.js+++ b/server/services/imageTo3d/targets.test.js@@ -31,11 +31,23 @@ describe('image-to-3d target registry', () => {outputKind: OUTPUT_KIND.GLB_MESH,});expect(t.requires).toMatchObject({ appleSilicon: true, minUnifiedMemoryGb: 24 });+ expect(t.gatedRepos).toEqual([+ {+ label: 'facebook/dinov3-vitl16-pretrain-lvd1689m',+ url: 'https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m',+ },+ {+ label: 'briaai/RMBG-2.0',+ url: 'https://huggingface.co/briaai/RMBG-2.0',+ },+ ]);});it('freezes the registry and its descriptors so a target cannot be mutated at runtime', () => {expect(Object.isFrozen(IMAGE_TO_3D_TARGETS)).toBe(true);expect(Object.isFrozen(IMAGE_TO_3D_TARGETS.trellis2)).toBe(true);+ expect(Object.isFrozen(IMAGE_TO_3D_TARGETS.trellis2.gatedRepos)).toBe(true);+ expect(Object.isFrozen(IMAGE_TO_3D_TARGETS.trellis2.gatedRepos[0])).toBe(true);expect(() => {IMAGE_TO_3D_TARGETS.trellis2.label = 'hacked';}).toThrow();@@ -121,6 +133,7 @@ describe('listTargets', () => {expect(available.find((t) => t.id === 'trellis2')).toMatchObject({available: true,unavailableReason: null,+ gatedRepos: IMAGE_TO_3D_TARGETS.trellis2.gatedRepos,});const blocked = listTargets(CUDA_BOX);diff --git a/server/services/imageTo3d/trellis2.js b/server/services/imageTo3d/trellis2.jsindex 17e1fe19a9..a189e31ac4 100644--- a/server/services/imageTo3d/trellis2.js+++ b/server/services/imageTo3d/trellis2.js@@ -25,6 +25,7 @@ import { fileURLToPath } from 'node:url';import { spawn, execFile } from 'node:child_process';import { killWithEscalation } from '../../lib/killWithEscalation.js';import { rewriteGlbMaterialsOpaque } from './glbMaterials.js';+import { getTarget } from './targets.js';const HOME = homedir();const IS_WIN = platform() === 'win32';@@ -709,9 +710,12 @@ export const isHfAuthError = textMatcher([* page is the fix; the CLI/env route is the fallback for someone already set up that* way. Terms acceptance is a separate step a token alone doesn't cover.*/+const HF_AUTH_REPOS = getTarget('trellis2')?.gatedRepos ?? [];+const HF_AUTH_REPO_HELP = HF_AUTH_REPOS+ .map(({ label, url }) => `${label} at ${url}`)+ .join(' and ') || 'the required model at https://huggingface.co';const HF_AUTH_HELP = 'TRELLIS.2 could not download a gated model dependency from '- + 'Hugging Face. Accept the terms for facebook/dinov3-vitl16-pretrain-lvd1689m at '- + 'https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m, then add your '+ + `Hugging Face. Accept the terms for ${HF_AUTH_REPO_HELP}, then add your `+ 'Hugging Face token on the 3D page (or set HF_TOKEN / run `huggingface-cli login`) '+ 'and try again.';diff --git a/server/services/imageTo3d/trellis2.test.js b/server/services/imageTo3d/trellis2.test.jsindex 9997f5eae0..277a2bc307 100644--- a/server/services/imageTo3d/trellis2.test.js+++ b/server/services/imageTo3d/trellis2.test.js@@ -32,6 +32,7 @@ import {selectTrellis2PipelineType,selectTrellis2TextureSize,} from './trellis2.js';+import { getTarget } from './targets.js';const flush = () => new Promise((resolve) => setTimeout(resolve, 0));@@ -514,10 +515,16 @@ describe('runTrellis2Generate', () => {'huggingface_hub.errors.GatedRepoError: 401 Client Error. '+ 'Access to model facebook/dinov3-vitl16-pretrain-lvd1689m is restricted.\n');child.emit('close', 1);- await expect(promise).rejects.toMatchObject({+ const error = await promise.catch((err) => err);+ const gatedRepos = getTarget('trellis2').gatedRepos;+ expect(error).toMatchObject({code: 'TRELLIS2_HF_AUTH_REQUIRED',message: expect.stringMatching(/hugging face/i),});+ for (const gatedRepo of gatedRepos) {+ expect(error.message).toContain(gatedRepo.label);+ expect(error.message).toContain(gatedRepo.url);+ }});it('rejects when it exits 0 but never reported a .glb', async () => {