Skip to content

AlexKer/doodle-bloom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DoodleBloom 🌸

A complete sketch-to-3D flower generation system that transforms hand-drawn sketches into beautiful 3D models and creates shareable personalized gifts.

Overview

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

πŸš€ Quick Start

1. Deploy the WaLa Model with Truss

The WaLa model is configured for deployment using Truss, which packages ML models for production.

Prerequisites

  • Install Truss: pip install truss
  • Baseten account with API key
  • Hugging Face account (free)
  • Access to GPU resources (H100 40GB recommended)

Pre-deployment Setup

  1. Accept the WaLa model license on Hugging Face:

  2. 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
  3. 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

Deploy to Baseten

cd autodesk-wala-singleview-to-3d

# Deploy using Truss
truss push

# Or deploy with publishing
truss push --publish

The model will be deployed to Baseten and you'll receive an endpoint URL like: https://model-xxxxx.api.baseten.co/development/predict

Testing the Deployment

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.py

This will:

  • Send examples/single_view/flower.png to 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)

Configuration

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.)

2. Set up Netlify Viewer

The Netlify viewer provides a beautiful, mobile-friendly interface for sharing 3D flowers.

Prerequisites

  • Netlify account
  • Neon database (free tier available)

Setup Steps

  1. 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
  2. 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 string
      • PGHOST, PGUSER, PGPASSWORD, PGDATABASE - Individual credentials
    • No manual configuration needed!

Features

  • Auto-rotating 3D models with beautiful materials
  • Mobile-optimized touch controls
  • Shareable URLs for each flower
  • Download OBJ files
  • Personalized messages and sender names

3. Use Interactive Sketch Interface

The interactive_sketch.py script provides a complete web interface for creating personalized 3D flower gifts.

Prerequisites

  • Python 3.7+
  • Baseten API key
  • Netlify site URL

Usage

python interactive_sketch.py

The 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_KEY environment 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.

Features

  • 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

Example Workflow

  1. Run the script and open http://localhost:8080
  2. Draw a flower on the canvas
  3. Add a personalized message (e.g., "Happy Birthday! 🌸")
  4. Enter sender name
  5. Click "Generate 3D Gift!"
  6. Get instant shareable URL
  7. Send the link to your loved one!

πŸ”§ Advanced Usage

Upload Existing OBJ Files

python interactive_sketch.py
# Choose option 2: Upload existing OBJ file

Custom Model Configuration

Edit autodesk-wala-singleview-to-3d/config.yaml to:

  • Change model parameters
  • Adjust GPU requirements
  • Modify system packages

Customize Netlify Viewer

Edit netlify-viewer-3d/index.html to:

  • Change colors and materials
  • Modify lighting setup
  • Add custom branding
  • Adjust mobile responsiveness

πŸ“ Project Structure

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

🌟 Key Features

  • 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!

🎯 Perfect For

  • 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

🀝 Contributing

Feel free to submit issues and enhancement requests!

πŸ”§ Troubleshooting

Common Issues

  1. "Model not found" error during deployment

    • Make sure you accepted the WaLa license on Hugging Face
    • Verify your hf_access_token secret is set correctly in Baseten
  2. GPU memory errors

    • The model requires H100_40GB; smaller GPUs may not work
    • Try reducing target_num_faces in your requests
  3. Netlify functions not working

    • Ensure the Neon integration is properly connected
    • Check that DATABASE_URL is set in your Netlify environment variables
  4. 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
  5. 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

πŸ“„ License

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! 🌸✨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published