Skip to main content
Glama

text_to_image

Transform text prompts into detailed images using customizable parameters such as seed, steps, CFG scale, and denoise strength on the ComfyUI MCP Server.

Instructions

Generate an image from a prompt.

Args: prompt: The prompt to generate the image from. seed: The seed to use for the image generation. steps: The number of steps to use for the image generation. cfg: The CFG scale to use for the image generation. denoise: The denoise strength to use for the image generation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cfgYes
denoiseYes
promptYes
seedYes
stepsYes

Implementation Reference

  • The @mcp.tool()-decorated handler function implementing the text_to_image tool. It creates a ComfyUI client, loads the 'text_to_image' workflow, processes it with provided parameters, and returns generated images.
    @mcp.tool() async def text_to_image(prompt: str, seed: int, steps: int, cfg: float, denoise: float) -> Any: """Generate an image from a prompt. Args: prompt: The prompt to generate the image from. seed: The seed to use for the image generation. steps: The number of steps to use for the image generation. cfg: The CFG scale to use for the image generation. denoise: The denoise strength to use for the image generation. """ auth = os.environ.get("COMFYUI_AUTHENTICATION") comfy = ComfyUI( url=f'http://{os.environ.get("COMFYUI_HOST", "localhost")}:{os.environ.get("COMFYUI_PORT", 8188)}', authentication=auth ) images = await comfy.process_workflow("text_to_image", {"prompt": prompt, "seed": seed, "steps": steps, "cfg": cfg, "denoise": denoise}, return_url=os.environ.get("RETURN_URL", "true").lower() == "true") return images

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/Overseer66/comfyui-mcp-server'

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