diff --git a/server/operators/trellis2_mlx/manifest.json b/server/operators/trellis2_mlx/manifest.json index d316fa8..01c590b 100644 --- a/server/operators/trellis2_mlx/manifest.json +++ b/server/operators/trellis2_mlx/manifest.json @@ -3,21 +3,77 @@ "name": "TRELLIS.2 MLX (local, fastest)", "category": "mesh-gen", "description": "Image → PBR GLB via the MRP MLX fork of TRELLIS.2 (monster/trellis-2-mrp-mlx): pure-MLX sampler, Metal PBR bake with RAM-sized face cap + forced-opaque alpha (2026-07-22 quality fixes — fal-parity detail), kdtree/vertex fallbacks. ~72s vertex / ~2min metal-PBR on m3ultra — still the fastest local TRELLIS.2. baker=vertex for the 1s clean-albedo bake (no MR maps). Weights: TRELLIS.2-4B + gated DINOv3/RMBG (rsync from m3 HF cache to workers; no HF login needed).", - "accepts": ["image"], - "produces": ["model"], + "accepts": [ + "image" + ], + "produces": [ + "model" + ], "resources": "gpu", "entry": "run.py", - "python": "vendor/trellis2-mlx/.venv/bin/python", "params_schema": { "type": "object", "properties": { - "pipeline_type": {"type": "string", "enum": ["512", "1024", "1024_cascade"], "default": "1024_cascade", "description": "Resolution tier"}, - "seed": {"type": "integer", "default": 0, "description": "Random seed"}, - "steps": {"type": "integer", "default": 12, "description": "Sampler steps per stage (12 = upstream default)"}, - "baker": {"type": "string", "enum": ["metal", "vertex", "kdtree"], "default": "metal", "description": "metal = UV PBR textures (meshgod-grade; minor dark-patch texels remain); vertex = 1s bake, cleanest colors, no MR maps"}, - "texture_size": {"type": "integer", "enum": [512, 1024, 2048, 4096], "default": 2048, "description": "Baked texture resolution (metal/kdtree bakers)"}, - "max_bake_faces": {"type": "integer", "enum": [200000, 500000, 1000000], "default": 500000, "description": "Pre-bake face cap. 500k ≈ fal parity (M3 Ultra verified); node RAM sizes the default when unset — laptops get 200k"}, - "alpha_mode": {"type": "string", "enum": ["opaque", "auto"], "default": "opaque", "description": "opaque = force alphaMode OPAQUE (fixes speckle-veil hair); auto = keep baked alpha for glassy subjects"} + "pipeline_type": { + "type": "string", + "enum": [ + "512", + "1024", + "1024_cascade" + ], + "default": "1024_cascade", + "description": "Resolution tier" + }, + "seed": { + "type": "integer", + "default": 0, + "description": "Random seed" + }, + "steps": { + "type": "integer", + "default": 12, + "description": "Sampler steps per stage (12 = upstream default)" + }, + "baker": { + "type": "string", + "enum": [ + "metal", + "vertex", + "kdtree" + ], + "default": "metal", + "description": "metal = UV PBR textures (meshgod-grade; minor dark-patch texels remain); vertex = 1s bake, cleanest colors, no MR maps" + }, + "texture_size": { + "type": "integer", + "enum": [ + 512, + 1024, + 2048, + 4096 + ], + "default": 2048, + "description": "Baked texture resolution (metal/kdtree bakers)" + }, + "max_bake_faces": { + "type": "integer", + "enum": [ + 200000, + 500000, + 1000000 + ], + "default": 500000, + "description": "Pre-bake face cap. 500k ≈ fal parity (M3 Ultra verified); node RAM sizes the default when unset — laptops get 200k" + }, + "alpha_mode": { + "type": "string", + "enum": [ + "opaque", + "auto" + ], + "default": "opaque", + "description": "opaque = force alphaMode OPAQUE (fixes speckle-veil hair); auto = keep baked alpha for glassy subjects" + } } } } diff --git a/server/operators/trellis_mac/manifest.json b/server/operators/trellis_mac/manifest.json index 99ed0bc..12544e2 100644 --- a/server/operators/trellis_mac/manifest.json +++ b/server/operators/trellis_mac/manifest.json @@ -3,22 +3,80 @@ "name": "TRELLIS.2 (local, SOTA)", "category": "mesh-gen", "description": "Image → GLB + baked PBR locally via the TRELLIS.2 MPS/Metal port (best open-weights quality on Apple Silicon, ~3-5 min/gen). Weights need a one-time HuggingFace login (facebook/dinov3-vitl16, briaai/RMBG-2.0). Note: 1536 is upstream-only; Mac port maxes at 1024_cascade.", - "accepts": ["image"], - "produces": ["model"], + "accepts": [ + "image" + ], + "produces": [ + "model" + ], "resources": "gpu", "entry": "run.py", - "python": "vendor/trellis-mac/.venv/bin/python", "params_schema": { "type": "object", "properties": { - "pipeline_type": {"type": "string", "enum": ["512", "1024", "1024_cascade"], "default": "1024", "description": "Resolution tier (1024_cascade = highest quality on Mac)"}, - "texture_size": {"type": "integer", "enum": [512, 1024, 2048], "default": 2048, "description": "Baked texture resolution"}, - "seed": {"type": "integer", "default": 0, "description": "Random seed"}, - "no_texture": {"type": "boolean", "default": false, "description": "Geometry only (skip texture stage, much faster)"}, - "max_bake_faces": {"type": "integer", "enum": [200000, 500000, 1000000], "default": 500000, "description": "Pre-bake simplify cap. 500k ≈ fal parity, verified crash-free on the M3 Ultra (2026-07-22); drop to 200k on laptops (mtlbvh guard)"}, - "steps": {"type": "integer", "default": 0, "description": "Sampler steps override for all 3 flow phases (0 = pipeline default, 12)"}, - "baker": {"type": "string", "enum": ["", "vertex"], "default": "", "description": "'vertex' = KDTree vertex-color bake (dark-patch workaround, no PBR maps)"}, - "alpha_mode": {"type": "string", "enum": ["opaque", "auto"], "default": "opaque", "description": "opaque = force alphaMode OPAQUE in the GLB (fixes speckle-veil hair from noisy baked alpha); auto = keep o_voxel's BLEND detection for glassy subjects"} + "pipeline_type": { + "type": "string", + "enum": [ + "512", + "1024", + "1024_cascade" + ], + "default": "1024", + "description": "Resolution tier (1024_cascade = highest quality on Mac)" + }, + "texture_size": { + "type": "integer", + "enum": [ + 512, + 1024, + 2048 + ], + "default": 2048, + "description": "Baked texture resolution" + }, + "seed": { + "type": "integer", + "default": 0, + "description": "Random seed" + }, + "no_texture": { + "type": "boolean", + "default": false, + "description": "Geometry only (skip texture stage, much faster)" + }, + "max_bake_faces": { + "type": "integer", + "enum": [ + 200000, + 500000, + 1000000 + ], + "default": 500000, + "description": "Pre-bake simplify cap. 500k ≈ fal parity, verified crash-free on the M3 Ultra (2026-07-22); drop to 200k on laptops (mtlbvh guard)" + }, + "steps": { + "type": "integer", + "default": 0, + "description": "Sampler steps override for all 3 flow phases (0 = pipeline default, 12)" + }, + "baker": { + "type": "string", + "enum": [ + "", + "vertex" + ], + "default": "", + "description": "'vertex' = KDTree vertex-color bake (dark-patch workaround, no PBR maps)" + }, + "alpha_mode": { + "type": "string", + "enum": [ + "opaque", + "auto" + ], + "default": "opaque", + "description": "opaque = force alphaMode OPAQUE in the GLB (fixes speckle-veil hair from noisy baked alpha); auto = keep o_voxel's BLEND detection for glassy subjects" + } } } } diff --git a/server/operators/trellis_mac/run.py b/server/operators/trellis_mac/run.py index 7b083f4..23a2494 100644 --- a/server/operators/trellis_mac/run.py +++ b/server/operators/trellis_mac/run.py @@ -21,12 +21,18 @@ if not a.input: if not (VENDOR / "generate.py").exists(): print(f"ERROR: trellis-mac not installed at {VENDOR}. Run scripts/install_trellis_mac.sh") sys.exit(1) +# manifest no longer pins "python" (broke remote dispatch when the venv path +# didn't exist on the worker) — resolve the vendor venv here instead. +VENV_PY = VENDOR / ".venv" / "bin" / "python" +if not VENV_PY.exists(): + print(f"ERROR: no venv at {VENV_PY} — run scripts/install_trellis_mac.sh") + sys.exit(1) outdir = Path(a.outdir) out_stem = outdir / f"trellis2_{Path(a.input[0]).stem}" cmd = [ - sys.executable, "generate.py", str(Path(a.input[0]).resolve()), + str(VENV_PY), "generate.py", str(Path(a.input[0]).resolve()), "--pipeline-type", str(p.get("pipeline_type", "1024")), "--texture-size", str(p.get("texture_size", 2048)), "--seed", str(p.get("seed", 0)),