Qistinasofea's picture
upload 3 files
7f550d4 verified

A newer version of the Gradio SDK is available: 6.7.0

Upgrade
metadata
title: Draw Your Floorplan - ControlNet
emoji: 🏠
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
models:
  - Qistinasofea/controlnet-floorplan
  - stable-diffusion-v1-5/stable-diffusion-v1-5

🏠 Draw Your Floorplan - ControlNet

AI54 Final Project - Spatially Conditioned Floorplan Generation

🎨 Interactive Demo

This Space allows you to draw colored segmentation masks and generate architectural floorplans using a fine-tuned ControlNet model.

How to Use:

  1. Draw colored regions on the canvas - each color represents a different room type
  2. Describe your floorplan in the text box
  3. Adjust settings if needed (inference steps, control strength, seed)
  4. Click Generate Floorplan to see your AI-generated layout!

Suggested Colors:

  • πŸ”΄ Red - Living room / Main spaces
  • 🟒 Green - Bedrooms
  • πŸ”΅ Blue - Bathrooms
  • 🟑 Yellow - Kitchen
  • 🟣 Purple - Dining area
  • 🟠 Orange - Office / Study
  • 🩡 Cyan - Utility / Storage

πŸ“Š Model Information

Training Details:

  • Method: Full ControlNet Fine-Tuning
  • Base Model: Stable Diffusion 1.5 (frozen)
  • ControlNet: Segmentation variant (fully trained)
  • Dataset: 11,375 orientation-normalized floorplan samples
  • Parameters: 361M trainable parameters (100% of ControlNet)
  • Training Steps: 10,000
  • Final Loss: 0.0887
  • Training Time: 3.7 hours on T4 GPU

Architecture:

The model uses a two-stage architecture:

  1. Base Model (SD 1.5): Generates realistic textures and appearance (frozen weights)
  2. ControlNet: Guides spatial structure based on colored segmentation input (fully fine-tuned)

This separation allows the model to:

  • βœ… Preserve spatial layouts from user drawings
  • βœ… Generate realistic architectural details
  • βœ… Maintain consistent room boundaries
  • βœ… Produce diverse outputs from the same layout

πŸ”— Links


πŸŽ“ Academic Context

This is a final project for AI54: Artificial Intelligence course focused on:

  • Conditional image generation
  • Spatial control in diffusion models
  • ControlNet architecture and training
  • Parameter-efficient fine-tuning considerations
  • Real-world application development

Key Contributions:

  1. Dataset Preprocessing: Orientation normalization using PCA-based rotation alignment
  2. Training Strategy: Full fine-tuning justified by dataset size (11,375 samples)
  3. User Interface: Visual layout-driven interaction for non-technical users

πŸ’» Technical Stack

  • Framework: πŸ€— Diffusers
  • Model: ControlNet + Stable Diffusion 1.5
  • Interface: Gradio
  • Deployment: HuggingFace Spaces
  • Hardware: GPU-enabled (T4 or better recommended)

πŸ“ Citation

If you use this model or approach in your work, please cite:

@misc{controlnet-floorplan-2024,
  author = {Qistinasofea},
  title = {ControlNet for Floorplan Generation},
  year = {2024},
  publisher = {HuggingFace},
  howpublished = {\url{https://huggingface.co/Qistinasofea/controlnet-floorplan}}
}

πŸ“„ License

This project is released under the MIT License. The base Stable Diffusion 1.5 model follows its original CreativeML Open RAIL-M license.


Built with ❀️ for AI54 Final Project