Skip to content

sarvanithin/Buildify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—οΈ Buildify

AI-Powered Residential Floor Plan Generator

Buildify turns a handful of home requirements β€” bedrooms, bathrooms, square footage, style β€” into multiple, ready-to-review architectural floor plans in seconds. Every plan is structurally sound, zero-gap, and compliant with US residential building codes.


🧭 What Is Buildify?

Buildify is an end-to-end AI platform for residential architectural design. It combines a locally trained Mixture of Experts (MOE) neural network for intelligent room sizing, HouseGAN++ graph-based spatial topology, and a deterministic zone-based layout solver to produce realistic, buildable floor plans β€” not hallucinated geometry.

Unlike pure generative approaches, Buildify's hybrid pipeline ensures every plan:

  • Has zero gaps between rooms β€” rooms are packed edge-to-edge on a 2ft construction grid
  • Respects US IRC (International Residential Code) minimums β€” e.g. 70 sq ft for habitable rooms
  • Has correct architectural proportions β€” houses are 60–80 ft wide and 40–65 ft deep, not skyscraper towers
  • Varies meaningfully across variants β€” different garage arrangements, room groupings, and outdoor configurations

πŸš€ What You Can Do With Buildify

Use Case Description
🏑 Instant Conceptual Design Enter beds, baths, sqft and style β€” get 3 distinct plan variants immediately
πŸ“ Charrette Board Comparison Compare all generated plans side-by-side as architectural cards with 2D minimaps
πŸ” Detailed 2D Review Click into any plan to examine a scaled, color-coded architectural floor plan with room labels and dimensions
🏠 3D Exterior Visualization Switch to a clean, white architectural 3D exterior with roof, windows, and lawn
πŸ’¬ Design Consultation Use the integrated AI chat to ask questions about your plan, room sizes, or code requirements
πŸ“¦ Export to CAD Export any plan as a .dxf file for import into AutoCAD or any professional CAD tool
πŸ’° Cost Estimator Get a regional cost estimate based on your plan's sqft and room configuration

🧠 System Architecture

Buildify uses a 5-stage hybrid generation pipeline. The diagram below shows exactly how a user request flows from constraints to final plan:

flowchart TD
    %% ─── USER INPUT ───────────────────────────────────────────────────
    A([πŸ‘€ User Constraints\n Beds Β· Baths Β· SqFt Β· Style\n Garage Β· Outdoor Β· Office]) --> B

    %% ─── FRONTEND ─────────────────────────────────────────────────────
    subgraph FE ["βš›οΈ  React Frontend  (Vite + TypeScript)"]
        B[Room Catalog\nConstraint Form]
        B --> C[POST /api/generate/moe]
    end

    %% ─── BACKEND API ──────────────────────────────────────────────────
    subgraph BE ["🐍  FastAPI Backend"]
        C --> D

        subgraph PIPE ["πŸ”  5-Stage Generation Pipeline"]
            direction TB

            D["πŸ“‹  Stage 1 β€” BUILD\nDeterministic room list\nfrom IRC specs & constraints\n─────────────────\n2-Car Garage Β· Foyer Β· Mudroom\nLiving Β· Dining Β· Family Β· Kitchen\nHallway Β· Primary Suite Β· Bedrooms\nBathrooms Β· Patio …"]

            D --> E["🧠  Stage 2 β€” SIZE  (MOE Model)\nMixture of Experts neural net\nOutputs 8 expert weights β†’\nscales each room's W Γ— H\nbased on SqFt & Style target\n─────────────────\n8 Experts: Room Sizing Β·\nSpatial Layout Β· Style Adaptation\nCode Compliance Β· Adjacency\nCirculation Β· Outdoor & Garage\nCost Optimization"]

            E --> F{"Stage 3 β€” PLACE\nHouseGAN++ Available?"}

            F -- Yes --> G["πŸ•ΈοΈ  HouseGAN++\nGraph-based bubble diagram\nTopological adjacency placement\nRoom graph β†’ XY coordinates"]
            F -- No --> H["πŸ—ΊοΈ  Zone-Based Architectural Solver\nEntry Band  β†’ Garage Β· Foyer Β· Mudroom\nSocial Band β†’ Living Β· Dining Β· Kitchen\nHallway     β†’ Full-width 4 ft spine\nPrivate Bandβ†’ Primary Suite Β· Bedrooms\nOutdoor Bandβ†’ Patio Β· Deck"]

            G --> I
            H --> I

            I["βœ…  Stage 4 β€” VALIDATE  (IRC)\nEnforce room minimums\nβ€’ Habitable rooms β‰₯ 70 sq ft\nβ€’ Bedrooms β‰₯ 10 Γ— 10 ft\nβ€’ Hallway β‰₯ 36 in wide\nClamp all rooms to footprint"]

            I --> J["πŸ“  Stage 5 β€” REFINE\nSnap to 2 ft construction grid\nClose all inter-room gaps\nForce exact footprint width\nResolve overlaps\nβ†’ Zero-gap guarantee"]
        end

        J --> K["πŸ“Š  Confidence Scoring\n+ IRC Compliance Flag\n+ Expert Weight Breakdown"]
    end

    %% ─── OUTPUT ───────────────────────────────────────────────────────
    K --> L

    subgraph UI ["πŸ–₯️  Plan Viewer (React + Three.js)"]
        L["πŸ—‚οΈ  Charrette Board\nA Β· B Β· C variant cards\nColor-coded 2D minimap\nSqFt Β· Beds Β· Baths Β· Footprint"]
        L --> M["πŸ“  2D Architectural Plan\nScaled room layout\nDimensions + Labels\nDoor swings"]
        L --> N["🏠  3D Exterior View\nWhite architectural model\nSegmented roofline · Windows\nLawn · Foundation"]
        L --> O["🚢  Walk Mode  *(coming soon)*\nFirst-person exploration\nPointer-lock + WASD controls"]
        L --> P["πŸ”²  Top View  *(coming soon)*\nBird's-eye colored blocks\nRoom labels overlay"]
    end

    M --> Q["πŸ“¦  Export DXF Β· Cost Estimate Β· Design Score"]
Loading

πŸ—‚οΈ Project Structure

Buildify/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                  # FastAPI app β€” all API routes
β”‚   β”œβ”€β”€ generator.py             # Deterministic floor plan generator
β”‚   β”œβ”€β”€ scoring.py               # Design quality scoring
β”‚   β”œβ”€β”€ cost.py                  # Regional cost estimator
β”‚   β”œβ”€β”€ exporter.py              # DXF CAD export
β”‚   β”œβ”€β”€ rag.py                   # RAG-based AI design chat
β”‚   └── moe/
β”‚       β”œβ”€β”€ model.py             # BuildifyMOE β€” PyTorch Mixture of Experts
β”‚       β”œβ”€β”€ inference.py         # 5-stage generation pipeline
β”‚       β”œβ”€β”€ data.py              # IRC room specs + training data synthesis
β”‚       β”œβ”€β”€ experts.py           # 8 named expert definitions
β”‚       β”œβ”€β”€ config.py            # MOE hyperparameters
β”‚       β”œβ”€β”€ api_auth.py          # API key management
β”‚       └── weights/
β”‚           └── buildify_moe.pt  # Trained model weights
└── frontend/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ App.tsx              # Root layout + routing
    β”‚   β”œβ”€β”€ App.css              # Design system + component styles
    β”‚   β”œβ”€β”€ api/client.ts        # Typed API client (axios)
    β”‚   β”œβ”€β”€ types/floorplan.ts   # Shared TypeScript types
    β”‚   └── components/
    β”‚       β”œβ”€β”€ ConstraintForm.tsx     # Room catalog sidebar
    β”‚       β”œβ”€β”€ FloorPlanGallery.tsx   # Charrette Board (A/B/C cards)
    β”‚       β”œβ”€β”€ FloorPlanPreview.tsx   # Color-coded 2D SVG minimap
    β”‚       β”œβ”€β”€ ArchPlan.tsx           # Full 2D architectural plan renderer
    β”‚       β”œβ”€β”€ View3D.tsx             # Three.js 3D visualization
    β”‚       └── FloorPlanEditor.tsx    # Plan detail view + mode switcher
    └── vite.config.ts

πŸ› οΈ Tech Stack

Layer Technology Purpose
Frontend React 18 + Vite + TypeScript UI framework
3D Visualization Three.js / React Three Fiber 3D exterior, walk mode
2D Rendering SVG / Canvas (custom) Architectural plan renderer
Styling Vanilla CSS (custom design system) Dark sidebar, Charrette Board
Backend FastAPI (Python 3.11) REST API layer
AI Model PyTorch β€” Mixture of Experts Room sizing intelligence
Spatial Layout HouseGAN++ Graph-based room placement
Building Codes IRC 2021 (R304, R311.7) Room minimums & compliance
CAD Export ezdxf DXF file generation

⚑ Running Locally

Backend

cd backend
pip install -r requirements.txt
python3 -m uvicorn main:app --host 0.0.0.0 --port 8002 --reload
# API docs available at http://localhost:8002/docs

Frontend

cd frontend
npm install
npm run dev
# App available at http://localhost:5173

The Vite dev server proxies all /api/* requests to http://localhost:8002 automatically.


🏠 Example Plans

For a 3 bed Β· 2 bath Β· 1,800 sq ft Β· Modern home, Buildify generates 3 variants:

Variant Dimensions Rooms Total Area
Plan A β€” Optimized 68 W Γ— 60 D ft 17 rooms 2,332 sq ft
Plan B β€” Balanced 68 W Γ— 62 D ft 17 rooms 2,352 sq ft
Plan C β€” Efficient 68 W Γ— 60 D ft 17 rooms 2,388 sq ft

Each plan includes: 2-Car Garage Β· Mudroom Β· Laundry Β· Foyer Β· Living Room Β· Dining Area Β· Family Room Β· Kitchen Β· Pantry Β· Main Hallway Β· Primary Suite Β· Primary Bath Β· Primary Closet Β· 2Γ— Bedroom Β· Shared Bath Β· Rear Patio


πŸ—ΊοΈ Roadmap

  • MOE model training pipeline
  • HouseGAN++ integration with zone-based fallback
  • IRC compliance validation
  • Zero-gap layout guarantee
  • Charrette Board UI (A/B/C variant comparison)
  • 3D white architectural exterior
  • DXF CAD export
  • Regional cost estimator
  • First-person 3D walkthrough (WASD + pointer lock)
  • Top-view colored block mode (bird's-eye with room labels)
  • Door/window placement in plans
  • Multi-story support
  • Direct integration with Autodesk, SketchUp, or Revit

πŸ“ License

This project is open-source under the MIT License.


Built with πŸ€– AI + πŸ“ Architecture + πŸ—οΈ Engineering

About

AI-powered residential floor plan generator using a hybrid Mixture of Experts (MOE) and HouseGAN++ pipeline. Produces true-to-scale, IRC-compliant architectural layouts with interactive 3D visualization and walkthroughs.

Topics

Resources

License

Stars

Watchers

Forks

Packages