AI Image Generation Pipeline with LangGraph and MCP
@lalanikarim
About AI Image Generation Pipeline with LangGraph and MCP
A demonstration of using LangGraph with MCP for generating prompts and AI-generated images, including Human-in-the-Loop interaction.
Overview
What is AI Image Generation Pipeline with LangGraph and MCP?
This project demonstrates the use of the Model Context Protocol (MCP) with LangGraph to create workflows that generate prompts and AI-generated images based on a given topic. It runs as Python scripts or integrates into Open WebUI Pipelines, and is intended for developers working with LangGraph and MCP.
How to use AI Image Generation Pipeline with LangGraph and MCP?
Install dependencies with pip install aiosqlite langgraph langgraph-checkpoint-sqlite mcp[cli] comfy-mcp-server. Then run app.py or graph.py with command-line arguments like --topic and --thread_id. Optionally use the uv utility (uv run graph.py --thread_id ...). Set environment variables for ComfyUI and Ollama API.
Key features of AI Image Generation Pipeline with LangGraph and MCP
- Uses Model Context Protocol (MCP) for tool execution.
- Integrates Human-in-the-Loop feedback for prompt approval.
- Three implementations: LangGraph Functional API, Graph API, and Open WebUI Pipeline.
- Generates AI image prompts and images via Comfy MCP Server.
- Uses LangGraph checkpointing for state persistence.
Use cases of AI Image Generation Pipeline with LangGraph and MCP
- Generating AI images from a topic with human oversight.
- Building automated workflows for image creation.
- Demonstrating MCP and LangGraph integration in pipelines.
FAQ from AI Image Generation Pipeline with LangGraph and MCP
What is this project?
It uses MCP with LangGraph to create workflows that generate prompts and AI-generated images based on a given topic.
What are the main files?
app.py (LangGraph Functional API with Human-in-the-Loop), graph.py (LangGraph Graph API with Human-in-the-Loop), and ai-image-gen-pipeline.py (Open WebUI Pipeline integration).
What dependencies are needed?
aiosqlite, langgraph, langgraph-checkpoint-sqlite, mcp[cli], and comfy-mcp-server.
How do I run it?
Run python app.py --topic "Your topic" or python graph.py --thread_id "id" --topic "Your topic". Use uv run instead of python to manage dependencies automatically.
What environment variables must be set?
COMFY_URL, COMFY_URL_EXTERNAL, COMFY_WORKFLOW_JSON_FILE, PROMPT_NODE_ID, OUTPUT_NODE_ID, OLLAMA_API_BASE, and PROMPT_LLM.
What is the license?
The project is licensed under the MIT License.
Basic information
More Agent Frameworks MCP clients
🚀 MCPOmni Connect - Universal Gateway to MCP Servers
Abiorh001MCPOmni Connect is an agent execution runtime that connects to multiple MCP servers via stdio, SSE, or streamable HTTP. It supports chat, autonomous agents, and planner-based orchestration treating each MCP server as a tool agent to enable dynamic multi-agent workflows across LLM
🌟 MCPM - Model Context Protocol Manager
pathintegral-instituteCLI MCP package manager & registry for all platforms and all clients. Search & configure MCP servers. Advanced Router & Profile features.
DISCLAIMER
mario-andreschakMCP-Hub and -Inspector, Multi-Model Workflow and Chat Interface
MCP Agent Graph (MAG)
keta1930MCP Agent Graph (MAG) is an agent development framework for rapidly building agent systems. This project is based on graphs, nodes, and MCP to quickly construct complex Agent systems.
Ollama MCP (Model Context Protocol)
mihirrdMCP client for local ollama models
Comments