get_defaults
Retrieve and update generation defaults and ComfyUI UI settings: get/set image parameters and frontend preferences, with optional persistence.
Instructions
Read and write settings — either OUR generation defaults or ComfyUI's own frontend UI settings. These are two SEPARATE stores and the action says which one you mean:
action:"get" — Return the merged view of OUR generation defaults with per-source attribution. Precedence (lowest → highest): config file → COMFYUI_DEFAULT_* env vars → runtime overrides via action:"set". Per-call MCP tool args always win over these defaults when consumed by a workflow-construction tool. Read-only, and works even with no ComfyUI running.
action:"set" — Update OUR generation defaults from
values. By default updates the in-memory runtime layer (lost on restart); pass persist:true to also write the change into the config file (~/.config/comfyui-mcp/config.json by default). Use this to avoid repeating common values like width, height, steps, cfg, sampler, checkpoint.action:"get_ui" — Read COMFYUI's OWN per-user frontend UI settings (the Comfy.* ids its Settings panel writes, served by the frontend user manager). This is a DIFFERENT store from action:"get" — nothing here feeds our generation defaults. Read-only. Provide
idto read one setting's raw stored value; omitidto list all stored settings (optionally narrowed byfilter). Known ids include Comfy.Validation.Workflows (boolean; its strictness rejects some custom-node workflows), Comfy.PreviewMethod (auto|latent2rgb|taesd|none), Comfy.LinkRenderMode (0 straight / 1 linear / 2 spline / 3 hidden), Comfy.UseNewMenu, and Comfy.Sidebar.Location. Ids are frontend-defined and stored verbatim; keys never written by the user are absent here and fall back to invisible frontend defaults. Values are surfaced with their raw stored type (no coercion). Requires a reachable local or remote ComfyUI; not available in Comfy Cloud mode.action:"set_ui" — Modify one of COMFYUI's OWN persisted frontend UI settings by
id. This writes ComfyUI's user settings store, NOT our generation defaults (that is action:"set"). The change is persisted immediately and takes effect on the next frontend load/refresh (an already-open UI tab keeps its old value until reloaded). The value is stored as-is: booleans/numbers are NOT coerced from strings, so pass true (not "true") and 2 (not "2"). Known ids: Comfy.Validation.Workflows (boolean; loosening it lets stricter custom-node workflows load), Comfy.PreviewMethod (auto|latent2rgb|taesd|none), Comfy.LinkRenderMode (0 straight / 1 linear / 2 spline / 3 hidden), Comfy.UseNewMenu, Comfy.Sidebar.Location. Ids are frontend-defined; an unknown id is stored verbatim and simply ignored by the UI. Returns { id, previous, value } — the prior value is read first so you can report and undo the change (previous is null when the key was unset).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | ComfyUI UI setting id, e.g. 'Comfy.Validation.Workflows'. REQUIRED for action:"set_ui". OPTIONAL for action:"get_ui" — omit to list all stored settings. | |
| value | No | action:"set_ui" — REQUIRED. New value for the ComfyUI UI setting. Stored as-is; booleans/numbers are NOT coerced from strings (pass true, not "true"). | |
| action | Yes | Which settings operation to perform, and on WHICH store. "get"/"set" are the MCP server's own generation defaults (width, steps, cfg, …); "get_ui"/"set_ui" are ComfyUI's separate frontend UI settings (the Comfy.* ids). "get" takes no other parameters; "set" requires `values` (optional `persist`); "get_ui" takes an optional `id` or `filter`; "set_ui" requires `id` + `value`. | |
| filter | No | action:"get_ui" — case-insensitive substring filter on setting ids when listing (e.g. 'preview'). Ignored when `id` is given. | |
| values | No | action:"set" — REQUIRED. Key/value map of GENERATION defaults to set. Keys are typically lowercase (e.g. width, steps). Not for Comfy.* UI ids — those go through action:"set_ui". | |
| persist | No | action:"set" — if true, write to the config file in addition to runtime. |