A complete sketch-to-3D flower generation system that transforms hand-drawn sketches into beautiful 3D models and creates shareable personalized gifts.
DoodleBloom consists of three main components:
- WaLa Model: AI model that converts 2D sketches to 3D flowers
- Interactive Sketch Interface: Web-based drawing tool with personalization
- Netlify Viewer: Shareable 3D model viewer with database storage
The WaLa model is configured for deployment using Truss, which packages ML models for production.
- Install Truss:
pip install truss - Baseten account with API key
- Hugging Face account (free)
- Access to GPU resources (H100 40GB recommended)
-
Accept the WaLa model license on Hugging Face:
- Go to https://huggingface.co/ADSKAILab/WaLa-SV-1B
- Click "Accept License"
-
Set up Baseten secret for Hugging Face token:
- In Baseten dashboard, go to Secrets
- Create a secret named
hf_access_token - Add your Hugging Face read token as the value
-
Vendor the WaLa source code (if not already present):
cd autodesk-wala-singleview-to-3d # Check if packages/src exists if [ ! -d "packages/src" ]; then bash vendor_wala.sh fi
cd autodesk-wala-singleview-to-3d
# Deploy using Truss
truss push
# Or deploy with publishing
truss push --publishThe model will be deployed to Baseten and you'll receive an endpoint URL like:
https://model-xxxxx.api.baseten.co/development/predict
Test your model with the included script:
cd autodesk-wala-singleview-to-3d
export BASETEN_API_KEY="your-api-key"
# Edit test.py to update the URL (line 21) with your endpoint
python test.pyThis will:
- Send
examples/single_view/flower.pngto your model - Generate a 3D model in ~10-15 seconds
- Save the result as
output.obj - Display an interactive 3D preview (if trimesh/plotly installed)
The config.yaml file specifies:
- Model:
ADSKAILab/WaLa-SV-1B - Python version: 3.11
- GPU: H100_40GB (full 40GB variant)
- System packages for OpenGL support (libgl1-mesa-glx, etc.)
The Netlify viewer provides a beautiful, mobile-friendly interface for sharing 3D flowers.
- Netlify account
- Neon database (free tier available)
-
Install dependencies and deploy:
cd netlify-viewer-3d # Install dependencies npm install # Install Netlify CLI globally if needed npm install -g netlify-cli # Login to Netlify netlify login # Deploy to production netlify deploy --prod
-
Connect Neon Database (for storing 3D models):
- In Netlify dashboard, go to Integrations tab
- Search for "Neon" in the integration marketplace
- Click "Enable" on the Neon integration
- Create a new Neon project (free tier works great)
- The integration automatically adds these environment variables:
DATABASE_URL- Full connection stringPGHOST,PGUSER,PGPASSWORD,PGDATABASE- Individual credentials
- No manual configuration needed!
- Auto-rotating 3D models with beautiful materials
- Mobile-optimized touch controls
- Shareable URLs for each flower
- Download OBJ files
- Personalized messages and sender names
The interactive_sketch.py script provides a complete web interface for creating personalized 3D flower gifts.
- Python 3.7+
- Baseten API key
- Netlify site URL
python interactive_sketch.pyThe script will prompt for:
- Baseten endpoint URL (from step 1) - e.g.,
https://model-xxxxx.api.baseten.co/development/predict - Baseten API key (or set
BASETEN_API_KEYenvironment variable) - Netlify site URL (from step 2) - e.g.,
https://your-app.netlify.app
Note: The script defaults to localhost:8080. Open this URL in your browser after starting.
- Drawing Interface: Touch-friendly canvas for sketching flowers
- Personalization: Add custom messages and sender names
- Auto-generation: Converts sketches to 3D models automatically
- Instant Sharing: Creates shareable URLs automatically
- Mobile Optimized: Works perfectly on phones and tablets
- Run the script and open
http://localhost:8080 - Draw a flower on the canvas
- Add a personalized message (e.g., "Happy Birthday! πΈ")
- Enter sender name
- Click "Generate 3D Gift!"
- Get instant shareable URL
- Send the link to your loved one!
python interactive_sketch.py
# Choose option 2: Upload existing OBJ fileEdit autodesk-wala-singleview-to-3d/config.yaml to:
- Change model parameters
- Adjust GPU requirements
- Modify system packages
Edit netlify-viewer-3d/index.html to:
- Change colors and materials
- Modify lighting setup
- Add custom branding
- Adjust mobile responsiveness
doodle-bloom/
βββ autodesk-wala-singleview-to-3d/ # WaLa model and Truss config
β βββ config.yaml # Truss deployment config
β βββ requirements.txt # Python dependencies
β βββ model/ # Model implementation
β βββ packages/ # Model packages
βββ netlify-viewer-3d/ # 3D viewer and sharing platform
β βββ index.html # Main viewer interface
β βββ netlify/functions/ # Serverless functions
β βββ package.json # Node.js dependencies
βββ interactive_sketch.py # Interactive drawing interface
βββ README.md # This file
- Sketch-to-3D: Transform any flower drawing into a 3D model
- Personalization: Add custom messages and sender names
- Instant Sharing: Generate shareable URLs automatically
- Mobile-First: Optimized for phones and tablets
- Professional Quality: Beautiful materials and lighting
- Zero Setup: Just draw and share!
- Gift Creation: Personalized 3D flowers for special occasions
- Social Media: Viral content with instant sharing
- Educational: Learning about 3D generation and AI
- Prototyping: Quick 3D model creation from sketches
Feel free to submit issues and enhancement requests!
-
"Model not found" error during deployment
- Make sure you accepted the WaLa license on Hugging Face
- Verify your
hf_access_tokensecret is set correctly in Baseten
-
GPU memory errors
- The model requires H100_40GB; smaller GPUs may not work
- Try reducing
target_num_facesin your requests
-
Netlify functions not working
- Ensure the Neon integration is properly connected
- Check that
DATABASE_URLis set in your Netlify environment variables
-
Interactive sketch not connecting
- Update the hardcoded URL in test.py (line 21) with your actual endpoint
- Make sure your Baseten API key is valid
-
Vendor script fails
- The vendor_wala.sh script should be run from within the autodesk-wala-singleview-to-3d directory
- Ensure you have curl and unzip installed
This project uses the WaLa model from Autodesk Research. Please check their licensing terms for commercial use.
Ready to create beautiful 3D flower gifts? Start with python interactive_sketch.py and let your creativity bloom! πΈβ¨