Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
COMFYUI_URLNoThe ComfyUI instance to drivehttp://127.0.0.1:8188
DRAFTSMAN_TIMEOUTNoHTTP timeout (seconds)30
DRAFTSMAN_LEARNED_DIRNoPersistent learned model knowledge~/.comfy-draftsman/learned
DRAFTSMAN_SESSION_DIRNoWhere in-progress workflows persist./.draftsman-sessions

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_instance_infoA

ComfyUI version, OS, VRAM, queue length of the connected instance. Call first.

search_nodesA

Search node classes installed on the instance (name/display-name/description).

Use category to narrow (e.g. 'loaders', 'conditioning', 'sampling', 'ImpactPack'). Set detail=True to fold each hit's full input/output schema in-line (use a specific query + small limit) so you can skip the follow-up get_node_info.

get_node_infoA

Full input/output schema for node classes: slot names, types, widget defaults/ranges, combo choices, tooltips.

BATCH your lookups: pass class_types=["A", "B", "C"] to fetch many in ONE call (returns {class_type: schema}) instead of one call per node. A single class_type=... still returns that one node's schema directly.

Long combo lists (fonts, model files...) are capped at 24 choices by default; to browse the rest, pass choices_filter='substring' (case-insensitive, applies to every combo of the node) and/or max_choices=N to raise the cap.

list_modelsA

Model files installed on the instance. folder picks the model type: checkpoints, loras, vae, diffusion_models, text_encoders, upscale_models, controlnet, embeddings, ... (unknown folder -> the full available list). search filters filenames (case-insensitive substring).

list_templatesA

ComfyUI's bundled workflow templates - the best starting points for current models (they ship with every release). Seed one via create_workflow(template=...).

create_workflowA

Start a workflow: blank, or seeded from a bundled template (recommended for current model families - see list_templates). Returns workflow_id + node summary.

list_workflowsA

Workflows already saved in ComfyUI's workflow browser (userdata). Use a returned name with import_workflow(name=...) to load one WITHOUT pasting its JSON. search filters names (case-insensitive substring).

import_workflowA

Import an existing workflow into the session. EITHER paste JSON as workflow_json (UI format with nodes/links, or API format {id: {class_type, inputs}}), OR pass name to load one straight from ComfyUI's workflow browser (see list_workflows) - preferred for large files, no pasting needed. Use for beautifying/diagnosing/porting outside work.

inspect_workflowA

Compact view of a session workflow: nodes (id/class/title/widgets), links, groups - plus full inner node/wiring detail for any subgraph definitions (newer bundled templates package their graph as a subgraph).

edit_workflowA

Apply batched edits. Each op is a dict with 'op' plus:

  • {"op": "add_node", "class_type": str, "title"?: str, "widgets"?: {name: value}}

  • {"op": "remove_node", "node_id": int}

  • {"op": "connect", "from_node": int, "from_output": str|int, "to_node": int, "to_input": str}

  • {"op": "set_widget", "node_id": int, "input": str, "value": any}

  • {"op": "set_title", "node_id": int, "title": str}

  • {"op": "set_mode", "node_id": int, "mode": int} # 0 normal, 2 mute, 4 bypass

Output slot names and widget names come from get_node_info. Annotation nodes (class_type "Note" or "MarkdownNote") are supported with a single widget 'text'. Ops apply in order; a failing op stops the batch, reports what succeeded, and leaves the graph unchanged by the failing op.

organize_workflowA

THE finishing step: auto-layout into pipeline stage bands, colored groups, human titles, green highlights on user-editable knobs, and markdown guidance notes (model-family aware, two registers: 'touch this' vs 'leave alone'). Run after wiring is done and before save_workflow. Idempotent.

MUTATES the session workflow in place - the applied block in the result summarizes the layout/group/note changes; inspect_workflow or export_workflow_json shows the full reorganized graph.

lint_workflowA

Readability/wiring lint: unlabeled prompts, missing groups/notes, orphan nodes, unconnected required inputs, overlapping nodes. Empty list = clean.

validate_workflowA

Validate against the LIVE instance: node classes installed, widget values in range, combo/model-file values actually present (with closest-match suggestions), required inputs connected. Fix errors before run_workflow.

diagnose_workflowA

Deep-check an old/broken workflow and propose fixes: everything from validate_workflow PLUS Comfy Registry resolution for missing custom-node classes (which pack provides them, how to install). Apply fixes via edit_workflow, or port_workflow for model-family moves.

port_workflowA

CROSS-FAMILY MODEL PORT ONLY (e.g. 'sdxl' -> 'flux'): swaps loader topology when needed, retunes CFG/steps/sampler/scheduler and technique nodes (FaceDetailer etc.) from family knowledge, swaps latent node class, picks installed model files. NOT for fixing missing/uninstalled nodes - that's diagnose_workflow + resolve_missing_nodes. Returns changes + flags for anything that needs your judgment. Families: get_model_guidance / get_instance_info.

run_workflowA

Queue the workflow and (by default) wait for completion. Returns status, node errors if it failed, output file refs, and an inline preview thumbnail so you can SEE the result (view_output fetches full size / other outputs). wait=False returns {status: queued, prompt_id} immediately - poll get_run_status(prompt_id). Prove a workflow works before saving/delivering.

allow_invalid=True submits even when the local validator reports errors (ComfyUI is the final judge; use it if a valid graph is being wrongly blocked). save_dir (or, when empty, the configured COMFYUI_MOUNT_DIR) relocates every finished image out of ComfyUI's output tree into a folder the caller can reach, returning saved_paths - so a render is presentable in one call without a separate save_output step.

view_outputA

Fetch a rendered image so you (and the user) can SEE it - refs come from run_workflow/get_run_status outputs. Downscaled to max_dim px to keep the conversation light; max_dim=None for full resolution.

save_outputA

Copy a finished render out of ComfyUI's output tree into a folder the caller (e.g. a Claude Desktop / Cowork sandbox) can reach. ComfyUI's save nodes only write inside its own output/ dir and reject absolute paths, so a relocation step is needed before an image can be presented or edited.

Provide prompt_id (relocates every output image of that finished job) OR an explicit filename (+subfolder/type, as reported in a run's outputs). dest_dir defaults to the configured COMFYUI_MOUNT_DIR. dest_filename renames a single saved image. Returns {saved_paths, dest_dir}.

get_run_statusA

Status of a run queued with run_workflow(wait=False): queue position, live step progress while sampling, and outputs (+ error details) once finished.

upload_imageA

Upload a source image into ComfyUI's input folder so LoadImage can use it (img2img / inpaint / ControlNet). Exactly one of image_path (local file) or image_base64. mask_for={filename, subfolder?, type?} uploads this as a MASK for that already-uploaded image instead.

manage_queueA

Inspect or manage the instance's run queue: status (prompt ids only), interrupt (stop the currently running prompt), clear (drop ALL pending), delete (drop specific pending prompt_ids), free (release cached VRAM/RAM; unload_models=True also unloads models). clear/delete/interrupt discard other queued work - make sure that's what the user wants.

save_workflowA

Save the workflow (UI format, with layout/groups/notes) into ComfyUI's workflow browser + the session dir. Run organize_workflow first - this is the deliverable. REFUSES to save with validation errors unless allow_invalid=True. Never overwrites by default: a taken name saves as ' (draftsman)' (result.renamed_from says so); overwrite=True replaces deliberately.

export_workflow_jsonB

The workflow as JSON: 'ui' (shareable, opens in the editor, keeps layout & notes) or 'api' (for POST /prompt automation).

resolve_missing_nodesA

Find which installable node packs provide these node class names (official Comfy Registry). THIS is the tool for missing/uninstalled nodes (port_workflow is for model-family moves, not missing nodes). Returns pack ids, repos, and install hints. Installing custom nodes runs third-party code - surface the choice to the user.

search_node_packsA

Search the Comfy Registry for node packs by capability (e.g. 'face detailer', 'wildcards', 'video interpolation').

get_model_guidanceA

Tuned settings for a model family: sampling (CFG/steps/samplers), native resolutions, technique blocks (face_detailer, hires_fix...), prompt style notes. Variant-aware: pass model_filename so turbo/lightning/distill overrides apply. Includes any learned overlay from past research plus a research directive - for brand-new models, verify online and record_learning what you find.

record_learningB

Persist researched settings so FUTURE sessions start smarter. updates uses the guidance shape, e.g. {"sampling": {"cfg": {"default": 3.5}}} or {"techniques": {"face_detailer": {"denoise": 0.4}}}. source = URL/model page. Any family name works; for a NEW family also include a "detect" block so it's auto-recognized next session: {"detect": {"checkpoint_patterns": ["mymodel"]}, "loader": "unet_clip_vae"}.

Prompts

Interactive templates invoked by user choice

NameDescription
build_workflowGuided flow for building a working, optimized, human-readable workflow.
modernize_workflowGuided flow for repairing or porting an outdated workflow.

Resources

Contextual data attached and managed by the client

NameDescription
workflow_format_cheatsheetHow ComfyUI workflow JSON works (UI vs API format).

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EnragedAntelope/comfy-draftsman'

If you have feedback or need assistance with the MCP directory API, please join our Discord server