diff --git a/server/index.ts b/server/index.ts index 5cd22b3..125f03c 100644 --- a/server/index.ts +++ b/server/index.ts @@ -989,13 +989,13 @@ app.post("/api/3d-gen", async (c) => { if (!image_url) return c.json({ error: "image_url required" }, 400); try { - const res = await fetch("https://fal.run/fal-ai/trellis", { + const res = await fetch("https://fal.run/fal-ai/trellis-2", { method: "POST", headers: { Authorization: `Key ${FAL_KEY}`, "Content-Type": "application/json", }, - body: JSON.stringify({ image_url }), + body: JSON.stringify({ image_url, resolution: 1024 }), }); if (!res.ok) { @@ -1014,8 +1014,7 @@ app.post("/api/3d-gen", async (c) => { } const data = await res.json(); - // Trellis returns glb_url and/or model_mesh — download the GLB - const modelUrl = data.glb_url || data.model_mesh?.url || data.output?.url; + const modelUrl = data.model_glb?.url || data.glb_url || data.model_mesh?.url; if (!modelUrl) return c.json({ error: "No 3D model returned" }, 502); // Download the model file