Skip to content

replicate/kontext-chat

Repository files navigation

Kontext Chat

A chat app that generates images using Replicate and Cloudflare Workers.

Kontext Chat is powered by FLUX.1 Kontext Pro, a new image model from Black Forest Labs, running on Replicate. The app is built with Hono and React and it deployed on Cloudflare Workers.

See kontext-chat.replicate.dev for a live demo.

Local Development

  1. Install dependencies:

    npm install
  2. Get a Replicate API Token:

  3. Set up your local environment:

    • Create a .dev.vars file in the project root (already present in this repo) and add your token:
      REPLICATE_API_TOKEN=your-token-here
      
  4. Start the local dev server:

    npm run dev

Deployment to Cloudflare

  1. Authenticate Wrangler:

    npx wrangler login
  2. Set your Replicate API token as a secret:

    npx wrangler secret put REPLICATE_API_TOKEN
  3. Deploy:

    npm run deploy
    • Your app will be deployed to your Cloudflare Workers account.

Notes

  • The frontend is served from the public/ directory.
  • The backend is a Cloudflare Worker (entry: src/index.ts).
  • The app requires a valid REPLICATE_API_TOKEN to function.

About

Chat with your images using Black Forest Lab's FLUX.1 Kontext

Resources

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •