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 客户端
Evo AI - AI Agents Platform
evolutionapiEvo AI is an open-source platform for creating and managing AI agents, enabling integration with different AI models and services.
Smolagents
huggingface🤗 smolagents: a barebones library for agents that think in code.
Where On-Device and Cloud LLMs Meet
hazyresearchBig & Small LLMs working together
Fast Agent
evalstateDefine, Prompt and Test MCP enabled Agents and Workflows
Tester Client for Model Context Protocol (MCP)
apifyModel Context Protocol (MCP) Client for Apify's Actors
评论