flux image generation mcp server
更新时间:2025-03-05 19:21:24
What is Flux Image Generation Server: Flux Image Generation Server is a lightweight HTTP server designed to interact with Replicate's Flux Schnell model for generating images. The server provides an easy way to request image generation by sending a POST request with a description prompt.
How to use Flux Image Generation Server: 1. Install dependencies with `npm install`. 2. Set the Replicate API token as an environment variable using `export REPLICATE_API_TOKEN=your_token_here`. 3. Build the server with `npm run build`. 4. Start the server with `npm start`. The server will run on port 3000. 5. Send a POST request to `http://localhost:3000/generate` with a JSON payload containing a prompt.
FAQ from Flux Image Generation Server 1. **How do I stop the server?** You can gracefully shut down the server by pressing `Ctrl+C`. 2. **What is the format for the image generation request?** The request should be a POST request to `/generate` with a JSON body containing a \"prompt\" key for the image description. 3. **What happens if the API token is not set?** If the API token is not provided, the server will not be able to authenticate with Replicate’s API, and image generation will fail. 4. **Can I change the port the server runs on?** Yes, you can modify the port in the server configuration before starting the server.