Skip to main content
Glama

text_to_image

Generate an image from a text description. Supports customization of size, steps, and style models for tailored results.

Instructions

Generate an image from text prompt using WaveSpeed AI.

Args:
    prompt (str): Required. Text description of the image to generate. MUST BE IN ENGLISH. Non-English prompts will be rejected or result in poor quality outputs.
    model (str, optional): Model to use for image generation.
    loras (list, optional): List of LoRA models to use, each with a path and scale. Format: [{"path": "model_path", "scale": weight_value}]. Default model used if not provided.
    size (str, optional): Size of the output image in format "width*height", e.g., "512*512". Default: 1024*1024.
    num_inference_steps (int, optional): Number of denoising steps. Higher values improve quality but increase generation time. Default: 30.
    guidance_scale (float, optional): Guidance scale for text adherence. Controls how closely the image matches the text description. Default: 7.5.
    num_images (int, optional): Number of images to generate. Default: 1.
    seed (int, optional): Random seed for reproducible results. Set to -1 for random. Default: -1.
    enable_safety_checker (bool, optional): Whether to enable safety filtering. Default: True.
    output_directory (str, optional): Directory to save the generated images. Uses a temporary directory if not provided.
    request_id (str, optional): Request correlation ID for tracing the entire request chain. Strongly recommended to provide a unique ID (e.g., UUID) to correlate logs across the request lifecycle.

Returns:
    WaveSpeedResult object with the result of the image generation, containing:
    - status: "success" or "error"
    - urls: List of image URLs if successful
    - base64: List of base64 encoded images if resource_mode is set to base64
    - local_files: List of local file paths if resource_mode is set to local
    - error: Error message if status is "error"
    - processing_time: Time taken to generate the image(s)
    
Examples:
    Basic usage: text_to_image(prompt="A golden retriever running on grass")
    Advanced usage: text_to_image(
        prompt="A golden retriever running on grass", 
        size="1024*1024", 
        num_inference_steps=50,
        seed=42
    )
    
Note: 
    For optimal results, always provide prompts in English, regardless of your interface language.
    Non-English prompts may result in lower quality or unexpected images.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
modelNo
lorasNo
sizeNo1024*1024
num_inference_stepsNo
guidance_scaleNo
num_imagesNo
seedNo
enable_safety_checkerNo
output_directoryNo
request_idNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description fully discloses behavior: requires English prompts, lists all parameters with defaults, explains safety checker, return object structure, and includes warnings about non-English prompts. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured with Args, Returns, Examples, and Note sections. It is front-loaded with the main purpose. Some redundancy could be trimmed, but it remains informative and organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 11 parameters, no output schema, and no annotations, the description covers everything comprehensively: parameter descriptions, return values, examples, and notes. The agent has all necessary information to use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It does so excellently by explaining every parameter (prompt, model, loras, size, steps, guidance, num_images, seed, safety, output_dir, request_id) with format details, defaults, and usage notes. The loras format is clearly specified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Generate an image from text prompt using WaveSpeed AI,' which is a specific verb+resource combination. It distinguishes from siblings (generate_video, image_to_image) by focusing on text-to-image generation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides detailed parameter guidelines and usage examples but does not explicitly state when to use this tool versus alternatives (generate_video, image_to_image). It mentions language requirements and optimal usage, which implies context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/WaveSpeedAI/mcp-server'

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