Content
# Flux Schnell
A text-to-image application based on Cloudflare Worker and AI integration. It supports a WebUI interface and Cursor editor integration.
## Quick Start
1. Double-click to run `start-flux-schnell.bat`
2. Choose one of the following options as needed:
- Option 1: Start WebUI directly (if you already have a Worker URL)
- Option 2: Deploy Worker and obtain the URL, then start WebUI
- Option 3: Automatically extract Worker URL from the most recent deployment
- Option 4: Start CF-FLUX-MCP for Cursor editor integration (completed)
3. If you choose to deploy the Worker, the system will open a browser for you to log in to your Cloudflare account and authorize
4. After deployment is complete, copy the displayed Worker URL
5. Continue based on your chosen usage method:
- WebUI: Enter the Worker URL in the interface and click the "Save and Continue" button to start using it
- Cursor: Configure the MCP program as prompted
## Directory Structure
- `cf-flux-schnell/` - Cloudflare Worker source code
- `weiui/` - Graphical user interface
- `CF-FLUX-MCP/` - Cursor editor integration code (completed)
- `*.bat` - Various helper scripts
## Features
- High-quality text-to-image generation based on Cloudflare Workers AI
- Dual usage modes:
- Responsive modern WebUI interface
- Direct integration with Cursor editor
- Supports multiple languages (English, Simplified Chinese, Traditional Chinese, Russian, Arabic, French, German, Spanish)
- Adjustable generation steps to balance quality and speed
- Generation history and quick reuse
- Convenient image download feature
- Fully automated deployment and configuration
## Deployment Instructions
This application uses Cloudflare Worker to provide AI text-to-image services, requiring you to have a Cloudflare account (free).
### Deployment Methods
1. **Interactive Browser Authentication (Recommended)**:
- Run `start-flux-schnell.bat` and select option 2
- The system will open a browser for you to log in to your Cloudflare account
- After deployment, the Worker URL will be automatically saved
- No need to manually obtain an API Token
2. **Manual Deployment**:
- Navigate to the `cf-flux-schnell` directory
- Run `npm install`
- Run `npx wrangler deploy`
- Run `save-worker-url.bat` to save the obtained URL
## Usage
### 1. WebUI Interface
Use directly through the graphical interface, supporting:
- Visual prompt input
- Image preview
- History management
- Language switching
### 2. Cursor Editor Integration
1. Start the MCP service:
- Run `start-flux-schnell.bat` and select option 4
- The system will automatically start the MCP service
2. Configure Cursor:
- Open Cursor settings
- Select "Copilot Settings"
- Go to the "MCP Program" tab
- Add a new program:
- Command: `node full_path\CF-FLUX-MCP\simple-server-final.js`
- Name: CF-FLUX-MCP
- Description: Flux image generation
3. Use in the editor:
```
/generate-flux-image prompt="Description of the image you want to generate" steps=5
```
Parameter Explanation:
- prompt: Image description (required)
- steps: Generation steps, range 1-8, default 5 (optional)
## API Description
After deploying the Worker, a text-to-image API will be available, which can be called as follows:
```
POST https://your-worker-url.workers.dev
Headers:
Content-Type: application/json
Authorization: Bearer Hsue8p20snchw734ambncMD
Body:
{
"prompt": "Description of the image you want to generate",
"steps": 4 // Optional parameter, range 1-8
}
```
## Multilingual Support
The WebUI interface of this application supports the following languages:
- English
- Simplified Chinese
- Traditional Chinese
- Russian (Русский)
- Arabic (العربية)
- French (Français)
- German (Deutsch)
- Spanish (Español)
The language will be automatically detected based on browser settings, and you can also manually switch using the language selector in the upper right corner of the interface.
## Troubleshooting
### WebUI Related
- **Deployment Failed**: Ensure you are logged into the correct Cloudflare account and have permission to deploy Workers
- **Worker URL Not Displayed**: The URL will be displayed in the command line after successful deployment; you can also find the URL on the Workers page of the Cloudflare dashboard
- **WebUI Won't Start**: Check if Node.js is installed and try reinstalling dependencies (`cd weiui && npm install`)
- **URL Not Effective After Saving**: Try resetting the configuration and re-entering the URL, ensuring you click the "Save and Continue" button
### Cursor Integration Related
- **Cannot Find Worker URL**: Ensure the `worker_url.txt` file exists and contains the correct URL
- **MCP Connection Failed**: Check if the command path in Cursor settings is correct; it should now use `simple-server-final.js`
- **Image Generation Failed**: Ensure the prompt does not contain special characters and the steps are within the valid range (1-8)
- **Chinese Prompt Handling**: The system now has basic capabilities for simple Chinese-English conversion, but complex Chinese may require you to manually input English prompts
## Get Help
For more assistance, please refer to the `Getting Worker URL Guide.md` document or visit the [Cloudflare Workers Documentation](https://developers.cloudflare.com/workers/).
## Special Thanks
Thanks to Cloudflare for providing AI services, allowing everyone to experience the charm of text-to-image generation.
Connection Info
You Might Also Like
Continue
Continue is an open-source project for seamless server management.
semantic-kernel
Build and orchestrate intelligent AI agents with Semantic Kernel.
repomix
Repomix packages your codebase into AI-friendly formats for seamless integration.
Serena
Serena is a free, open-source toolkit that enhances LLMs with IDE-like coding tools.
Blender
BlenderMCP integrates Blender with Claude AI for enhanced 3D modeling.
pydantic-ai
Pydantic AI: A GenAI Agent Framework designed with Pydantic principles.