ComfyUI Extension: ComfyUI-Ugromana
The next-generation security, governance, permissions, and multiβuser control system for ComfyUI.
Custom Nodes (0)
README
ComfyUI Usgromana
<p align="center"> <img src="./web/assets/dark_logo_transparent.png" width="220" /> </p> <p align="center"> <strong>The next-generation security, governance, permissions, and multiβuser control system for ComfyUI.</strong> </p>Table of Contents
- Overview
- Key Features
- Architecture
- Installation
- Folder Structure
- RBAC Roles
- UI Enforcement Layer
- Workflow Protection
- IP Rules System
- User Environment Tools
- Settings Panel
- Backend Components
- Troubleshooting
- License
Overview
ComfyUI Usgromana is a comprehensive security layer that adds:
- RoleβBased Access Control (RBAC)
- UI element gating
- Workflow save/delete blocking
- Transparent user folder isolation
- IP whitelist and blacklist enforcement
- User environment management utilities
- A modern administrative panel with multiple tabs
- Dynamic theme integration with the ComfyUI dark mode
- Live UI popups, toast notifications, and visual enforcement
It replaces the older Sentinel system with a faster, cleaner, more modular architectureβfully rewritten for reliability and future expansion.
Key Features
π RBAC Security
Four roles: Admin, Power, User, Guest
Each with configurable permissions stored in usgromana_groups.json.
π« Save & Delete Workflow Blocking
Nonβprivileged roles cannot:
- Save workflows
- Export workflows
- Overwrite existing workflows
- Delete workflow files
All blocked actions trigger:
- A serverβside 403
- A UI toast popup explaining the denial
ποΈ Dynamic UI Enforcement
Usgromana hides or disables:
- Topβmenu items
- Sidebar tabs
- Settings categories
- Extension panels
- File menu operations
Enforcement occurs every 1 second to catch lateβloading UI elements.
π IP Filtering System
Complete backend implementation:
- Whitelist mode
- Blacklist mode
- Live editing in Usgromana settings tab
- Persistent storage via
ip_filter.py
ποΈ User Environment Tools
From user_env.py:
- Purge a userβs folders
- List user-owned files
- Promote user workflow to default (all user view)
- Delete single user workflow
- Toggle galleryβfolder mode
π₯οΈ Transparent Themed Admin UI
The administrative modal features:
- Transparent blurred glass background
- Neon accent tabs
- Integrated logo watermark
- Scrollable permission tables
- Responsive layout
π§ Watcher Middleware
A new middleware that detects:
- Forbidden workflow saves
- Forbidden deletes
And triggers UI-side toast popups through a custom fetch wrapper.
Architecture
ComfyUI
β
βββ Usgromana Core
β βββ access_control.py β RBAC, path blocking, folder isolation
β βββ usgromana.py β Route setup, JWT, auth flows, settings API
β βββ watcher.py β Intercepts 403 codes and triggers popups
β βββ utils/
β β βββ ip_filter.py β Whitelist/blacklist system
β β βββ user_env.py β User folder management
β β βββ sanitizer.py β Input scrubbing
β β βββ logger.py β Logging hooks
β β βββ timeout.py β Rate limiting
β βββ web/
β βββ js/usgromana_settings.js β UI enforcement + settings panel
β βββ css/usgromana.css β Themed UI
β βββ assets/dark_logo_transparent.png
β
βββ ComfyUI (upstream)
Installation
- Extract Usgromana into:
ComfyUI/custom_nodes/Usgromana/
-
Restart ComfyUI.
-
On first launch, register the initial admin.
-
Open settings β Usgromana to configure.
Folder Structure
Usgromana/
β
βββ access_control.py
βββ usgromana.py
β
βββ utils/
β βββ ip_filter.py
β βββ user_env.py
β βββ watcher.py
β βββ sanitizer.py
β
βββ web/
β βββ js/usgromana_settings.js
β βββ css/usgromana.css
β βββ assets/dark_logo_transparent.png
β
βββ users/
βββ users.json
βββ usgromana_groups.json
RBAC Roles
| Role | Description | |------|-------------| | Admin | Full access to all ComfyUI and Usgromana features. | | Power | Elevated user with additional permissions but no admin panel access. | | User | Standard user who can run workflows but cannot modify system behavior. | | Guest | Fully restricted by defaultβcannot run, upload, save, or manage. |
Permissions are stored in:
users/usgromana_groups.json
and editable through the settings panel.
UI Enforcement Layer
Usgromana dynamically modifies the UI by:
- Injecting CSS rules to hide elements
- Removing menu entries (Save, Load, Manage Extensions)
- Blocking iTools, Crystools, rgthree, ImpactPack for restricted roles
- Guarding PrimeVue dialogs (Save workflow warnings)
- Intercepting hotkeys (Ctrl+S, Ctrl+O)
All logic is contained in:
web/js/usgromana_settings.js
Workflow Protection
If a user lacking permission tries to save:
- Backend blocks the operation (
can_modify_workflows) - watcher.py detects the 403 with code
"WORKFLOW_SAVE_DENIED" - UI shows a centered toast popup:
βYou do not have permission to save workflows.β
Same for delete operations.
IP Rules System
Located in:
utils/ip_filter.py
Features
- Whitelist mode: Only listed IPs allowed
- Blacklist mode: Block specific IPs
- Configurable through new βIP Rulesβ tab in settings
- Changes applied instantly to middleware
User Environment Tools
From:
utils/user_env.py
Features:
- Purge a userβs input/output/temp folders
- List all user-bound files
- Toggle whether their folder functions as a gallery
Exposed through the βUser Envβ tab in the Usgromana settings modal.
Settings Panel
Access via: Settings β Usgromana
Tabs:
- Users & Roles
- Permissions & UI
- IP Rules
- User Environment
Additional UI Features
- Integrated logout button in the settings entry
- Transparent blurred panel
- Neon-accented tab bar
- Logo watermark in top-right
Backend Components
access_control.py
- Folder isolation
- RBAC
- Middleware for blocking paths
- Workflow protection
- Extension gating
usgromana.py
- All routes
/usgromana/api/* - JWT auth handling
- Registration & login flows
- Guest login
watcher.py
- Intercepts 403s
- Sends structured JS events
ip_filter.py
- Whitelist & blacklist logic
- Persistent storage
user_env.py
- Folder operations
- Metadata tools
Troubleshooting
Missing Logo
Ensure the file exists:
Usgromana/web/assets/dark_logo_transparent.png
UI Not Updating
Clear browser cache or disable caching dev tools.
Guest cannot run workflows
Check:
can_run = true
in usgromana_groups.json.
License
MIT License
You may modify and redistribute freely.
Changelog β ComfyUI Usgromana
All notable changes to ComfyUI Usgromana are documented here.
This project follows a semantic-style versioning flow adapted for active development.
**v1.7.0 - Updated extension logic & added sfw toggle
π οΈ Admin User group Extension list
- Resolved an issue which caused duplicate extensions to be listed
- List now accounts for explicitly listed extensions
π οΈ Per user SFW reactor intercept (Highly experimental)
- Admin can now toggle SFW on/off per user
utils/reactor_sfw_intercept.py(added new file)
**v1.6.0 - Refactor & update User Workflow Administration
π User Files Additions
- Monolith Addition: Added options to select and delete individual files & Promote Workflows
routes/user.py(Updated information passage)web/usgromana_settings.js(updated the middleware and UI architecture)
v1.5.0 β Modular Refactor & Architecture Overhaul (2025-12-6)
ποΈ Architectural Refactor
- Monolith Split: Deconstructed the massive
usgromana.pyinto modular route handlers:routes/auth.py(Login/Register/Token)routes/admin.py(User & Group management)routes/user.py(User environment & status)routes/static.py(Asset serving)
- Circular Dependency Resolution: Introduced
globals.pyto handle shared server instances andconstants.pyto centralize configuration paths. - Logic Decoupling: Moved business logic out of HTTP handlers into dedicated utilities (
utils/admin_logic.py,utils/json_utils.py,utils/bootstrap.py).
π οΈ Stability & Fixes
- Startup Resilience: Added auto-creation logic for missing static folders (
web/css,web/js,web/html) to preventaiohttpcrash on first run. - Windows Pathing: Fixed
FileNotFoundErrorand path resolution issues on Windows environments. - Middleware Fixes: Restored missing
create_folder_access_control_middlewareand fixed import errors inwatcher.py. - Config Correction: Resolved missing
MAX_TOKEN_EXPIRE_MINUTESconstant that prevented server startup.
π Frontend Reorganization
- Restructured
web/directory for cleaner separation of concerns. - Consolidated ComfyUI extension scripts (
usgromana_settings.js,logout.js,injectCSS.js) to ensure reliable auto-loading. - Moved HTML templates to
web/html/and updated static route mappings. - Removed legacy
admin.jsto prevent conflicts with the integrated Settings UI.
v1.4.0 β Major Security & UI Expansion
π₯ New Features
- Added multi-tab Usgromana Settings Panel
- Users & Roles
- Permissions & UI
- IP Rules
- User Environment
- Introduced logout button inside Usgromana settings.
- Implemented transparent glass UI theme with background blur.
- Added Usgromana logo watermark support in upper-right corner.
π Security Enhancements
- Full save/delete workflow blocking for restricted roles.
- New
watcher.pymiddleware to detect backend 403s and send structured UI warnings. - Unified blocking under
WORKFLOW_SAVE_DENIEDandWORKFLOW_DELETE_DENIEDcodes. - Strengthened RBAC defaults for guest accounts.
- Added extension UI gating via CSS + runtime menu removal.
π§ Backend Improvements
- New IP filtering system (
ip_filter.py) with whitelist + blacklist modes. - New User Environment tools (
user_env.py) including:- Folder purge
- File listing
- Gallery-mode toggles
- Added
create_usgromana_middleware()unified security layer. - Path blocking now includes extension routes, workflow endpoints, manager access, and asset paths.
v1.3.0 β UI Enforcement Engine Overhaul
β¨ Enhancements
- Added dynamic scanning of:
- PrimeVue menus
- Sidebar buttons
- Settings categories
- Enforcement now applies every second to catch late UI loads.
- Added hotkey interception (Ctrl+S / Ctrl+O) for restricted roles.
- Rebuilt
patchSaveConfirmDialogto override PrimeVue dialogs.
π Stability Updates
- Resolved issues where guests could open extension settings.
- Added safe defaults for undefined permissions per role.
v1.2.0 β Folder Isolation & User Paths
π§ New Features
- Added per-user:
- input directory
- output directory
- temp directory
- Automatic directory creation with fallback to βpublicβ user.
- Added
filename_prefixrewriting for isolated naming.
π Fixes
- Corrected queue ownership tracking.
- Fixed history objects containing mixed-user entries.
v1.1.0 β JWT Authentication Integration
π Additions
- Added JWT login, registration, expiration, and cookie storage.
- Implemented guest login with auto-created βguestβ user.
- Created protections to ensure guest cannot escalate privileges.
β Backend
- Refactored user database operations.
- Added detection for first-time admin setup.
v1.0.0 β Initial Release
- Base RBAC system
- Permission flags stored in
usgromana_groups.json - Middleware for execution, upload, manager access
- Basic UI blocking
- Initial Usgromana settings entry (pre-tabs)
Upcoming Features (Planned for v1.5+)
- Live audit logging panel
- Real-time session viewer
- Admin ability to force logout users
- Per-user storage quotas
- Automated workflow sandboxing
- Theme customization panel