Create and edit images using your voice.
This is a realtime demo of voice-powered function calling using Cloudflare Workers, Replicate, and the OpenAI Realtime API.
It generates images using Flux Schnell and edits them using Flux Kontext Pro.
Created from this guide and template: https://replicate.com/docs/guides/openai-realtime
Here's what you'll need to build this project:
- An OpenAI account. No special plan is required to use the Realtime API Beta.
- A Replicate account.
- Node.js 20 or later.
- Git for cloning the project from GitHub.
- Optional: A Cloudflare account if you want to deploy the app to the web. You can sign up and run workers for free.
- Create a Replicate API token at replicate.com/account/api-tokens
- Create an OpenAI API key at platform.openai.com/api-keys
Copy .dev.vars.example to .dev.vars:
cp .dev.vars.example .dev.varsEdit .dev.vars and add your OpenAI API key and Replicate API token:
OPENAI_API_KEY=...
REPLICATE_API_TOKEN=...Install dependencies
npm installRun local server
npm run devUpload your secrets
npx wrangler secret put OPENAI_API_KEY
npx wrangler secret put REPLICATE_API_TOKENnpm run deploy