Skip to content

Nsuccess/Wiggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Wiggly - AI-Powered 3D Interactive Animation Design Platform

Wiggly is an innovative platform that transforms user-uploaded images into custom T-shirt designs with AI-generated textures and 3D models. The platform combines computer vision, AI texture generation, and 3D modeling to create personalized apparel.

πŸš€ Features

  • AI Texture Generation: Upload front and back images to generate seamless T-shirt textures
  • 3D Model Creation: Automatically generate 3D T-shirt models with applied textures
  • Real-time Processing: Fast texture and model generation using Modal cloud infrastructure
  • Multiple Deployment Options: Support for both direct API and n8n workflow integration
  • Cloud-Native Architecture: Scalable deployment on Modal with Weaviate vector database

πŸ—οΈ Architecture

Architecture Diagram

The platform follows a modern cloud-native architecture:

πŸ“ Project Structure

β”œβ”€β”€ frontend/                 # Next.js frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/             # App router pages
β”‚   β”‚   └── components/      # React components
β”‚   └── public/              # Static assets
β”œβ”€β”€ wiggle/
β”‚   β”œβ”€β”€ backend/             # Backend API and services
β”‚   β”‚   β”œβ”€β”€ modal_integrated_deploy.py  # Main Modal deployment
β”‚   β”‚   β”œβ”€β”€ direct_api.py               # Direct API server
β”‚   β”‚   β”œβ”€β”€ weaviate_*.py              # Database utilities
β”‚   β”‚   β”œβ”€β”€ n8n_workflow.json          # N8N automation workflow
β”‚   β”‚   └── README.md                  # Backend documentation
β”‚   └── frontend/            # Alternative frontend (if needed)
β”œβ”€β”€ front.png               # Sample front image
β”œβ”€β”€ back.png                # Sample back image
└── README.md               # This file

πŸ› οΈ Technology Stack

Technology Stack

Frontend

  • Next.js 14 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • Three.js - 3D model rendering

Backend

  • FastAPI - High-performance Python web framework
  • Modal - Serverless cloud platform for AI workloads
  • Blender - 3D modeling and texture application
  • Weaviate - Vector database for AI embeddings
  • N8N - Workflow automation platform

AI/ML

  • Computer Vision - Image processing and analysis
  • Texture Synthesis - AI-powered texture generation
  • 3D Modeling - Automated T-shirt model creation

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm/bun
  • Python 3.12+
  • Modal account and CLI
  • Weaviate cloud instance

1. Frontend Setup

cd frontend
npm install
npm run dev

The frontend will be available at http://localhost:3000

2. Backend Setup

Option A: Modal Cloud Deployment (Recommended)

cd wiggle/backend
pip install modal
modal token new
modal deploy modal_integrated_deploy.py

Option B: Local Development

cd wiggle/backend
pip install -r requirements_direct_api.txt
python run_direct_api.py

3. Environment Configuration

Create .env files with the following variables:

WEAVIATE_GRPC_ENDPOINT=your_weaviate_endpoint
WEAVIATE_API_KEY=your_weaviate_key
MODAL_API_URL=your_modal_deployment_url

πŸ“‘ API Endpoints

Main API (Modal Deployment)

  • Base URL: https://ykzou1214--wiggle-integrated-api-fastapi-app.modal.run

Endpoints:

  • POST /api/texture/generate - Generate texture and 3D model
  • GET /api/texture/download/{filename} - Download generated texture
  • GET /api/model/download/{filename} - Download 3D model
  • GET /health - Health check

Example Usage:

curl -X POST "https://ykzou1214--wiggle-integrated-api-fastapi-app.modal.run/api/texture/generate" \
  -F "userId=user123" \
  -F "front=@front.png" \
  -F "back=@back.png"

Response:

{
  "status": "completed",
  "buildId": "uuid-here",
  "modelUrl": "/api/model/download/model_uuid.glb",
  "textureUrl": "/api/texture/download/texture_uuid.png",
  "message": "3D model with texture generated successfully"
}

πŸ”„ N8N Workflow Integration

N8N Workflow

The project includes a pre-configured N8N workflow for complete automation:

  • File: wiggle/backend/n8n_workflow.json
  • Features:
    • Automated texture generation pipeline
    • Webhook integration for external triggers
    • Database storage with Weaviate
    • Error handling and logging
    • File management and cleanup
  • Setup: Import the JSON file into your N8N instance
  • Documentation: See N8N Deployment Guide for detailed setup instructions

πŸ§ͺ Testing

Test the Complete Pipeline:

# Test texture generation
curl -X POST "https://ykzou1214--wiggle-integrated-api-fastapi-app.modal.run/api/texture/generate" \
  -F "userId=test_user" \
  -F "front=@front.png" \
  -F "back=@back.png"

# Download generated files
curl -o model.glb "https://ykzou1214--wiggle-integrated-api-fastapi-app.modal.run/api/model/download/model_id.glb"
curl -o texture.png "https://ykzou1214--wiggle-integrated-api-fastapi-app.modal.run/api/texture/download/texture_id.png"

πŸ“Š Performance

  • Texture Generation: ~30-60 seconds
  • 3D Model Creation: ~10-20 seconds
  • File Sizes:
    • Textures: ~200KB PNG
    • Models: ~1KB OBJ format
  • Concurrent Users: Scales automatically with Modal

πŸ”§ Development

Local Development Setup:

# Backend
cd wiggle/backend
python -m venv venv
source venv/bin/activate  # or `venv\Scripts\activate` on Windows
pip install -r requirements_direct_api.txt
python run_direct_api.py

# Frontend
cd frontend
npm install
npm run dev

Deployment:

# Deploy to Modal
modal deploy modal_integrated_deploy.py

# Build frontend
npm run build

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

For support and questions:

🎯 Roadmap

  • Support for additional garment types
  • Advanced texture customization options
  • Real-time 3D preview
  • Mobile app development
  • Marketplace integration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published