Skip to main content
Glama

FLUX_1-schnell-infer

Generate images from text prompts using customizable parameters like seed, dimensions, and inference steps with the HuggingFace Spaces integration on mcp-hfspace.

Instructions

Call the FLUX.1-schnell endpoint /infer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
heightNonumeric value between 256 and 2048
num_inference_stepsNonumeric value between 1 and 50
promptYesPrompt
randomize_seedNoRandomize seed
seedNonumeric value between 0 and 2147483647
widthNonumeric value between 256 and 2048

Implementation Reference

  • Tool name formatting function that converts space and endpoint names into MCP tool names, replacing dots with underscores and other special characters
    function formatMcpToolName(space: string, endpoint: string | number) { return `${space}-${endpoint}`.replace(/[^a-zA-Z0-9_-]/g, "_").slice(0, 64); }
  • src/config.ts:32-38 (registration)
    Default configuration that includes black-forest-labs/FLUX.1-schnell space, which would be formatted as FLUX_1-schnell-infer tool when paired with /infer endpoint
    spacePaths: (() => { const filtered = argv._.filter((arg) => arg.toString().trim().length > 0); return filtered.length > 0 ? filtered : ["black-forest-labs/FLUX.1-schnell"]; })(), };
  • Endpoint selection logic that prioritizes /infer endpoint for FLUX space, which creates the FLUX_1-schnell-infer tool
    const preferredApis = [ "/predict", "/infer", "/generate", "/complete", "/model_chat", "/lambda", "/generate_image", "/process_prompt", "/on_submit", "/add_text", ];
  • Main handler function that executes tool calls for registered endpoints including FLUX_1-schnell-infer
    async call( request: CallToolRequest, server: Server, ): Promise<CallToolResult> { const progressToken = request.params._meta?.progressToken as | string | number | undefined; const parameters = request.params.arguments as Record<string, unknown>; // Get the endpoint parameters to check against const endpointParams = this.endpoint.parameters; // Process each parameter, applying handle_file for file inputs for (const [key, value] of Object.entries(parameters)) { const param = endpointParams.find( (p) => p.parameter_name === key || p.label === key, ); if (param && isFileParameter(param) && typeof value === "string") { const file = await this.validatePath(value); parameters[key] = handle_file(file); } } const normalizedToken = typeof progressToken === "number" ? progressToken.toString() : progressToken; return this.handleToolCall(parameters, normalizedToken, server); }
  • src/index.ts:110-113 (registration)
    Dynamic tool registration that includes FLUX_1-schnell-infer tool in the MCP server's available tools list
    ...Array.from(endpoints.values()).map((endpoint) => endpoint.toolDefinition(), ), ],

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/evalstate/mcp-hfspace'

If you have feedback or need assistance with the MCP directory API, please join our Discord server