AI Image Generation Pipeline with LangGraph and MCP
@lalanikarim
基本信息
关于 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.
概览
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.
智能体框架 分类下的更多 MCP 客户端
Open MCP Client
copilotkitSSE-based Server and Client for
sidharthrajaramA working pattern for SSE-based MCP clients and servers
Fast Agent
evalstateDefine, Prompt and Test MCP enabled Agents and Workflows
n8n-nodes-mcp-client
nerding-ion8n custom node for MCP
Novu - Connect your AI agents & products to customers
NovuNovu is the open-source communication layer for AI agents. An agent built on Novu connects to MCP servers like Linear, GitHub, and Notion for its tools, then talks with your users on Slack, Microsoft Teams, WhatsApp, Tel
评论