Skip to main content
Glama
README.md
# Creator Factory Core

A local-first Python image task engine: SQLite queue, independent worker, deterministic Mock Provider, optional OpenAI Images Provider, local asset manifests, CLI, and STDIO MCP. It has no website, remote server, message broker, MySQL, or dependency on an existing private AI Creator application.

中文简介:这是一个可独立运行的通用图片任务核心。默认只使用 Python、SQLite 和本地文件;Mock Provider 可在完全离线的 CI 中生成确定性的合法 PNG。真实 OpenAI 请求必须显式选择 `openai` Provider,并通过环境变量提供密钥。

## Quick start

```bash
python -m pip install -e ".[mcp]"
creator-factory init
creator-factory submit "a fictional blue cube" --provider mock --count 2
creator-factory-worker --once
creator-factory status JOB_ID
creator-factory assets --job-id JOB_ID
```

Runtime files live under `.creator-factory/` by default and are ignored by Git.

## OpenAI Images Provider

The optional provider uses the official Image API generation endpoint, defaults to `gpt-image-2`, and reads only `OPENAI_API_KEY` from the process environment:

```bash
set OPENAI_API_KEY=...
creator-factory submit "a fictional editorial illustration" --provider openai
creator-factory-worker --once
```

The key is never accepted in CLI/MCP arguments, stored in SQLite, or written to logs. CI never sends a real request. A real-provider job is marked before network execution; if its Worker is interrupted, the job becomes `interrupted_no_retry` and requires inspection/manual resubmission to avoid accidental duplicate billing.

## MCP tools

- `creator_submit_image`
- `creator_job_status`
- `creator_job_cancel`
- `creator_job_retry`
- `creator_assets_list`
- `creator_asset_get`

Submission is asynchronous and returns `creator.job.v1`; asset rows use `creator.asset_manifest.v1`. Run `creator-factory-mcp` as a local STDIO server and keep `creator-factory-worker` as a separate process.

## Safety

Prompts and outputs stay local unless the `openai` provider is selected. Do not submit confidential prompts or third-party personal data without authorization. Generated outputs still require human review for rights, accuracy, and policy compliance.

MIT licensed.