Skip to content

Conversation

Copy link

Copilot AI commented Jan 15, 2026

Summary

Implements Phase 8 of the multiuser implementation plan: comprehensive documentation for end users, administrators, and API consumers. Updated to reflect recent implementation changes including single-user mode support and CLI-based user management.

Documentation Created

User Guide (docs/multiuser/user_guide.md) - 428 lines

  • Single-user vs multi-user mode explanation
  • Login and account management (multi-user mode)
  • Role capabilities (regular user vs admin) with permission matrices
  • Personal boards, workflows, and queue management
  • Shared board collaboration
  • Read-only model viewing for non-admins
  • Security best practices and troubleshooting

Administrator Guide (docs/multiuser/admin_guide.md) - 840 lines

  • Initial setup and first admin account creation
  • Configuration with multiuser option (true/false/absent)
  • Single-user and multi-user mode behavior
  • Mode switching and legacy "system" user ownership
  • CLI-based user management (useradd.py, userdel.py, usermod.py, userlist.py)
  • Shared board permission management
  • Security hardening (JWT secret keys, HTTPS, session policies)
  • Backup/recovery scripts (bash, cron examples)
  • System monitoring and configuration reference

API Guide (docs/multiuser/api_guide.md) - 1,142 lines

  • Single-user vs multi-user mode detection
  • JWT authentication flow and token lifecycle (multi-user mode)
  • 55+ production-ready code examples (Python, TypeScript, cURL)
  • Adaptive API client examples for both modes
  • Authentication, user management, and board sharing endpoints
  • Error handling patterns and token refresh strategies
  • Migration path from single-user API usage
  • Security considerations for API consumers

Key Updates (Based on Recent Implementation Changes)

Configuration:

  • multiuser: true - Multi-user mode (authentication required)
  • multiuser: false or absent - Single-user mode (no authentication)

Single-User Mode:

  • No login required - direct access to all InvokeAI functionality
  • All boards and images visible in unified view
  • Backwards compatible with legacy installations

Mode Switching:

  • Switching to single-user: All user boards/images combined into unified view
  • Switching to multi-user: Legacy content owned by internal "system" user
  • Only administrators can access "system"-owned legacy assets
  • Future release will include migration utility for legacy assets

User Management:

  • CLI scripts: useradd.py, userdel.py, usermod.py, userlist.py
  • Web-based user management UI coming in future release
  • Comprehensive usage examples provided for all CLI tools

Example adaptive Python client:

class AdaptiveInvokeAIClient:
    def __init__(self, base_url="http://localhost:9090"):
        self.base_url = base_url
        self.token = None
        self.multiuser_mode = self._check_multiuser_mode()
    
    def _check_multiuser_mode(self):
        """Detect if multi-user mode is enabled."""
        response = requests.get(f"{self.base_url}/api/v1/boards/")
        return response.status_code == 401
    
    def login(self, email, password):
        """Login (only needed in multi-user mode)."""
        if not self.multiuser_mode:
            return
        # ... authentication logic

Documentation Site Integration

  • Added "Multi-User Mode" navigation section to mkdocs.yml
  • Cross-referenced between all guides and existing docs
  • Linked to community resources (Discord, GitHub)

Coverage

All Phase 8 requirements complete with updates for latest implementation:

  • User documentation: single-user mode, multi-user mode, mode switching, CLI tools
  • Admin documentation: configuration, CLI scripts, legacy asset management
  • API documentation: mode detection, adaptive clients, compatibility

Total: 2,997 lines, ~8,500 words, 55+ code examples, 20+ troubleshooting scenarios

Related Issues / Discussions

N/A - Implements documented Phase 8 of multiuser implementation plan

QA Instructions

Documentation validation:

# Verify files created/updated
ls -lh docs/multiuser/{user_guide,admin_guide,api_guide}.md

# Check mkdocs integration
grep -A 5 "Multi-User Mode:" mkdocs.yml

# Verify updates for single-user mode and CLI scripts
grep -n "multiuser" docs/multiuser/*.md
grep -n "single-user" docs/multiuser/*.md
grep -n "useradd\|usermod\|userdel\|userlist" docs/multiuser/*.md

# Line counts
wc -l docs/multiuser/{user_guide,admin_guide,api_guide,phase8_summary}.md

Build documentation site to verify navigation:

mkdocs serve
# Navigate to http://localhost:8080
# Verify "Multi-User Mode" section appears with all three guides

Merge Plan

No special merge considerations. Documentation updates with minimal config change (mkdocs.yml navigation section).

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable) - N/A for documentation
  • ❗Changes to a redux slice have a corresponding migration - N/A
  • Documentation added / updated (if applicable) - Core deliverable
  • Updated What's New copy (if doing a release after this PR)
Original prompt

This section details on the original issue you should resolve

<issue_title>[enhancement]: Implement Phase 8 of the multiuser implementatoin plan</issue_title>
<issue_description>### Is there an existing issue for this?

  • I have searched the existing issues

Contact Details

No response

What should this feature add?

Begin the process of writing the user, API and administrator's guides to the new multiuser feature, as documented in docs/multiuser/.

Alternatives

No response

Additional Content

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 15, 2026 14:39
… API guides)

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Copilot AI changed the title [WIP] Add user and API guides for multiuser feature Phase 8: Multiuser documentation (user, admin, API guides) Jan 15, 2026
Copilot AI requested a review from lstein January 15, 2026 15:06
@lstein
Copy link
Owner

lstein commented Jan 22, 2026

@copilot There have been some significant changes in the multiuser mode since this pull request was first written. Could you examine the commits added to branch lstein-master and update the multiuser documentation? The important changes are as follows:

  1. Single user mode is enabled when the new configuration file option multiuser is set to false or is absent.
  2. In single user mode, the system will not ask for login credentials and all InvokeAI functionality will be enabled.
  3. If boards or images were created while in multiuser mode and the server is then switched to single user mode, then those boards and images will be combined into a single unified view.
  4. Legacy boards and images created under single-user mode will be owned by an internal user named "system." When switching to multiuser mode, only the Administrator will have access to these boards and images. A utility to migrate these legacy assets to another user will be part of a future release.
  5. To add, delete and modify users and their passwords, there are several scripts in scripts named useradd.py, userdel.py, usermod.py and userlist.py. Please see the commit log messages and the contents of the scripts to describe their usage. Also mention that a web-based user interface that allows the Administrator to manage users and for users to change their display names and passwords is coming in a future release.

- Document multiuser config option (true/false/absent)
- Explain single-user mode behavior (no login required)
- Document mode switching and legacy "system" user
- Update user management to reference CLI scripts (useradd, userdel, usermod, userlist)
- Note that web UI for user management is coming in future release
- Add adaptive API client example for both modes

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 22, 2026

@copilot There have been some significant changes in the multiuser mode since this pull request was first written. Could you examine the commits added to branch lstein-master and update the multiuse...

I've updated all three documentation guides to reflect the changes you described:

Key Updates:

  1. Configuration: Documented the multiuser config option (true/false/absent determines mode)

  2. Single-User Mode: Explained that when multiuser: false or absent, no login is required and all functionality is enabled

  3. Mode Switching:

    • Switching to single-user: all boards/images combined into unified view
    • Switching to multi-user: legacy content owned by "system" user
    • Only admins can access "system"-owned assets until migration utility is available
  4. CLI Scripts: Replaced web UI instructions with documentation for useradd.py, userdel.py, usermod.py, and userlist.py scripts, including usage examples

  5. Future Features: Noted that web-based user management UI and user password change interfaces are coming in future releases

  6. API Guide: Added adaptive client examples that detect and work with both single-user and multi-user modes

All changes are in commit 00f3817. The push is currently failing due to GitHub server errors (500), but the changes are committed locally and will push once GitHub recovers.

Copilot AI changed the title Phase 8: Multiuser documentation (user, admin, API guides) Phase 8: Multiuser documentation (user, admin, API guides) with single-user mode support Jan 22, 2026
@lstein lstein marked this pull request as ready for review January 22, 2026 14:25
lstein and others added 12 commits January 22, 2026 09:56
… main models (invoke-ai#8754)

* fix(model_manager): prevent Z-Image LoRAs from being misclassified as main models

Z-Image LoRAs containing keys like `diffusion_model.context_refiner.*` were being
incorrectly classified as main checkpoint models instead of LoRAs. This happened
because the `_has_z_image_keys()` function checked for Z-Image specific keys
(like `context_refiner`) without verifying if the file was actually a LoRA.

Since main models have higher priority than LoRAs in the classification sort order,
the incorrect main model classification would win.

The fix adds detection of LoRA-specific weight suffixes (`.lora_down.weight`,
`.lora_up.weight`, `.lora_A.weight`, `.lora_B.weight`, `.dora_scale`) and returns
False if any are found, ensuring LoRAs are correctly classified.

* refactor(mm): simplify _has_z_image_keys with early return

Return True directly when a Z-Image key is found instead of using an
intermediate variable.
* Add user survey section to README

Added a section for new and returning users to take a survey.

* docs: add user survey link to WhatsNew

* Fix formatting issues in WhatsNew.tsx

---------

Co-authored-by: Alexander Eichhorn <alex@eichhorn.dev>
…ebugging queue visibility) (#30)

* Add user isolation for queue events and field values filtering

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* Add user column to queue list UI

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* Add field values privacy indicator and implementation documentation

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* Allow all users to see queue item status events while keeping invocation events private

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* chore(backend): ruff

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
Updated by "Cleanup translation files" hook in Weblate.


Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/
Translation: InvokeAI/Web UI
* Initial plan

* Add only-labels parameter to limit automated issue closure to bugs only

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
* Initial plan

* Add multiuser queue badge support - show X/Y format in multiuser mode

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* Format openapi.json with Prettier

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* Address code review feedback - optimize DB queries and improve code clarity

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* translationBot(ui): update translation files (invoke-ai#8767)

Updated by "Cleanup translation files" hook in Weblate.


Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/
Translation: InvokeAI/Web UI

* Limit automated issue closure to bug issues only (invoke-ai#8776)

* Initial plan

* Add only-labels parameter to limit automated issue closure to bugs only

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* fix(multiuser): Isolate client state per user to prevent data leakage (#40)

* Implement per-user client state storage to fix multiuser leakage

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* Fix: Make authentication optional for client_state endpoints to support single-user mode

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* Clear params state on logout/login to prevent user data leakage

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

* Initial plan

* chore(backend) ruff & typegen

* Fix real-time badge updates by invalidating SessionQueueStatus on queue events

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: Weblate (bot) <hosted@weblate.org>
Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Auth tests were failing because the login and setup endpoints now return 403 when multiuser mode is disabled (the default). Updated test fixtures to enable multiuser mode for all auth-related tests.

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Copilot AI and others added 7 commits January 22, 2026 21:24
When multiuser mode is disabled, the LoginPage and AdministratorSetup components now redirect to /app instead of showing the login/setup forms. This prevents users from being stuck on the login page after browser refresh in single-user mode.

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Show loading spinner instead of login/setup forms when multiuser mode is disabled or when redirecting is about to happen. This prevents the unattractive flash of the login dialog when refreshing the page in single-user mode.

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Created three user management scripts in the scripts/ directory:
- useradd.py (renamed from add_user.py) - add users with admin privileges
- userdel.py - delete users by email address with confirmation
- usermod.py - modify user details (name, password, admin status)

All scripts support both CLI and interactive modes for flexibility.

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Created scripts/userlist.py to display all users in the database. Supports:
- Table format (default): Shows ID, email, display name, admin status, and active status
- JSON format (--json flag): Outputs user data as JSON for scripting/automation

Example usage:
  python scripts/userlist.py          # Table view
  python scripts/userlist.py --json   # JSON output

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Created AdminUserOrDefault dependency that allows admin operations to work without authentication in single-user mode while requiring admin privileges in multiuser mode. Updated model_manager router to use AdminUserOrDefault for update_model_record, update_model_image, and reidentify_model endpoints. This fixes the "Missing authentication credentials" error when saving model default settings in single-user mode.

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
Reverted model_manager.py to state before commit c47af8f and reapplied AdminUserOrDefault correctly. Changed from `_: AdminUser` to `current_admin: AdminUserOrDefault` using the same pattern as boards.py (`current_user: CurrentUserOrDefault`). This fixes all 422 errors in single-user mode while maintaining proper admin authentication in multiuser mode.

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
@lstein
Copy link
Owner

lstein commented Jan 23, 2026

This branch got messed up by rebasing. Changes were cherry-picked into PR #50

@lstein lstein closed this Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[enhancement]: Implement Phase 8 of the multiuser implementatoin plan

4 participants