JAP is a self-hosted AI image generation studio for exploring ideas on a visual canvas. Generate with multiple providers, branch from prompts and images, compare batches, annotate references, save reusable templates, and keep the provenance of each result visible.
- Image-first node canvas with prompt, reference, and generation relationships
- OpenAI, fal.ai, Replicate, OpenRouter, Krea, custom OpenAI-compatible providers, and the official Codex CLI
- Multi-model and multi-image generation batches
- Reference images, annotations, prompt enhancement, variations, and upscaling
- Persistent canvases, templates, prompts, and generation history backed by SQLite
- Local filesystem storage by default, with optional S3-compatible object storage
- Local/self-hosted operation with no JAP account or hosted collaboration service
- React 18, TypeScript, Vite, Tailwind CSS
- Zustand and
@xyflow/react - Bun HTTP runtime and SQLite
- Vercel AI SDK, fal.ai, Replicate, OpenRouter, Krea, and custom provider adapters
- Bun 1.3 or newer
- At least one supported provider credential, or the official Codex CLI signed in with ChatGPT
git clone https://github.com/markos-ttl/JAP.git
cd JAP
bun install
cp .env.example .envAdd only the credentials you intend to use to .env. Environment files are ignored by Git.
Start the frontend and API server in separate terminals:
bun run devbun run dev:serverOpen http://localhost:4000. The API listens on http://localhost:4001 by default.
The full, safe configuration template is .env.example.
| Variable | Purpose |
|---|---|
OPENAI_API_KEY |
OpenAI image generation |
FAL_KEY |
fal.ai models (Untested) |
REPLICATE_API_TOKEN |
Replicate models (Untested) |
OPENROUTER_KEY |
OpenRouter image-capable models |
KREA_API_KEY |
Krea generation and enhancement (Untested) |
APP_ENV |
development enables sanitized provider diagnostics; default is production |
PORT |
API server port; default is 4001 |
ASSET_STORAGE |
local (default) or s3 |
JAP can invoke the installed official Codex CLI and use its ImageGen tool without reading Codex OAuth files or handling tokens itself.
codex login
codex login statusThe status command must report that Codex is logged in using ChatGPT. If the executable is not discoverable on PATH, set CODEX_CLI_PATH in .env.
Set ASSET_STORAGE=s3 and configure S3_BUCKET, S3_REGION, and any endpoint or credentials required by your provider. AWS IAM roles and the standard credential chain work without static keys. Compatible services can use S3_ENDPOINT, S3_FORCE_PATH_STYLE, and S3_PREFIX.
The configured identity needs permission to list the bucket and read, write, and delete objects. JAP reads S3 first and falls back to existing local assets when an installation is migrated from local storage.
Run the complete verification suite before opening a pull request:
bun run checkIndividual commands are also available:
bun test
bun run build
bun run doctorThe backend entry point is server/index.ts. The main application code lives in src/, and the canvas feature is under src/features/ai-canvas/.
Never commit .env files, provider credentials, databases, or generated assets. Please report vulnerabilities privately as described in SECURITY.md.
Contributions are welcome. See CONTRIBUTING.md for setup, testing, and pull-request expectations.
JAP is available under the MIT License.
