> ## Documentation Index
> Fetch the complete documentation index at: https://comfyui-mcp.artokun.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Defaults, Stats & Skills

> Generation defaults, ComfyUI frontend UI settings, and skill generation. (History-based suggestions and stats moved onto get_history in 0.50.0 slice 16.)

<Info>1 tool. Generated from the live MCP tool schemas — do not edit by hand; run `npm run docs:gen`.</Info>

<Tip>**You don't type these calls.** Ask your agent for what you want in ordinary English — it chooses the tool and fills in the arguments. The JSON on this page is what it sends. New here? Start with [Using the tools](/docs/using-tools).</Tip>

## get\_defaults

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 `id` to read one setting's raw stored value; omit `id` to list all stored settings (optionally narrowed by `filter`). 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).

<Tip>**In plain terms:** Two separate sets of settings behind one tool, told apart by `action`. `get`/`set` are the values the agent falls back to when you do not say one — stop repeating yourself and set them once. `get_ui`/`set_ui` are ComfyUI's OWN interface settings, the ones its Settings panel writes; changing those changes the ComfyUI web UI, not what the agent renders.</Tip>

### Parameters

<ParamField path="action" type="enum" required>
  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`. Options: `action:"get"`, `action:"set"`, `action:"get_ui"`, `action:"set_ui"`.
</ParamField>

<ParamField path="values" type="object">
  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".
</ParamField>

<ParamField path="persist" type="boolean">
  action:"set" — if true, write to the config file in addition to runtime.
</ParamField>

<ParamField path="id" type="string">
  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.
</ParamField>

<ParamField path="filter" type="string">
  action:"get\_ui" — case-insensitive substring filter on setting ids when listing (e.g. 'preview'). Ignored when `id` is given.
</ParamField>

<ParamField path="value" type="string | number | boolean | object | any[]">
  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").
</ParamField>

### Examples

**You say:** What settings do you use when I don't say?

```json theme={null}
{
  "tool": "get_defaults",
  "arguments": {
    "action": "get"
  }
}
```

**You get back:** The current fallback size, steps, cfg, sampler and checkpoint, and where each came from.

**You say:** Always use 1024 by 1024 and 30 steps, permanently.

```json theme={null}
{
  "tool": "get_defaults",
  "arguments": {
    "action": "set",
    "values": {
      "width": 1024,
      "height": 1024,
      "steps": 30
    },
    "persist": true
  }
}
```

**You get back:** Confirmation of the new defaults. `persist: true` writes them to your config file so they survive a restart; without it they last only for this session.

**You say:** ComfyUI keeps refusing to open this workflow — loosen its validation.

```json theme={null}
{
  "tool": "get_defaults",
  "arguments": {
    "action": "set_ui",
    "id": "Comfy.Validation.Workflows",
    "value": false
  }
}
```

**You get back:** The old and new value of that ComfyUI interface setting, so you can put it back. Reload the ComfyUI tab for it to take effect — an already-open tab keeps the old value.

***
