Skip to content

Repository files navigation

JAP — Just Another Picture

JAP canvas screenshot

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.

Features

  • 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

Stack

  • 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

Quick start

Prerequisites

  • Bun 1.3 or newer
  • At least one supported provider credential, or the official Codex CLI signed in with ChatGPT

Install

git clone https://github.com/markos-ttl/JAP.git
cd JAP
bun install
cp .env.example .env

Add 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 dev
bun run dev:server

Open http://localhost:4000. The API listens on http://localhost:4001 by default.

Configuration

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

Codex CLI with a ChatGPT subscription

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 status

The 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.

S3-compatible storage

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.

Development

Run the complete verification suite before opening a pull request:

bun run check

Individual commands are also available:

bun test
bun run build
bun run doctor

The backend entry point is server/index.ts. The main application code lives in src/, and the canvas feature is under src/features/ai-canvas/.

Security

Never commit .env files, provider credentials, databases, or generated assets. Please report vulnerabilities privately as described in SECURITY.md.

Contributing

Contributions are welcome. See CONTRIBUTING.md for setup, testing, and pull-request expectations.

License

JAP is available under the MIT License.

About

Just Another Picture — a self-hosted AI image generation canvas.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages