Image Generation Worker Template

by janwilmake

5 stars
385 downloads
Not rated
GitHub

About

Template to easily make an MCP server on Cloudflare

Details

Author
janwilmake
GitHub stars
5
Downloads
385
Categories
Developer Tools

- Uses the flux-1-schnell model for image generation.
- Minimal configuration and project structure.
- Ready for local development with Wrangler.
- Deployable as a Cloudflare Worker.
- Includes TypeScript configuration and type definitions.

Install dependencies with npm install, run locally with npm run dev, and deploy with npm run deploy. The worker code is in src/index.ts, and configuration is in wrangler.toml.

Image Generation Worker Template

This is a minimal Cloudflare Worker template for generating images using the workers-mcp package and Cloudflare’s Workers AI.

Features

- Uses the flux-1-schnell model for image generation.
- Minimal configuration and project structure.
- Ready for local development with Wrangler.

Setup

1. Install dependencies:
npm install

2. Run the worker locally:
npm run dev

3. Deploy the worker:
npm run deploy

Files

- src/index.ts: The worker code.
- tsconfig.json: TypeScript configuration.
- wrangler.toml: Cloudflare Workers configuration.
- worker-configuration.d.ts: Type definitions for the worker’s environment.
- package.json: Project dependencies and scripts.
- .gitignore: Ignored files.

Happy coding!

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.