Prerequisites
- ComfyUI installed and running (installation guide)
- At least one checkpoint model downloaded (e.g., SDXL, Flux, or Stable Diffusion 1.5)
- The MeiGen MCP plugin installed (Setup Guide)
COMFYUI_URLconfigured (default:http://127.0.0.1:8188)
Exporting a Workflow from ComfyUI
The plugin uses ComfyUI’s API format — a JSON file that describes the workflow as a graph of nodes. This is different from the standard ComfyUI save format.Enable Dev Mode
In ComfyUI, go to Settings → enable Dev Mode Options. This adds the API format save button to the menu.
Build or load your workflow
Set up the workflow you want to use — choose your checkpoint, sampler, prompt nodes, and any other processing steps.
Importing Workflows
After exporting from ComfyUI, import the workflow into the plugin:- Parse the workflow JSON
- Auto-detect key nodes:
- KSampler — sampler, steps, CFG, scheduler
- CLIPTextEncode — positive and negative prompt
- EmptyLatentImage — image width and height
- CheckpointLoader — model checkpoint
- LoadImage — reference image input
- SaveImage — output node
- Save the template to
~/.config/meigen/workflows/ - Report which nodes were detected and which parameters can be controlled
Managing Workflows
Use thecomfyui_workflow tool to manage your imported templates:
| Action | Description |
|---|---|
| list | Show all imported workflows with a summary (model, sampler, steps) |
| view | Inspect a workflow’s full node graph, parameters, and editable fields |
| modify | Change workflow parameters — steps, CFG, sampler, scheduler, checkpoint, etc. |
| delete | Remove a workflow template |
Viewing a Workflow
Modifying Parameters
How Generation Works
When you ask the AI to generate an image using ComfyUI:- Prompt injection — your prompt text is inserted into the positive
CLIPTextEncodenode - Size calculation — the requested aspect ratio is converted to pixel dimensions (rounded to multiples of 8 for Stable Diffusion compatibility)
- Reference images — if you provided reference image URLs, the plugin downloads them and uploads to ComfyUI’s
input/directory, then injects them intoLoadImagenodes - Workflow submission — the modified workflow is submitted to ComfyUI’s API
- Status polling — the plugin polls every 2 seconds until generation completes (5-minute timeout)
- Result retrieval — the generated image is downloaded from ComfyUI and returned
Reference Images
To use reference images with ComfyUI, your workflow must include at least one LoadImage node.- The plugin automatically detects
LoadImagenodes in your workflow - When you provide reference image URLs, the plugin downloads and uploads them to ComfyUI
- If your workflow has no
LoadImagenodes, reference images are ignored (with a warning)
Performance Notes
| Aspect | Detail |
|---|---|
| Concurrency | Serial only — one image at a time. Your local GPU can’t run multiple generations in parallel. |
| Timeout | 5 minutes maximum per generation |
| Poll interval | 2 seconds |
| Size rounding | Dimensions are rounded to multiples of 8 for Stable Diffusion compatibility |
Troubleshooting
'Connection refused' error
'Connection refused' error
ComfyUI is not running or the URL is wrong. Start ComfyUI and check that
COMFYUI_URL matches the address shown in the ComfyUI terminal output (default: http://127.0.0.1:8188).No workflows found
No workflows found
You need to import at least one workflow before generating. Export a workflow from ComfyUI using Save (API Format), then import it with
comfyui_workflow import.Node detection missed a node
Node detection missed a node
The plugin uses class-type matching to detect nodes. If detection fails for a custom node, use
comfyui_workflow view to see all nodes, then comfyui_workflow modify to manually set parameters.Checkpoint not found
Checkpoint not found
The workflow references a checkpoint model that isn’t downloaded. Check ComfyUI’s
models/checkpoints/ directory and ensure the filename matches what the workflow expects.Reference images not working
Reference images not working
Your workflow must include a
LoadImage node. Standard text-to-image workflows don’t have this. Create or use an img2img workflow instead.