Skip to main content
Glama

generate_image

Create images from text prompts using FLUX.1 Schnell AI, with Lightning Network payment integration for micro-transactions.

Instructions

Generate an image from a text prompt using FLUX.1 Schnell (12B). Costs 100 sats via Lightning L402.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesDescription of the image to generate
payment_hashNoPayment hash if retrying after L402 payment

Implementation Reference

  • The handler for 'generate_image' which sends a request to the API and handles L402 payment requirements.
    server.tool(
      "generate_image",
      "Generate an image from a text prompt using FLUX.1 Schnell (12B). Costs 100 sats via Lightning L402.",
      {
        prompt: z.string().describe("Description of the image to generate"),
        payment_hash: z.string().optional().describe("Payment hash if retrying after L402 payment"),
      },
      async ({ prompt, payment_hash }) => {
        const data = await l402Post(MAXIMUMSATS_API, "/api/imagegen", { prompt }, payment_hash);
        if (data.image) {
          return textResult(`Image generated. Base64 PNG (${data.image.length} chars). Model: ${data.model || "flux-1-schnell"}`);
        }
        return textResult(data.result || formatL402(data));
      }
    );

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/joelklabo/maximumsats-mcp'

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