Skip to content

bikram73/Interior_Designer_Using_AI

Repository files navigation

Interior Designer AI 🏠✨

A modern AI-powered app to redesign interior spaces. Upload a room image or generate from scratch, pick a style, and get a high-quality interior concept in seconds.

Interior Designer AI

Next.js React TypeScript Tailwind CSS MIT License

🌟 Features

  • 🎨 Clean, modern UI with animation and glassmorphism effects
  • πŸ–ΌοΈ Upload-and-transform flow for existing room photos
  • 🧠 Generate-new flow for fresh room concepts
  • 🏷️ Multiple styles: Modern, Vintage, Minimalist, Professional
  • 🏠 Multiple room presets: Living Room, Dining Room, Bedroom, Bathroom, Office
  • πŸ“± Responsive layout for desktop and mobile
  • πŸ“₯ Download generated images directly from the app
  • πŸ” Built-in model and endpoint fallback logic for reliable generation

πŸ€– AI Provider

This project uses a multi-provider fallback chain:

  1. AI Horde (primary)
  2. Cloudflare AI (fallback)
  3. Hugging Face (fallback)
  • Required env variable: AI_HORDE_API_KEY
  • Optional fallback env variables: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID, HUGGINGFACE_API_KEY
  • Generation first attempts AI Horde, then Cloudflare AI, then Hugging Face

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm
  • AI Horde API key
  • (Optional) Cloudflare Workers AI token + account ID for fallback
  • (Optional) Hugging Face token with inference permissions for fallback

1. Clone

git clone https://github.com/bikram73/Interior_Designer_Using_AI.git
cd Interior_Designer_Using_AI

2. Install

npm install

3. Configure Environment

Create .env.local in project root:

AI_HORDE_API_KEY=ah_your_token_here
CLOUDFLARE_API_TOKEN=cfut_your_token_here
CLOUDFLARE_ACCOUNT_ID=your_account_id_here
HUGGINGFACE_API_KEY=hf_your_token_here

You can also copy from .env.example and replace the token value.

4. Run

npm run dev

Open:

If port 3000 is busy, Next.js automatically runs on another port (typically 3001).

🧭 Usage

Flow A: Transform Uploaded Room

  1. Upload a room image
  2. Select style and room type
  3. Click the generate button
  4. Preview and download result

Flow B: Generate New Room

  1. Do not upload any image
  2. Select style and room type
  3. Click generate to create a new room concept

πŸ”Œ API Endpoints

POST /api/replicate

Image transformation endpoint (path retained for frontend compatibility).

Request body example:

{
  "image": "data:image/jpeg;base64,...",
  "theme": "Modern",
  "room": "Living Room",
  "provider": "auto"
}

POST /api/generate-new

Generate a new styled room concept without image upload.

Request body example:

{
  "theme": "Modern",
  "room": "Living Room",
  "provider": "auto"
}

Provider values:

  • auto (fallback chain)
  • ai-horde
  • cloudflare-ai
  • hugging-face

POST /api/check-horde

Disabled endpoint (returns HTTP 410) and not used in current provider setup.

πŸ—‚οΈ Project Structure

interior-designer-ai-main/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ check-horde/
β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   β”œβ”€β”€ generate-new/
β”‚   β”‚   β”‚   └── route.ts
β”‚   β”‚   └── replicate/
β”‚   β”‚       └── route.ts
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   └── page-components.tsx
β”‚   β”œβ”€β”€ desktop-sidebar.tsx
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ globals.css
β”‚   β”œβ”€β”€ header.tsx
β”‚   β”œβ”€β”€ layout.tsx
β”‚   β”œβ”€β”€ manifest.ts
β”‚   β”œβ”€β”€ mobile-sidebar.tsx
β”‚   β”œβ”€β”€ page.tsx
β”‚   β”œβ”€β”€ selectmenu.tsx
β”‚   └── sidebar.tsx
β”œβ”€β”€ common/
β”‚   └── index.ts
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ app-screenshot.png
β”‚   └── see-running-app.png
β”œβ”€β”€ types/
β”‚   └── index.ts
β”œβ”€β”€ utils/
β”‚   └── index.ts
β”œβ”€β”€ .env.example
β”œβ”€β”€ .env.local
β”œβ”€β”€ LICENSE
β”œβ”€β”€ next.config.js
β”œβ”€β”€ package.json
β”œβ”€β”€ postcss.config.js
β”œβ”€β”€ tailwind.config.js
└── tsconfig.json

πŸ› οΈ Scripts

npm run dev
npm run build
npm run start
npm run lint

🧩 Troubleshooting

Windows .next cache/readlink error

If you get EINVAL/readlink issues on Windows, clear cache and restart:

if (Test-Path .next) { attrib -R -S -H .next /S /D; Remove-Item -LiteralPath .next -Recurse -Force -ErrorAction SilentlyContinue }
if (Test-Path .next) { cmd /c "rd /s /q .next" }
npm run dev

AI Horde generation fails

Check these quickly:

  • AI_HORDE_API_KEY exists in .env.local
  • Key is valid and active
  • AI Horde queue may be busy; retry after a short wait
  • Terminal logs for AI Horde submit/check/status errors

If AI Horde fails, the app automatically tries Hugging Face.

Cloudflare AI generation fails

Check these quickly:

  • CLOUDFLARE_API_TOKEN exists in .env.local
  • CLOUDFLARE_ACCOUNT_ID matches your Cloudflare account
  • Token has Account -> Workers AI -> Edit permission
  • Workers AI is enabled for your account
  • Terminal logs for Cloudflare status/body details

If Cloudflare fails in auto mode, the app falls back to Hugging Face.

Hugging Face generation fails

Check these quickly:

  • HUGGINGFACE_API_KEY exists in .env.local
  • Token has Inference permission
  • Hugging Face quota/rate limits are available
  • Terminal logs for endpoint/model fallback details

If Hugging Face also fails, verify token/credits and retry.

πŸ” Security

  • Do not commit real API tokens
  • Rotate any token that was shared in chat, screenshots, or logs

πŸ“„ License

Licensed under MIT. See LICENSE.

About

🏠 Interior Designer AI is a modern full-stack application that leverages generative AI to redesign interior spaces from images or create new room concepts, featuring multiple styles, responsive UI, and reliable multi-provider inference using AI Horde, Cloudflare AI and Hugging Face.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors