DreamLayer

Installation Guide

Complete, OS-agnostic installation guide for DreamLayer AI with GPU/CPU setup instructions.

📋 System Requirements

Minimum Requirements

GPU Support

🛠️ Pre-Installation Setup

1. Install Python

Windows:

# Download from python.org or use winget
winget install Python.Python.3.11

macOS:

# Using Homebrew
brew install python@3.11

# Or download from python.org

Linux (Ubuntu/Debian):

sudo apt update
sudo apt install python3.11 python3.11-pip python3.11-venv

2. Install Node.js

Windows:

# Download from nodejs.org or use winget
winget install OpenJS.NodeJS

macOS:

# Using Homebrew
brew install node

# Or download from nodejs.org

Linux (Ubuntu/Debian):

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

3. Install Git

Windows:

# Download from git-scm.com or use winget
winget install Git.Git

macOS:

# Using Homebrew
brew install git

# Or download from git-scm.com

Linux (Ubuntu/Debian):

sudo apt install git

📦 Installation Methods

macOS/Linux

# Clone the repository
git clone https://github.com/DreamLayer-AI/DreamLayer.git
cd DreamLayer

# Make scripts executable
chmod +x install_mac_dependencies.sh
chmod +x start_dream_layer.sh

# Run installation
./install_mac_dependencies.sh

Windows

# Clone the repository
git clone https://github.com/DreamLayer-AI/DreamLayer.git
cd DreamLayer

# Run installation
install_windows_dependencies.bat

Method 2: Manual Installation

1. Clone Repository

git clone https://github.com/DreamLayer-AI/DreamLayer.git
cd DreamLayer

2. Install Python Dependencies

# Create virtual environment
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate

# Install Python packages
pip install -r requirements.txt

3. Install Node.js Dependencies

cd dream_layer_frontend
npm install
cd ..

4. Setup ComfyUI

# ComfyUI should be included in the repository
# If not, clone it manually:
git clone https://github.com/comfyanonymous/ComfyUI.git

🔧 Configuration

1. Environment Variables

Create a .env file in the root directory:

# API Keys (optional - for cloud models)
OPENAI_API_KEY=your_openai_api_key_here
IDEOGRAM_API_KEY=your_ideogram_api_key_here
BFL_API_KEY=your_bfl_api_key_here

# Server Configuration
FLASK_PORT=5000
COMFYUI_PORT=8188
FRONTEND_PORT=8080

2. Directory Configuration

Set up your directories in the web interface:

  1. Start DreamLayer (see Quick Start)
  2. Go to SettingsPaths
  3. Configure directories:
    • Output Directory: Where generated images are saved
    • Models Directory: Where your models are stored

3. Model Setup

Download Models

# Create models directory
mkdir -p models/checkpoints
mkdir -p models/loras
mkdir -p models/controlnet
mkdir -p models/upscalers

# Download Stable Diffusion models
# Example: SD 1.5
wget https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned.safetensors -O models/checkpoints/sd15.safetensors

Supported Model Formats

🚀 Starting DreamLayer

Automated Start

macOS/Linux:

./start_dream_layer.sh

Windows:

start_dream_layer.bat

Manual Start

1. Start ComfyUI Server

cd ComfyUI
python main.py --listen 0.0.0.0 --port 8188

2. Start Flask API Server

cd dream_layer_backend
python dream_layer.py

3. Start Frontend Development Server

cd dream_layer_frontend
npm run dev

Access DreamLayer

Open your browser and navigate to:

🔍 Verification

Check Installation

  1. Verify Python packages:
    python -c "import torch; print(f'PyTorch: {torch.__version__}')"
    python -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}')"
    
  2. Verify Node.js packages:
    cd dream_layer_frontend
    npm list --depth=0
    
  3. Test API endpoints:
    curl http://localhost:5000/api/models
    

Performance Testing

  1. Generate a test image using the web interface
  2. Check generation time (should be <30 seconds on GPU)
  3. Verify output quality and file saving

🚨 Troubleshooting

Common Issues

Python Import Errors

# Reinstall packages
pip install --force-reinstall -r requirements.txt

CUDA Issues

# Check CUDA installation
nvidia-smi
python -c "import torch; print(torch.cuda.is_available())"

# Reinstall PyTorch with CUDA
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

Port Conflicts

# Check port usage
netstat -tulpn | grep :8080
netstat -tulpn | grep :5000
netstat -tulpn | grep :8188

# Kill processes using ports
kill -9 <PID>

Memory Issues

# Reduce batch size in settings
# Use CPU mode for testing
# Close other applications

Getting Help

🔄 Updates

Updating DreamLayer

# Pull latest changes
git pull origin main

# Reinstall dependencies (if needed)
./install_mac_dependencies.sh  # or install_windows_dependencies.bat

Updating Models

# Models are automatically detected on restart
# Or refresh in the web interface

Need help? Check out the Quick Start Guide for a faster setup.