quickImage
Generate images from text prompts using the FLUX model with default settings. Provide a description to create and save visual content.
Instructions
Quickly generate an image based on a text prompt with default settings
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Text description of the image to generate | |
| customPath | No | Custom path to save the generated image |
Implementation Reference
- src/index.ts:108-135 (handler)The handler logic for the 'quickImage' tool within the CallToolRequestSchema handler. It validates the prompt argument, calls the shared generateImage function with default parameters and a custom filename, then constructs a text response with the image URL and local save path.case "quickImage": { // Validate parameters if (typeof args.prompt !== 'string') { throw new Error("Invalid prompt: must be a string"); } // Simple version with just a prompt const result = await generateImage(args.prompt, { saveImage: true, filename: `flux_quick_${Date.now()}.png`, customPath: typeof args.customPath === 'string' ? args.customPath : undefined }); // Return a plain text response with the image URL and save location let textContent = `Image generated\nLink: ${result.image_url}`; // Add information about where the image was saved if (result.local_path) { textContent += `\nImage saved to: ${result.local_path}`; } return { content: [ { type: "text", text: textContent } ], isError: false, }; }
- src/schemas.ts:55-72 (schema)The Tool schema definition for 'quickImage', specifying name, description, and input schema requiring a 'prompt' string and optional 'customPath'.export const QUICK_IMAGE_TOOL: Tool = { name: "quickImage", description: "Quickly generate an image based on a text prompt with default settings", inputSchema: { type: "object", properties: { prompt: { type: "string", description: "Text description of the image to generate" }, customPath: { type: "string", description: "Custom path to save the generated image" } }, required: ["prompt"] } };
- src/index.ts:48-54 (registration)Registration of the 'quickImage' tool (as QUICK_IMAGE_TOOL) in the listTools request handler, making it available to clients.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ GENERATE_IMAGE_TOOL, QUICK_IMAGE_TOOL, BATCH_GENERATE_IMAGES_TOOL ], }));