2026-01-10 04:52:11 -08:00
|
|
|
# Imajin (Imagen Djinni)
|
|
|
|
|
|
|
|
|
|
AI-powered image generation platform with multi-service architecture.
|
|
|
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
|
|
|
|
```
|
2026-01-16 17:01:10 -08:00
|
|
|
@imajin/
|
2026-01-10 04:52:11 -08:00
|
|
|
├── services/ # ML Services (GPU-accelerated)
|
2026-03-02 20:58:44 -08:00
|
|
|
│ ├── imajin-diffusion/ # SDXL/Diffusers image generation (Port 8002)
|
|
|
|
|
│ ├── imajin-prompt/ # LLM prompt generation + classification (Port 8003)
|
|
|
|
|
│ ├── imajin-processing/ # CPU post-processing (Port 8004)
|
|
|
|
|
│ ├── imajin-semantic/ # SigLIP2 semantic validation (Port 8005)
|
|
|
|
|
│ ├── imajin-aesthetic/ # ImageReward aesthetic scoring (Port 8006)
|
|
|
|
|
│ ├── imajin-moderator/ # Multi-layer content moderation (Port 8008)
|
|
|
|
|
│ ├── imajin-identity/ # Face detection & identity (Port 8009)
|
|
|
|
|
│ ├── imajin-request-classifier/ # Cultural context classification
|
|
|
|
|
│ └── imajin-prompt-generator/ # Lightweight prompt generation
|
2026-01-10 04:52:11 -08:00
|
|
|
│
|
|
|
|
|
├── orchestrators/ # Composition Layer (no GPU)
|
2026-03-02 20:58:44 -08:00
|
|
|
│ ├── imajin-pipeline/ # 16-stage self-contained pipeline (Port 8080)
|
|
|
|
|
│ └── imajin-app/ # Service proxy orchestrator (HTTP API, batch)
|
2026-01-10 04:52:11 -08:00
|
|
|
│
|
|
|
|
|
├── packages/ # Published Libraries (@lilith/imajin-*)
|
2026-03-02 20:58:44 -08:00
|
|
|
│ ├── imajin-app/ # Core configs, pipelines, prompts
|
2026-01-10 04:52:11 -08:00
|
|
|
│ ├── imajin-react/ # React components
|
|
|
|
|
│ ├── imajin-electron/ # Desktop integration
|
2026-03-02 20:58:44 -08:00
|
|
|
│ ├── imajin-client/ # Unified HTTP client
|
|
|
|
|
│ ├── imajin-config/ # Shared configuration
|
|
|
|
|
│ └── imajin-moderator-client/ # Moderator client
|
2026-01-10 04:52:11 -08:00
|
|
|
│
|
|
|
|
|
├── tests/ # Integration tests
|
|
|
|
|
├── scripts/ # Build & dev scripts
|
|
|
|
|
├── tooling/ # Claude config
|
|
|
|
|
└── docs/ # Documentation
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## ML Construction Kit Pattern
|
|
|
|
|
|
|
|
|
|
Services own ONE model type. Orchestrators compose services via HTTP.
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────┐
|
|
|
|
|
│ @packages/@ml/ ← Building blocks (libraries) │
|
|
|
|
|
│ ├── model-boss/ ← GPU coordination │
|
|
|
|
|
│ └── pipeline-framework/ ← Stage orchestration │
|
|
|
|
|
│ │
|
|
|
|
|
│ @applications/@ml/imajin/ ← This application │
|
|
|
|
|
│ ├── services/ ← ML services with model-boss │
|
|
|
|
|
│ └── orchestrators/ ← HTTP orchestration, no GPU │
|
|
|
|
|
└──────────────────────────────────────────────────────────────────┘
|
|
|
|
|
```
|
|
|
|
|
|
2026-03-02 20:58:44 -08:00
|
|
|
## Pipeline Layers
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
Consumer Request
|
|
|
|
|
│
|
|
|
|
|
▼
|
|
|
|
|
┌─────────────────────────┐
|
|
|
|
|
│ Orchestration Layer │ imajin-pipeline (16-stage) or imajin-app (proxy)
|
|
|
|
|
└─────────┬───────────────┘
|
|
|
|
|
│
|
|
|
|
|
┌─────┴────────────────────────────────────┐
|
|
|
|
|
│ │
|
|
|
|
|
▼ ▼
|
|
|
|
|
┌─────────────────┐ ┌────────────────┐ ┌─────────────────┐
|
|
|
|
|
│ Classification │ │ Generation │ │ Post-Process │
|
|
|
|
|
│ imajin-prompt │ │ imajin- │ │ imajin- │
|
|
|
|
|
│ request-class. │ │ diffusion │ │ processing │
|
|
|
|
|
└─────────────────┘ └────────────────┘ └─────────────────┘
|
|
|
|
|
│ │
|
|
|
|
|
▼ ▼
|
|
|
|
|
┌─────────────────────────────────────────────────────────────┐
|
|
|
|
|
│ Validation & Safety Layer │
|
|
|
|
|
│ imajin-moderator → imajin-semantic → imajin-aesthetic │
|
|
|
|
|
└─────────────────────────────────────────────────────────────┘
|
|
|
|
|
```
|
|
|
|
|
|
2026-01-10 04:52:11 -08:00
|
|
|
## Quick Start
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Install dependencies
|
|
|
|
|
npm install
|
|
|
|
|
|
|
|
|
|
# Build all packages
|
|
|
|
|
npm run build
|
|
|
|
|
|
|
|
|
|
# Start services (requires GPU for diffusion/prompt services)
|
|
|
|
|
cd services/imajin-diffusion/service && uvicorn src.api.main:app --port 8002
|
|
|
|
|
cd services/imajin-prompt/service && uvicorn src.api.main:app --port 8003
|
|
|
|
|
cd services/imajin-processing && npm run dev
|
|
|
|
|
cd orchestrators/imajin-pipeline && uvicorn src.image_pipeline.api.main:app --port 8080
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Package Names
|
|
|
|
|
|
|
|
|
|
| Package | Description |
|
|
|
|
|
|---------|-------------|
|
|
|
|
|
| `@lilith/imajin-app` | Core configs, pipelines, prompts |
|
|
|
|
|
| `@lilith/imajin-react` | React UI components |
|
|
|
|
|
| `@lilith/imajin-electron` | Desktop integration |
|
|
|
|
|
| `@lilith/imajin-client` | Unified HTTP client |
|
2026-03-02 20:58:44 -08:00
|
|
|
| `@lilith/imajin-config` | Shared configuration |
|
|
|
|
|
| `@lilith/imajin-moderator-client` | Moderator service client |
|
2026-01-10 04:52:11 -08:00
|
|
|
| `@lilith/imajin-prompt-types` | Prompt service types |
|
|
|
|
|
| `@lilith/imajin-prompt-client` | Prompt service client |
|
|
|
|
|
| `@lilith/imajin-diffusion-types` | Diffusion service types |
|
|
|
|
|
| `@lilith/imajin-diffusion-client` | Diffusion service client |
|
|
|
|
|
| `@lilith/imajin-processing-types` | Processing service types |
|
|
|
|
|
| `@lilith/imajin-processing-client` | Processing service client |
|
2026-03-02 20:58:44 -08:00
|
|
|
| `@lilith/imajin-semantic-types` | Semantic service types |
|
|
|
|
|
| `@lilith/imajin-semantic-client` | Semantic service client |
|
|
|
|
|
| `@lilith/imajin-aesthetic-types` | Aesthetic service types |
|
|
|
|
|
| `@lilith/imajin-aesthetic-client` | Aesthetic service client |
|
2026-01-10 04:52:11 -08:00
|
|
|
|
|
|
|
|
## Python Packages
|
|
|
|
|
|
|
|
|
|
| Package | Description |
|
|
|
|
|
|---------|-------------|
|
|
|
|
|
| `imajin-prompt-service` | LLM prompt generation (FastAPI) |
|
|
|
|
|
| `imajin-diffusion-service` | SDXL image generation (FastAPI) |
|
2026-03-02 20:58:44 -08:00
|
|
|
| `imajin-moderator` | Multi-layer content moderation (FastAPI) |
|
|
|
|
|
| `imajin-semantic` | SigLIP2 semantic validation (FastAPI) |
|
|
|
|
|
| `imajin-aesthetic` | ImageReward aesthetic scoring (FastAPI) |
|
|
|
|
|
| `imajin-pipeline` | 16-stage orchestrator (FastAPI) |
|
2026-01-10 04:52:11 -08:00
|
|
|
|
|
|
|
|
## Port Assignments
|
|
|
|
|
|
2026-03-02 20:58:44 -08:00
|
|
|
| Service | Port | Type |
|
|
|
|
|
|---------|------|------|
|
|
|
|
|
| imajin-diffusion | 8002 | Generation |
|
|
|
|
|
| imajin-prompt | 8003 | Classification + Generation |
|
|
|
|
|
| imajin-processing | 8004 | Post-processing |
|
|
|
|
|
| imajin-semantic | 8005 | Validation |
|
|
|
|
|
| imajin-aesthetic | 8006 | Validation |
|
|
|
|
|
| imajin-moderator | 8008 | Safety |
|
|
|
|
|
| imajin-identity | 8009 | Identity |
|
|
|
|
|
| imajin-pipeline | 8080 | Orchestrator |
|
2026-01-10 04:52:11 -08:00
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
|
|
MIT
|