docs/multiuser/admin_guide.md
This guide is for administrators managing a multi-user InvokeAI installation. It covers initial setup, user management, security best practices, and troubleshooting.
Before enabling multi-user support, ensure you have:
To put InvokeAI into multiuser mode, you will need to add the option
multiuser: true to its configuration file. This file is located at
INVOKEAI_ROOT/invokeai.yaml With the InvokeAI backend halted, add
the new configuration option to the end of the file with a text editor
so that it looks like this:
# Internal metadata - do not edit:
schema_version: 4.0.2
# Enable/disable multi-user mode
multiuser: true
Then restart the InvokeAI server backend from the command line or using the launcher.
!!! note "Reverting to single-user mode"
If at any time you wish to revert to single-user mode, simply comment
out the multiuser line, or change "true" to "false". Then
restart the server. Because of the way that browsers cache pages,
users with open InvokeAI sessions may need to force-refresh their
browsers.
When InvokeAI starts for the first time in multi-user mode, you'll see the Administrator Setup dialog.
Setup Steps:
Email Address: Enter a valid email address (this becomes your username)
[email protected] or admin@localhost for testingDisplay Name: Enter a friendly name
Password: Create a strong administrator password
Minimum requirements:
Recommended:
Confirm Password: Re-enter the password
Click Create Administrator Account
!!! warning "Important" Store these credentials securely! The first administrator account can reset the password to something new, but cannot retrieve a lost one.
InvokeAI can run in single-user or multi-user mode, controlled by the multiuser configuration option in invokeai.yaml:
# Enable/disable multi-user mode
multiuser: true # Enable multi-user mode (requires authentication)
# multiuser: false # Single-user mode (no authentication required)
# If the multiuser option is absent, single-user mode is used
# Database configuration
use_memory_db: false # Use persistent database
db_path: databases/invokeai.db # Database location
# Session configuration (multi-user mode only)
jwt_secret_key: "your-secret-key-here" # Auto-generated if not specified
jwt_token_expiry_hours: 24 # Default session timeout
jwt_remember_me_days: 7 # "Remember me" duration
Single-User Mode (multiuser: false or option absent):
Multi-User Mode (multiuser: true):
!!! warning "Mode Switching Behavior" Switching to Single-User Mode: If boards or images were created in multi-user mode, they will all be combined into a single unified view when switching to single-user mode.
**Switching to Multi-User Mode:** Legacy boards and images created under single-user mode will be owned by an internal user named "system." Only the Administrator will have access to these legacy assets. A utility to migrate these legacy assets to another user will be part of a future release.
When upgrading from a single-user installation or switching modes:
Migration Process:
# Backup your database first
cp databases/invokeai.db databases/invokeai.db.backup
# Enable multi-user mode in invokeai.yaml
# multiuser: true
# Start InvokeAI (migration happens automatically)
invokeai-web
# Complete the administrator setup dialog
# Legacy data will be owned by "system" user
!!! note "Legacy Asset Migration" A utility to migrate legacy "system"-owned assets to specific user accounts will be available in a future release. Until then, administrators can access and manage all legacy content.
Via Web Interface (Coming Soon):
!!! info "Web UI for User Management" A web-based user interface that allows administrators to manage users is coming in a future release. Until then, use the command-line scripts described below.
Via Command Line Scripts:
InvokeAI provides several command-line scripts in the scripts/ directory for user management:
useradd.py - Add a new user:
# Interactive mode (prompts for details)
python scripts/useradd.py
# Create a regular user
python scripts/useradd.py \
--email [email protected] \
--password TempPass123 \
--name "User Name"
# Create an administrator
python scripts/useradd.py \
--email [email protected] \
--password AdminPass123 \
--name "Admin Name" \
--admin
userlist.py - List all users:
# List all users
python scripts/userlist.py
# Show detailed information
python scripts/userlist.py --verbose
usermod.py - Modify an existing user:
# Change display name
python scripts/usermod.py --email [email protected] --name "New Name"
# Promote to administrator
python scripts/usermod.py --email [email protected] --admin
# Demote from administrator
python scripts/usermod.py --email [email protected] --no-admin
# Deactivate account
python scripts/usermod.py --email [email protected] --deactivate
# Reactivate account
python scripts/usermod.py --email [email protected] --activate
# Change password
python scripts/usermod.py --email [email protected] --password NewPassword123
userdel.py - Delete a user:
# Delete a user (prompts for confirmation)
python scripts/userdel.py --email [email protected]
# Delete without confirmation
python scripts/userdel.py --email [email protected] --force
!!! tip "Script Usage"
Run any script with --help to see all available options:
bash python scripts/useradd.py --help
!!! warning "Command Line Management" - These scripts directly modify the database - Always backup your database before making changes - Changes take effect immediately (users may need to log in again) - Deleting a user permanently removes all their content
Via Command Line:
Use usermod.py as described above to modify user properties.
!!! warning "Last Administrator" You cannot remove admin privileges from the last remaining administrator account.
Via Web Interface (Coming Soon):
Web-based password reset functionality for administrators is coming in a future release.
Via Command Line:
# Reset a user's password
python scripts/usermod.py --email [email protected] --password NewTempPassword123
Security Note: Never send passwords via email or unsecured channels. Use secure communication methods.
Via Command Line:
# Deactivate a user account
python scripts/usermod.py --email [email protected] --deactivate
# Reactivate a user account
python scripts/usermod.py --email [email protected] --activate
Effects:
Via Command Line:
# Delete a user (prompts for confirmation)
python scripts/userdel.py --email [email protected]
# Delete without confirmation prompt
python scripts/userdel.py --email [email protected] --force
Important:
!!! warning "Data Loss" Deleting a user permanently removes all their content. Back up the database first if recovery might be needed.
Queue Management:
User Statistics:
As an administrator, you have full access to model management.
Via Model Manager UI:
Supported Model Types:
Model Settings:
Default Settings:
Set default parameters that users will start with:
!!! warning "Impact" Removing a model affects all users who may be using it in workflows or saved settings.
Shared boards enable collaboration between users while maintaining control.
!!! note "Future Feature" Board sharing will be implemented in a future release.
| Level | View | Add Images | Edit/Delete | Manage Sharing |
|---|---|---|---|---|
| Read | ✅ | ❌ | ❌ | ❌ |
| Write | ✅ | ✅ | ✅ | ❌ |
| Admin | ✅ | ✅ | ✅ | ✅ |
Permission Recommendations:
Add Users to Shared Board:
Remove Users from Shared Board:
Change User Permissions:
Enforced Requirements:
Recommended Policies:
Session Security and Token Management:
This system uses stateless JWT tokens with HMAC signatures to identify users after they provide their initial credentials. The tokens will persist for 24 hours by default, or for 7 days if the user clicks the "Remember me" checkbox at login. Expired tokens are automatically rejected and the user will have to log in again.
At the client side, tokens are stored in browser localStorage. Logging out clears them. No server-side session storage is required.
The tokens include the user's ID, email, and admin status, along with an HMAC signature.
Important: The JWT secret key must be kept confidential.
To generate tokens, each InvokeAI instance has a distinct secret JWT key that must be
kept confidential. The key is stored in the app_settings table of
the InvokeAI database with in a field value named jwt_secret.
The secret key is automatically generated during database creation or migration. If you wish to change the key, you may generate a replacement using either of these commands:
# Python
python -c "import secrets; print(secrets.token_urlsafe(32))"
# OpenSSL
openssl rand -base64 32
Then cut and paste the printed secret into this Sqlite3 command:
sqlite3 INVOKE_ROOT/databases/invokeai.db 'update app_settings set value="THE_SECRET" where key="jwt_secret"'
(replace INVOKE_ROOT with your InvokeAI root directory and THE_SECRET with the new secret).
After this, restart the server. All logged in users will be logged out and will need to provide their usernames and passwords again.
The multiuser feature allows you to run an InvokeAI backend that can be accessed by your friends and family across your home network. It is also possible to host a backend that is accessible over the Internet.
By default, InvokeAI runs on localhost, IP address 127.0.0.1,
which is only accessible to browsers running on the same machine as
the backend. To make the backend accessible to any machine on your
home or work LAN, add the line host: 0.0.0.0 to the InvokeAI
configuration file, usually stored at INVOKE_ROOT/invokeai.yaml.
Here is a minimal example.
# Internal metadata - do not edit:
schema_version: 4.0.2
# Put user settings here - see https://invoke-ai.github.io/InvokeAI/configuration/:
multiuser: true
host: 0.0.0.0
After relaunching the backend you will be able to reach the server from other machines on the LAN using the server machine's IP address or hostname and port 9090.
!!! warning "Use at your own risk" The InvokeAI team has done its best to make the software free of exploitable bugs, but the software has not undergone a rigorous security audit or intrusion testing. Use at your own risk
It is also possible to create a (semi) public server accessible from the Internet. The details of how to do this depend very much on your home or corporate router/firewall system and are beyond the scope of this document.
If you expose InvokeAI to the Internet, there are a number of precautions to take. Here is a brief list of recommended network security practices.
HTTPS Configuration:
For internet deployments, always use HTTPS:
# Use a reverse proxy like nginx or Traefik
# Example nginx configuration:
server {
listen 443 ssl http2;
server_name invoke.example.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:9090;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Firewall Rules:
It is best to restrict access to trusted networks and remote IP
addresses, or use a VPN to connect to your home network. Rate limit
connections to InvokeAI's authentication endpoint
http://your.host:9090/login.
Backup and Recovery:
It is a good idea to periodically backup your InvokeAI database, images, and possibly models in the event of unauthorized use of a publicly-accessible server.
Manual Backup:
# Stop InvokeAI
# Copy database file
cd INVOKE_ROOT
cp databases/invokeai.db databases/invokeai.db.$(date +%Y%m%d)
# Or create compressed backup
tar -czf invokeai_backup_$(date +%Y%m%d).tar.gz databases/
Automated Backup Script:
#!/bin/bash
# backup_invokeai.sh
INVOKE_ROOT="/path/to/invoke_root"
BACKUP_DIR="/path/to/backups"
DB_PATH="$INVOKE_ROOT/databases/invokeai.db"
DATE=$(date +%Y%m%d_%H%M%S)
# Create backup directory
mkdir -p "$BACKUP_DIR"
# Copy database
cp "$DB_PATH" "$BACKUP_DIR/invokeai_$DATE.db"
# Keep only last 30 days
find "$BACKUP_DIR" -name "invokeai_*.db" -mtime +30 -delete
echo "Backup completed: invokeai_$DATE.db"
Schedule with cron:
# Edit crontab
crontab -e
# Add daily backup at 2 AM
0 2 * * * /path/to/backup_invokeai.sh
# Stop InvokeAI
# Replace current database with backup
cd INVOKE_ROOT
cp databases/invokeai.db databases/invokeai.db.old # Save current
cp databases/invokeai_backup.db databases/invokeai.db
# Restart InvokeAI
invokeai-web
Disaster Recover - Complete System Backup:
Include these directories/files:
databases/ - All database filesmodels/ - Installed models (if locally stored)outputs/ - Generated imagesinvokeai.yaml - Configuration fileRecovery Process:
Symptom: User reports unable to log in
Diagnosis:
Verify account exists and is active
sqlite3 databases/invokeai.db "SELECT * FROM users WHERE email = '[email protected]';"
Check password (have user try resetting)
Verify account is active (is_active = 1)
Check for account lockout (if implemented)
Solutions:
Symptom: "Database is locked" errors
Causes:
Solutions:
# Check for locks
fuser databases/invokeai.db
# Increase timeout (in config)
# Or switch to WAL mode:
sqlite3 databases/invokeai.db "PRAGMA journal_mode=WAL;"
Recovery Process:
Stop InvokeAI
Direct database access:
sqlite3 databases/invokeai.db
Reset admin password (requires password hash):
-- Generate hash first using Python:
-- from passlib.context import CryptContext
-- pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
-- print(pwd_context.hash("NewPassword123"))
UPDATE users
SET password_hash = '$2b$12$...'
WHERE email = '[email protected]';
Restart InvokeAI
Alternative: Remove jwt_secret_key from config to trigger setup wizard (will create new admin).
Symptom: Slow generation or UI
Diagnosis:
Solutions:
VACUUM, ANALYZE)Symptom: Database migration fails on upgrade
Prevention:
Recovery:
# Restore backup
cp databases/invokeai.db.backup databases/invokeai.db
# Try migration again with verbose logging
invokeai-web --log-level DEBUG
# invokeai.yaml - Multi-user configuration
# Internal metadata - do not edit:
schema_version: 4.0.2
# Put user settings here
multiuser: true
# Server
host: "0.0.0.0"
port: 9090
# Performance
enable_partial_loading: true
precision: float16
pytorch_cuda_alloc_conf: "backend:cudaMallocAsync"
hashing_algorithm: blake3_multi
The backend will support dozens of concurrent users. However, because the image generation queue is single-threaded, image generation tasks are processed on a first-come, first-serve basis. This means that a user may have to wait for all the other users' image generation jobs to complete before their generation job starts to execute.
A future version of InvokeAI may support concurrent execution on systems with multiple GPUs/graphics cards.
OAuth2/OpenID Connect support is planned for a future release. Currently, InvokeAI uses its own authentication system.
Full audit logging is planned for a future release. Currently, you can:
Not in the current release. All users can view and use all installed models. Per-user model access is a possible enhancement.
Best practice:
InvokeAI remains under its existing license. Multi-user mode does not change licensing terms.
When reporting administrator issues, include:
Need additional assistance? Visit the InvokeAI Discord or file an issue on GitHub.