How bogdan-95/content-factory-console works
Content Factory Console is a FastAPI-backed image-generation service: a client submits validated generation parameters, the API queues a job in PostgreSQL, and a background worker claims it, runs an SDXL workflow through ComfyUI, then records status and output filename. Clients poll job status/result and retrieve the generated image through the protected files endpoint. The README also documents health checks, API-key/rate-limit security, horizontal worker scaling, and Docker-hosted ComfyUI with automatic model preparation. Unsampled ComfyUI, deployment, and preflight wiring is represented only where the README supports it.
Main entry points: jobs.py Status and result routes · main.py FastAPI app · generate.py Submit generation · files.py Image file route
Components 19
API and access
- FastAPI app
api/app/main.py - API key and limits
api/app/security.py - Submit generation
api/app/routers/generate.py - Request and response schemas
api/app/schemas.py - Health route
api/app/routers/health.py
Job lifecycle
- Job queries
api/app/services/jobs.py - API database sessions
api/app/db.py - PostgreSQL jobs and results
- Job worker
worker/app/worker.py - Worker database sessions
worker/app/db.py
Image generation
- Worker settings
worker/app/settings.py - SDXL workflow template
worker/app/workflow_templates/base_sdxl_api.json - ComfyUI HTTP client
worker/app/comfy_client.py - ComfyUI renderer
- Model preparation
scripts/preflight.py
Result delivery
- Status and result routes
api/app/routers/jobs.py - Image file route
api/app/routers/files.py - Generated image files
Other components
- API client
Connections 27
- API client → FastAPI app: sends HTTP
README.md - FastAPI app → Submit generation: routes requests
api/app/main.py - FastAPI app → Status and result routes: routes requests
api/app/main.py - FastAPI app → Image file route: routes requests
api/app/main.py - FastAPI app → Health route: routes requests
api/app/main.py - Submit generation → Request and response schemas: validates with
api/app/routers/generate.py - Submit generation → API key and limits: checks key
api/app/routers/generate.py - Submit generation → Job queries: creates job
api/app/routers/generate.py - Submit generation → API database sessions: gets session
api/app/routers/generate.py - Job queries → PostgreSQL jobs and results: writes and reads
api/app/services/jobs.py - Job worker → Worker database sessions: claims and updates
worker/app/worker.py - Worker database sessions → PostgreSQL jobs and results: reads and writes
- Job worker → SDXL workflow template: loads template
worker/app/worker.py - Job worker → ComfyUI HTTP client: submits and polls
worker/app/worker.py - ComfyUI HTTP client → ComfyUI renderer: sends workflow
README.md - ComfyUI renderer → ComfyUI HTTP client: returns history
README.md - Job worker → Worker settings: uses settings
worker/app/worker.py - Status and result routes → API key and limits: checks key
api/app/routers/jobs.py - Status and result routes → Job queries: reads job result
api/app/routers/jobs.py - Status and result routes → API database sessions: gets session
api/app/routers/jobs.py - Status and result routes → Image file route: returns file URL
api/app/routers/jobs.py - Image file route → API key and limits: checks key
api/app/routers/files.py - Image file route → Generated image files: serves image
api/app/routers/files.py - API client → Status and result routes: polls status
README.md - API client → Image file route: downloads image
README.md - ComfyUI renderer → Generated image files: saves image
- Model preparation → ComfyUI renderer: prepares models
README.md