Real-time text-to-3D and image-to-3D diffusion with live streaming, powered by fal.ai
Manifold lets you turn text prompts or images into 3D models using SAM-3d-objects 3D diffusion, streaming every step as it's generated. See your ideas take shape as voxels, meshes, and textures—all in an interactive, immersive viewer.
demo_video.mp4
- Prompt Enhancement — Groq LLM (
llama-3.3-70b) rewrites your text into an optimized image prompt + segmentation label - Image Generation —
fal-ai/z-image/turbogenerates a 3D-ready image in ~1s - 3D Reconstruction — SAM-3D runs geometry and appearance diffusion on H100, streaming voxel data via SSE callbacks at each denoising step
- Live Visualization — React Three Fiber renders voxels/mesh/GLB in real-time as data streams in
For image-to-3D, Groq's vision model (llama-4-scout) analyzes the uploaded image to generate the segmentation prompt.
- Node.js 18+ (for frontend)
- Python 3.11 (for serverless development)
- pnpm or npm (package manager)
- fal.ai account with API key
- Git with submodule support
git clone --recurse-submodules https://github.com/rehan-remade/Manifold.git
cd manifoldcd frontend
npm install # or pnpm installCreate frontend/.env.local:
FAL_KEY=your_fal_api_key_here
FAL_ENDPOINT_ID=rehan/sam-3d-stream
GROQ_API_KEY=your_groq_api_key_here # Optional, for prompt enhancementNote: You can use
rehan/sam-3d-streamdirectly, or deploy your own and update the endpoint ID.
npm run devOpen http://localhost:3000 🎉
Want to customize the SAM-3D backend? Deploy your own:
# Install fal CLI
pip install fal
# Login to fal
fal auth login
cd serverless
fal deploy sam-3d-streamThen update FAL_ENDPOINT_ID in .env.local with your new endpoint ID.
manifold/
├── frontend/ # Next.js web application
│ ├── app/
│ │ ├── page.tsx # Main orchestrator
│ │ ├── api/ # Server-side API routes
│ │ ├── components/ # React Three Fiber components
│ │ ├── hooks/ # useSAM3DStream SSE hook
│ │ └── lib/ # Types, decoders, constants
│ └── public/
│
├── serverless/ # fal.ai serverless endpoint
│ ├── app.py # SAM-3D streaming endpoint
│ └── pyproject.toml # fal app config
│
└── sam-3d/ # Git submodule (forked SAM-3D Objects)
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Built with ❤️ using fal.ai
