Skip to main content
Glama

run_workflow_from_file

Execute workflows directly from a specified file path using the ComfyUI MCP Server for streamlined image generation and processing.

Instructions

Run a workflow from a file.

Args: file_path: The absolute path to the file to run.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Implementation Reference

  • The handler function for the 'run_workflow_from_file' MCP tool, including the @mcp.tool() decorator for registration. It loads a JSON workflow from the specified file path, initializes a ComfyUI client, and executes the workflow asynchronously.
    @mcp.tool() async def run_workflow_from_file(file_path: str) -> Any: """Run a workflow from a file. Args: file_path: The absolute path to the file to run. """ with open(file_path, "r", encoding="utf-8") as f: workflow = json.load(f) 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(workflow, {}, 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