retiform-comfyui-mcp

v2.0.0
retiform-comfyui-mcp Checked 4 days ago Published 25 days ago

Agentic 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

ParameterTypeDescription
fp16boolean
lowvramboolean
portinteger

stop_comfyui

Graceful shutdown of ComfyUI server

ParameterTypeDescription
forceboolean

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…

ParameterTypeDescription
prompt *string
cfg_scalenumber
heightinteger
lora
lora_weightnumber
loras
negative_embedding
negative_promptstring
output_formatstring
samplerstring
schedulerstring
seed
stepsinteger
widthinteger

get_job_status

Poll for job completion

ParameterTypeDescription
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…

ParameterTypeDescription
prompt *string
reference_images *array
cfg_scalenumber
clip_vision_model
denoisenumber
embeds_scalingstring
end_atnumber
heightinteger
ipadapter_model
loras
negative_embedding
negative_promptstring
output_formatstring
output_prefixstring
reference_weightnumber
samplerstring
schedulerstring
seed
start_atnumber
stepsinteger
weight_typestring
widthinteger

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…

ParameterTypeDescription
prompts *array
reference_images *array
deduplicate_seedsboolean
keep_loadedboolean
prioritystring
randomize
shared_params

list_models

Discover available models: unet, clip, vae, lora

ParameterTypeDescription
model_typestring

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…

ParameterTypeDescription
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

ParameterTypeDescription
prompts *array
deduplicate_seedsboolean
keep_loadedboolean
prioritystring
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.

ParameterTypeDescription
restart_comfyuiboolean