WritingBasetenBasetenpublished Oct 10, 2025seen Jun 26

From Sketch To 3d Model Building A Flower Card Generator With Open Source Ai

Open original ↗

Captured source

source ↗

From Sketch to 3D Model: Building a flower card generator with open source AI Announcing our Series F . Learn more

AI engineering

From Sketch to 3D Model: Building a flower card generator with open source AI

Learn how to transform Autodesk's WaLa research model into a production API that converts sketches into shareable 3D flower cards using Truss and Netlify

Authors

Alex Ker

Last updated October 10, 2025

Share

TL;DR Learn how to transform Autodesk's WaLa research model into a production API that converts sketches into shareable 3D flower cards using Truss and Netlify

In a world saturated with 2D image generation, there's something uniquely satisfying about creating 3D objects. They can break free from the screen, ready to be rotated, printed, or dropped into virtual worlds and games. I'm not a 3D designer nor a particularly talented artist. That's why I was amazed when I discovered Autodesk's WaLa model on GitHub. This model can transform simple sketches or images instantly into 3D renderings. To experiment with it, I decided to build a 3D flower card application– flowers turned out to be perfect for showcasing WaLa's abilities. In this tutorial, you'll learn how to serve Autodesk's cutting-edge model as a scalable API. We'll transform 2D drawings into detailed 3D objects on Baseten and serve the results as shareable links hosted on Netlify. Instead of focusing on each line of code, I'll cover the high-level architecture. We'll explore how to turn a complex frontier open source model like WaLa into an API via Truss. Then we'll build a complete web application around it. Everything will be available open source in a GitHub repository you can experiment with. What is WaLa? ✕ WALA GitHub repo WaLa (Wavelet-based Latent Diffusion) is Autodesk's breakthrough model for single-view 3D reconstruction. Given a single 2D image of an object, it generates a complete 3D model using wavelet-based diffusion in latent space. What makes WaLa special is its ability to work with just one image. No need for multiple angles or complex setups. It generates high-quality OBJ meshes, a simple format that stores 3D geometric objects, with proper topology that are ready for 3D printing or game engines. The inference is surprisingly fast, taking only a few seconds on a single H100 MIG, or half a H100. While there are many variants (WaLa-SV), we'll use the single-view model, which I found to produce better quality results than the sketch model. How to Turn Any Open Source Model into Scalable Inference APIs Step 1: Understanding the Model Structure First, let's look at what we're working with. The WaLa repository the following structure: WaLa/ ├── src/ │   ├── latent_model/ │   ├── diffusion_modules/ │   └── model_utils.py ├── configs/ └── requirements.txt The challenge is that the repo is designed for research, not API serving. It expects command-line usage, has complex dependencies, and needs CUDA compilation. So this is where truss comes in. Truss is an open source framework that packages ML models for production deployment. It handles the complexity of containerization, dependencies, and scaling. Let’s take a look at how we could create a truss for this model. Step 2: Creating the Truss Package Structure Truss requires a specific structure as specified below: autodesk-wala-singleview-to-3d/ ├── model/ │   └── model.py         # Your model wrapper ├── packages/            # Vendored dependencies │   └── src/            # WaLa source code ├── config.yaml         # Truss configuration └── requirements.txt    # Python dependencies The key insight is vendoring, or copying the source code of a third-party library directly into your project's repository, rather than relying on a package manager to download and manage it dynamically. In other words, let’s put the entire WaLa source code into packages/ . Step 3: Writing the Model Wrapper The heart of Truss is the Model class. It implements two key methods. Only pseudocode is provided below for concision. 1 class Model : 2 def load ( self ): 3 """Called once when the model server starts""" 4 # 1. Add vendored code to Python path 5 # 2. Import WaLa modules 6 # 3. Download model from HuggingFace 7 # 4. Initialize model and transforms 8 def predict ( self, model_input ): 9 """Called for each inference request""" 10 # 1. Decode base64 image 11 # 2. Preprocess with transforms 12 # 3. Run inference using imported modules 13 # 4. Return base64-encoded OBJ Step 4: Configuring Truss The config.yaml tells Truss how to deploy: 1 model_name: ADSKAILab/WaLa-SV-1B 2 python_version: py311 3 resources:   accelerator: H100_40GB 4 use_gpu: true 5 requirements_file: ./requirements.txt # taken directly from the WaLa repo 6 system_packages: 7 - libgl1-mesa-glx     # OpenGL for 3D processing 8 - libegl1-mesa 9 - libglib2.0-0 10 secrets: 11 hf_access_token: null   # Set in Baseten dashboard The configuration decisions were important to get right. I chose the H100MIG GPU because WaLa needs a good amount of memory for its diffusion process and since it’s only a 1B parameter model, a single H100MIG (half a H100) is sufficient. The system packages might seem random, but they're essential OpenGL libraries that WaLa uses for mesh processing. Rather than hardcoding credentials, I used Baseten's secrets management to store the HuggingFace token securely. Step 5: Deploying to Baseten With the prerequisites handled, deployment is simple: cd autodesk-wala-singleview-to-3d truss push --publish The beauty of Truss is that it handles all the complex infrastructure work. It builds a Docker container with all your dependencies. It compiles those tricky CUDA extensions. It sets up a production-grade model server and deploys everything to Baseten's GPU infrastructure. It even configures auto-scaling based on load, so your API can handle traffic spikes. After about 5 minutes, you'll get a production endpoint. The next time you use an endpoint like this, cold-start times will be much faster as the model is now cached. Testing the API Once deployed, testing is straightforward. You send a POST request with a base64-encoded image. You get back a base64-encoded OBJ file. There are just a couple of parameters to play with. The scale parameter (I found 1.8 works best for most images) and seed if you want reproducible results. The API typically responds in a few seconds with a complete 3D...

Excerpt shown — open the source for the full document.

Notability

notability 5.0/10

Substantive tutorial post on building a 3D generator with open source AI.