retiform-comfyui-mcp
v2.0.0Agentic ComfyUI image generation over the Model Context Protocol: batch discovery, LoRA shaping, and provenance.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
system_check
Verify system readiness: GPU, driver, VRAM. Reads the driver, not torch. This process never allocates CUDA tensors, so torch.cuda would report 0 whether or not ComfyUI is holding every byte.
start_comfyui
Launch ComfyUI with VRAM-optimized flags
| Parameter | Type | Description |
|---|---|---|
fp16 | boolean | |
lowvram | boolean | |
port | integer |
stop_comfyui
Graceful shutdown of ComfyUI server
| Parameter | Type | Description |
|---|---|---|
force | boolean |
get_comfyui_status
Check if ComfyUI is running
generate_image
Submit an async text-to-image generation job. Runs the packaged SDXL workflow: loads the diffusion model, encodes the prompt pair, samples, and decodes. Returns immediately with a job id -- poll ``get_job_status`` for the result. Args: prompt: What to generate. negative_embedding: Textual-inversion embedding appended to the negative prompt. negative_prompt: What to avoid. width: Output width in pixels. height: Output height in pixels. steps: Sampling steps. More is slower and usually better. cfg_scale: Classifier-free gu…
| Parameter | Type | Description |
|---|---|---|
prompt * | string | |
cfg_scale | number | |
height | integer | |
lora | ||
lora_weight | number | |
loras | ||
negative_embedding | ||
negative_prompt | string | |
output_format | string | |
sampler | string | |
scheduler | string | |
seed | ||
steps | integer | |
width | integer |
get_job_status
Poll for job completion
| Parameter | Type | Description |
|---|---|---|
job_id * | string |
generate_ipadapter
Generate image with IP-Adapter multi-reference style blending. Feeds 1--4 reference images into the diffusion model to influence style, composition, and content of the generated output. Args: prompt: Text prompt describing desired output reference_images: List of 1-4 image filenames from comfyui/input/ negative_prompt: What to avoid in the output negative_embedding: Textual inversion embedding name (e.g., "DeepNegative_xl_v1") to append to negative prompt width: Output width (512 recommended for 6GB VRAM) height: Output height…
| Parameter | Type | Description |
|---|---|---|
prompt * | string | |
reference_images * | array | |
cfg_scale | number | |
clip_vision_model | ||
denoise | number | |
embeds_scaling | string | |
end_at | number | |
height | integer | |
ipadapter_model | ||
loras | ||
negative_embedding | ||
negative_prompt | string | |
output_format | string | |
output_prefix | string | |
reference_weight | number | |
sampler | string | |
scheduler | string | |
seed | ||
start_at | number | |
steps | integer | |
weight_type | string | |
width | integer |
batch_generate_ipadapter
Submit batch IP-Adapter jobs with optional per-generation randomization. All jobs in the batch use the SAME reference images, but each prompt creates a distinct output. Supports parameter randomization per job. Args: prompts: List of positive prompt strings (one per job) reference_images: Shared reference images for all jobs in batch shared_params: Static parameters applied to all generations randomize: Per-generation randomization specs (overrides shared_params) deduplicate_seeds: Ensure unique seeds across batch priority: Queue pr…
| Parameter | Type | Description |
|---|---|---|
prompts * | array | |
reference_images * | array | |
deduplicate_seeds | boolean | |
keep_loaded | boolean | |
priority | string | |
randomize | ||
shared_params |
list_models
Discover available models: unet, clip, vae, lora
| Parameter | Type | Description |
|---|---|---|
model_type | string |
download_model
Download a model file into the right ComfyUI models subdirectory. The contract is deliberately tight, because this writes into the user's model tree: * ``filename`` must be a bare name -- no path separators, no ``..``. * The extension must be plausible for the model type, so a stray ``.sh`` cannot be dropped into ``models/``. * Only ``http``/``https`` URLs are fetched, and redirects are not followed to non-HTTP schemes. * The write is atomic: a partial download lands on a ``.part`` file and is renamed only on success, so an interrupted t…
| Parameter | Type | Description |
|---|---|---|
filename * | string | |
model_type * | string | |
url * | string | |
api_token |
batch_generate
Submit batch jobs with optional per-generation randomization. Args: prompts: List of positive prompt strings (one per job) shared_params: Static parameters applied to all generations randomize: Per-generation randomization specs (override shared_params) Supports: scalar, [min, max] range, choice pool, "random"/"random_unsafe" deduplicate_seeds: Ensure unique seeds across all jobs in this batch priority: Queue priority hint ("high" | "normal") Returns: Batch metadata with batch_id, total_jobs, queued_jobs, job_ids
| Parameter | Type | Description |
|---|---|---|
prompts * | array | |
deduplicate_seeds | boolean | |
keep_loaded | boolean | |
priority | string | |
randomize | ||
shared_params |
get_vram_usage
Monitor live GPU memory and utilisation. Reads the driver, not torch: this process holds no CUDA tensors, so torch would report 0 no matter what ComfyUI is actually holding.
emergency_cleanup
Recover GPU memory by unloading ComfyUI's models. ComfyUI is a separate process and holds the models, so torch.cuda in THIS process can never free them. POST /free on ComfyUI is the only real lever; nvidia-smi measures the result.
| Parameter | Type | Description |
|---|---|---|
restart_comfyui | boolean |