MayaGen is a scalable, full-stack platform designed for generating high-quality synthetic image datasets for Machine Learning and Computer Vision applications. Built on top of Stable Diffusion (via ComfyUI), it automates the prompt engineering and bulk generation process, enabling researchers to create diverse, labeled datasets with ease.
- 🏭 Bulk Generation Pipeline: Orchestrate large-scale image generation jobs (1000+ images) with customizable batch sizes and concurrency control.
- 🎨 Dynamic Prompt Engineering: Template-based prompt construction system that automatically injects variations (lighting, camera angles, styles, colors) to ensure dataset diversity.
- 📂 Structured Asset Management:
- Global Gallery: Public showcase of community-generated assets.
- My Collections: Private, secure workspace for managing user-specific datasets.
- Smart Filtering: Organize by category, model type, and processing status.
- ⚡ Modern Event-Driven Architecture: Non-blocking asynchronous job queue (Producer/Consumer model) ensuring reliable generation even under heavy loads.
- 🔌 Model Agnostic: Supports standard checkpoints (SD1.5, SDXL) and specialized models (LCM, Flux) via extensible provider interface.
- 🔐 Enterprise Security: Role-Based Access Control (RBAC), JWT Authentication, and secure asset isolation.
graph TD
User[User / Data Scientist] -->|UI Operations| FE[Next.js Frontend]
FE -->|REST API| API[FastAPI Backend]
subgraph "Backend Services"
API -->|CRUD| DB[(PostgreSQL)]
API -->|Queue Job| Worker[Async Worker]
Worker -->|Websocket/API| Comfy[ComfyUI Node]
end
Comfy -->|Save Image| Storage[Local/Cloud Storage]
Worker -->|Update Status| DB
- Python 3.10+ (with
uvpackage manager recommended) - Node.js 18+ & npm
- Docker & Docker Compose (optional, for full stack)
- ComfyUI instance (running locally or remotely)
cd mayagen-be
# Create virtual environment & install dependencies
uv venv
source .venv/bin/activate
uv pip install -r pyproject.toml
# Configuration
cp .env.example .env.development
# Edit .env.development with your ComfyUI URL and DB credentials
# Run Server (Development)
uv run run_server.pycd mayagen-fe
# Install dependencies
npm install
# Run Development Server
npm run devThe application will be available at http://localhost:3000.
- Navigate to Bulk Generate in the sidebar.
- Define your Base Prompt (e.g., "A futuristic cyberpunk city").
- Select Variations:
- Lighting: Neon, Daylight, Foggy
- Style: Realistic, Anime, Oil Painting
- Set Batch Size (e.g., 50 images).
- Click Queue Batch. The system will generate unique permutations of your prompt and begin processing.
Generated images are stored in mayagen-be/synthetic_dataset/{Category}/. Metadata is available via the GET /api/images endpoint for easy integration with training pipelines.
Contributions are welcome! Please verify that your changes pass the linting checks and include tests for any new API endpoints.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/amazing-feature). - Commit your changes (
git commit -m 'Add amazing feature'). - Push to the branch (
git push origin feature/amazing-feature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.