--- 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 - **Trained Model:** [Qistinasofea/controlnet-floorplan](https://huggingface.co/Qistinasofea/controlnet-floorplan) - **Dataset:** [Qistinasofea/floorplan-12k-aligned](https://huggingface.co/datasets/Qistinasofea/floorplan-12k-aligned) - **Training Notebook:** Available in model repository --- ## 🎓 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**