Appearance
ComfyUI — Wellysa Custom Deployment
Custom ComfyUI fork with REST API server, database persistence, nginx reverse proxy, and Railway deployment support for production-grade AI inference workflows.
Tech Stack
- Python 3.13 — Core runtime
- ComfyUI — Visual node-based diffusion model engine
- nginx — Reverse proxy with optional basic auth (htpasswd)
- SQLAlchemy + Alembic — Database ORM and migrations
- PyTorch — Deep learning framework (GPU/CPU support)
- Docker — Containerized deployment
- Railway — Cloud deployment platform (see
RAILWAY_SETUP.md)
Features
Core ComfyUI Capabilities
- Node-based visual interface for Stable Diffusion workflows
- Support for multiple model architectures (SD1.x, SDXL, Flux, SD3, etc.)
- Video generation with Stable Video Diffusion (models pre-downloaded at build time)
- LoRA, ControlNet, inpainting, upscaling, area composition
- Asynchronous queue system with smart memory management
Wellysa Custom Extensions
- REST API Server (
api_server/) — Programmatic access to ComfyUI workflows - Database Persistence (
alembic_db/) — Store workflow metadata, job history, user data - nginx Integration — Reverse proxy with optional authentication
- Railway Deployment — One-click cloud deployment with environment config
- Pre-downloaded Models — Essential video models (SVD) included in Docker image
Quick Start
Docker (Recommended)
Build the image:
bashdocker build -t wellysa-comfyui .Run the container:
bashdocker run -p 8000:8000 -v $(pwd)/models:/app/models wellysa-comfyuiAccess the UI:
- Web interface:
http://localhost:8000 - API server:
http://localhost:8000/api(unverified — checkapi_server/routes/)
- Web interface:
Local Development
Clone and install dependencies:
bashgit clone <repository-url> cd comfy_UI pip install -r requirements.txtDownload models:
bashchmod +x scripts/download_essential_models.sh scripts/download_video_models.sh ./scripts/download_essential_models.sh ./scripts/download_video_models.shRun database migrations:
bashalembic upgrade headStart the application:
bash./start.sh(Note:
start.shstarts both nginx and ComfyUI — see script for details)
Railway Deployment
See RAILWAY_SETUP.md for detailed instructions on deploying to Railway's cloud platform.
Architecture
comfy_UI/
├── api_server/ # REST API layer
│ ├── routes/ # API endpoints (internal + public)
│ ├── services/ # Business logic
│ └── utils/ # Helpers and utilities
├── alembic_db/ # Database migrations (Alembic)
│ └── versions/ # Migration scripts
├── app/ # Main application
│ ├── assets/ # Static files (API schemas, DB queries)
│ └── database/ # Database models and connections
├── comfy/ # ComfyUI core inference engine
├── blueprints/ # Flask/FastAPI blueprints (unverified)
├── models/ # Model weights storage
│ ├── checkpoints/ # Stable Diffusion checkpoints
│ ├── vae/ # VAE models
│ ├── loras/ # LoRA weights
│ └── ... # ControlNet, upscalers, etc.
├── nginx.conf # Reverse proxy configuration
├── start.sh # Startup script (nginx + ComfyUI)
└── Dockerfile # Production container definitionAPI Endpoints
(Unverified — confirm with team by reviewing api_server/routes/)
The REST API provides programmatic access to ComfyUI workflows. Common endpoints likely include:
POST /api/queue— Submit a workflow for processingGET /api/history— Retrieve job historyGET /api/system_stats— System resource usage- Internal routes under
/api/internal/— Admin/monitoring endpoints
Run the server and inspect api_server/routes/ for the complete API specification.
Configuration
Environment Variables
PORT— HTTP server port (default: set by Railway orstart.sh)PYTHONUNBUFFERED=1— Immediate stdout/stderr flushing (set in Dockerfile)- (Additional vars TBD — check
start.shor.envfiles)
Model Paths
Place model files in the following directories:
- Checkpoints:
models/checkpoints/(e.g., SD1.5, SDXL, Flux) - VAE:
models/vae/ - LoRA:
models/loras/ - ControlNet:
models/controlnet/ - Upscalers:
models/upscale_models/
See extra_model_paths.yaml.example to configure additional model search paths.
nginx & Authentication
Edit nginx.conf to configure:
- Port bindings and proxy settings
- Basic auth (uses
htpasswd— generate with:htpasswd -c .htpasswd <username>) - SSL/TLS certificates (if deploying with HTTPS)
Database
This fork includes Alembic-managed database schema for:
- Workflow metadata persistence
- Job queue history
- User/API authentication (unverified)
Run migrations:
bash
alembic upgrade head # Apply all pending migrations
alembic downgrade -1 # Rollback last migrationDatabase connection: (Unverified — check app/database/ for connection strings)
Keyboard Shortcuts
| Keybind | Action |
|---|---|
Ctrl + Enter | Queue workflow |
Ctrl + Shift + Enter | Queue as first |
Ctrl + Alt + Enter | Cancel generation |
Ctrl + S | Save workflow |
Ctrl + O | Load workflow |
Ctrl + A | Select all nodes |
Space (hold) | Pan canvas |
Ctrl + Z / Ctrl + Y | Undo/Redo |
Delete | Delete selected nodes |
Full list available in upstream ComfyUI docs.
Development
Running Tests
(Unverified — confirm test setup)
bash
pytest # Run all tests
pytest api_server/tests/ # API tests onlyCode Quality
- Linting:
ruff check .(see.github/workflows/ruff.yml) - Type checking: (TBD — check if mypy configured)
GPU Support
NVIDIA (Recommended)
bash
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130AMD (Linux)
bash
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm7.1CPU-only
Run with --cpu flag (slow, not recommended for production).
See upstream ComfyUI GPU docs for detailed instructions on AMD/Intel/Apple Silicon setups.
Known Issues & Limitations
- Railway PORT binding: Ensure
start.shrespects the$PORTenvironment variable set by Railway - Model size: Docker image includes pre-downloaded SVD models (~several GB) — increase storage if deploying to constrained environments
- Database schema: Schema is evolving — always run
alembic upgrade headafter pulling updates
Support & Contributing
- Issues: Report bugs via GitHub Issues
- Upstream ComfyUI: comfyanonymous/ComfyUI
- Wellysa Team: (Confirm internal contact/Slack channel if applicable)
License
Inherits license from upstream ComfyUI (check LICENSE file). Custom Wellysa extensions (unverified — confirm licensing for api_server/ and database code).
Built by Wellysa | Powered by ComfyUI