> ## 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.

# Assets & Images

> View, convert, and upload generated images; analyze colors; stage outputs as inputs; upload media inputs; browse outputs.

<Info>2 tools. 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\_image

Fetch, browse and inspect ComfyUI images and registered assets. Driven by the `action` parameter:

* action:"get" — Fetch a generated image from ComfyUI by FILENAME and return it as an inline image. Video/audio outputs (e.g. a VHS\_VideoCombine .mp4) are saved to save\_dir with their original extension instead of being rendered inline. Works with remote ComfyUI instances — does not require COMFYUI\_PATH. Use get\_history (action:"list") first to obtain the filename.
* action:"view" — Fetch a registered asset's bytes by ASSET ID and return them as an inline image so the agent can see the result. Use this after a render completes (asset\_id is included in the completion notification) to inspect, critique, or compare generated images. Only supports image mime types (PNG/JPEG/WebP); audio/video assets must be saved to disk via action:"get".
* action:"list\_outputs" — List recently generated image AND video files from ComfyUI's output/ directory, newest-first, with each file's kind ('image' | 'video'), subfolder, size, and modification time. Covers stills (.png/.jpg/.jpeg/.bmp) and video/animation outputs (.mp4/.webm/.mov/.mkv/.m4v/.avi/.gif/.webp). LOCAL ComfyUI (COMFYUI\_PATH set): a RECURSIVE filesystem scan of output/ — includes subfolders like video/ that VHS/SaveVideo write to, and reports size + modification time. REMOTE ComfyUI: derives the list from /history over HTTP instead (size/modified are unavailable and omitted). It does NOT return the media bytes themselves — fetch those with action:"get". USE THIS TO CONFIRM A VIDEO RENDER (e.g. VHS\_VideoCombine / LTX / WAN output) when get\_history (action:"list") shows the prompt done but lists no output: VHS-style video nodes write the file but often do NOT register in ComfyUI's /history, so the local filesystem scan is the reliable way to verify the .mp4 exists — then chain it with upload\_image (action:"stage"). THAT GUARANTEE IS LOCAL-ONLY AND INVERTS ON A REMOTE TARGET: with no disk to scan, this falls back to the very /history that omits those videos, so a REMOTE listing can neither confirm nor deny a VHS video render, and absence from it is NOT evidence the file is missing. Check a specific filename with action:"get" or upload\_image (action:"stage") instead — both read /view, straight from the output directory. Every remote result says so in its own text. Read-only.
* action:"convert" — Re-encode a generated image to PNG, JPEG, or WebP and return it inline as an image content block. Source can be a registered asset\_id or a path under the local ComfyUI output directory. Optionally writes the converted image back under the output directory and reports source/output size plus bytes saved.
* action:"analyze\_color" — Measure the color of a rendered image (not by eye): returns black/white points, contrast (luma std), saturation, per-channel means + cast, and clipping — plus heuristic flags (washedOut, lowContrast, liftedBlacks, dimHighlights, lowSaturation, colorCast) and a one-line verdict. Source = asset\_id, a ComfyUI output ref (filename/subfolder/type), or an image path. Pass reference\_path to shot-match against a known-good frame (target−reference deltas). Set histogram:true to also get an overlaid R/G/B/luma histogram PNG. Use this to diagnose 'washed out' objectively and decide a color fix; for a video, extract a frame to PNG first.
* action:"list\_assets" — List recently generated assets, newest-first. Each call first reconciles ComfyUI's /history, so outputs are listed even when this session did not watch the render complete (e.g. queued via panel\_run, by an earlier session, or before a server restart) — those are tagged source:'history-reconcile', versus source:'watched' for renders this server saw finish. Returns count + assets (asset\_id, prompt\_id, filename, url, source, created\_at). The registry is ephemeral and clears on server restart; records expire after COMFYUI\_ASSET\_TTL\_HOURS (default 24h), and only the most recent completed runs are reconciled — use get\_history (action:"list") / action:"get" by filename for anything older.
* action:"asset\_metadata" — Get full provenance for a registered asset including the workflow snapshot that produced it. Use this to inspect the parameters that generated an image before calling generate\_image (action:"regenerate") with overrides.

<Tip>**In plain terms:** Everything the agent does to LOOK at what ComfyUI made: browse what has been written to disk, fetch one file, put a picture in front of the agent, re-encode it, or measure its colour. Worth knowing: video nodes often finish without registering in ComfyUI's history, so `action: "list_outputs"` is the reliable way to confirm a video really rendered.</Tip>

### Parameters

<ParamField path="action" type="enum" required>
  Which image/asset operation to perform. "get" requires `filename`; "view" and "asset\_metadata" require `asset_id`; "convert" requires `format` plus exactly one of `asset_id`/`path`; action:"analyze\_color" takes one source (`asset_id`, `filename`, or `path`); "list\_outputs" and action:"list\_assets" take no required parameters.
  Options: `action:"get"`, `action:"view"`, `action:"list_outputs"`, `action:"convert"`, `action:"analyze_color"`, `action:"list_assets"`, `action:"asset_metadata"`.
</ParamField>

<ParamField path="filename" type="string">
  Output image filename, e.g. PulID\_Klein\_00001\_.png. REQUIRED for action:"get". OPTIONAL for action:"analyze\_color", where it is one of the three ways to name a source (pair it with subfolder/type).
</ParamField>

<ParamField path="asset_id" type="string">
  Asset id returned by action:"list\_assets" or job completion. REQUIRED for actions "view" and "asset\_metadata". OPTIONAL for "convert" (provide exactly one of asset\_id or path) and action:"analyze\_color" (one of asset\_id, filename, or path).
</ParamField>

<ParamField path="type" type="enum">
  ComfyUI directory the file lives in: output (default), input, or temp. Used by action:"get" and by action:"analyze\_color" when the source is a `filename`.
  Options: `output`, `input`, `temp`.
</ParamField>

<ParamField path="subfolder" type="string">
  Subfolder within the directory, if any (default empty). Used by action:"get" and by action:"analyze\_color" when the source is a `filename`.
</ParamField>

<ParamField path="save_dir" type="string">
  action:"get" — absolute local directory to save the file in. Defaults to a 'comfyui-images' folder inside the platform temp directory (os.tmpdir()), which is created if missing. A RELATIVE value is resolved against this MCP process's working directory, which is the client's choice and may not be writable. On Windows a drive-less path like \out is resolved against this process's CURRENT DRIVE, not a drive you chose. Prefer a fully-qualified path (C:... or \server\share); the returned 'Saved to:' line always names the resolved absolute path.
</ParamField>

<ParamField path="path" type="string">
  A source image path. action:"convert" — a path under COMFYUI\_PATH/output (provide exactly one of asset\_id or path). action:"analyze\_color" — an absolute image path, or a path under the ComfyUI output dir (videos: extract a frame to PNG first).
</ParamField>

<ParamField path="limit" type="integer">
  action:"list\_outputs" — max media files to return, 1..100 (default 20). action:"list\_assets" — max records to return (default: all, no upper bound).
</ParamField>

<ParamField path="pattern" type="string">
  action:"list\_outputs" — filter by filename pattern (case-insensitive substring match).
</ParamField>

<ParamField path="format" type="enum">
  Two unrelated meanings, one per action — the enum is the union of both and each action accepts only its own half. action:"list\_outputs" — RESPONSE SHAPE: "markdown" (default, human/agent-readable) or "json" (\{images:\[\{filename,subfolder,kind,size,modified}]} — for app clients building pick grids). action:"convert" — REQUIRED target encoded image format: "png", "jpeg" or "webp".
  Options: `markdown`, `json`, `png`, `jpeg`, `webp`.
</ParamField>

<ParamField path="quality" type="integer">
  action:"convert" — encoder quality, 1-100. Applies where supported by the selected format.
</ParamField>

<ParamField path="progressive" type="boolean">
  action:"convert" — JPEG only: write a progressive JPEG.
</ParamField>

<ParamField path="lossless" type="boolean">
  action:"convert" — WebP only: write lossless WebP.
</ParamField>

<ParamField path="effort" type="integer">
  action:"convert" — WebP only: encoder effort, 0-6.
</ParamField>

<ParamField path="out_path" type="string">
  action:"convert" — optional output path under COMFYUI\_PATH/output where the converted image should be written.
</ParamField>

<ParamField path="reference_path" type="string">
  action:"analyze\_color" — optional reference image to shot-match against; returns target−reference deltas for contrast, black/white points, saturation, and per-channel means.
</ParamField>

<ParamField path="histogram" type="boolean">
  action:"analyze\_color" — also return an overlaid R/G/B/luma histogram PNG for visual confirmation (default false).
</ParamField>

<ParamField path="since" type="string">
  action:"list\_assets" — ISO timestamp; only return assets created at or after this time.
</ParamField>

### Examples

**You say:** Show me the last few things I generated.

```json theme={null}
{
  "tool": "get_image",
  "arguments": {
    "action": "list_outputs",
    "limit": 10
  }
}
```

**You get back:** The ten newest files, newest first, each with whether it is an image or a video, its folder, size and time. Not the pictures themselves — ask to see one and the agent fetches it.

**You say:** Did that fox render ever come out?

```json theme={null}
{
  "tool": "get_image",
  "arguments": {
    "action": "list_outputs",
    "pattern": "fox",
    "limit": 5
  }
}
```

**You get back:** Only files whose names contain "fox".

**You say:** Show me that one.

```json theme={null}
{
  "tool": "get_image",
  "arguments": {
    "action": "view",
    "asset_id": "asset_01HQ8Z3K7V"
  }
}
```

**You get back:** The image inline, visible to both of you. The asset id comes from the completion message of the run that made it. Images only — for video and audio use `action: "get"`, which saves to disk.

**You say:** Save that render onto my desktop.

```json theme={null}
{
  "tool": "get_image",
  "arguments": {
    "action": "get",
    "filename": "portrait_00042_.png",
    "type": "output",
    "save_dir": "C:/Users/me/Desktop"
  }
}
```

**You get back:** The file copied to that folder, and the path it landed at. Use this rather than `action: "view"` for video and audio, which cannot be shown inline.

**You say:** Why does this render look so washed out?

```json theme={null}
{
  "tool": "get_image",
  "arguments": {
    "action": "analyze_color",
    "filename": "portrait_00042_.png"
  }
}
```

**You get back:** Measured numbers rather than an opinion: black and white points, contrast, saturation, per-channel colour cast and clipping, plus flags like washedOut/liftedBlacks and a one-line verdict. Read-only.

**You say:** Make me a smaller JPEG of that so I can email it.

```json theme={null}
{
  "tool": "get_image",
  "arguments": {
    "action": "convert",
    "path": "portrait_00042_.png",
    "format": "jpeg",
    "quality": 85
  }
}
```

**You get back:** The re-encoded image inline, with the source and output sizes and how many bytes were saved.

<Warning>Passing `out_path` also WRITES the converted file under the ComfyUI output directory, overwriting whatever is already at that path.</Warning>

**You say:** What have I made recently?

```json theme={null}
{
  "tool": "get_image",
  "arguments": {
    "action": "list_assets",
    "limit": 5
  }
}
```

**You get back:** The five newest registered assets with their asset ids, prompt ids, filenames and when they were made — including renders this session never watched, which are reconciled from ComfyUI's history on the way. Feed an asset id to `action: "view"` to actually see one.

**You say:** What settings produced that image?

```json theme={null}
{
  "tool": "get_image",
  "arguments": {
    "action": "asset_metadata",
    "asset_id": "asset_01HQ8Z3K7V"
  }
}
```

**You get back:** Full provenance for the asset, including the entire workflow that produced it — the prompt, sampler, steps, seed and so on. Read this before generate\_image (action:"regenerate") with overrides.

***

## upload\_image

Put a file where ComfyUI (or cloud storage) can read it. Driven by the `action` parameter:

* action:"image" — Upload a local image file to the connected ComfyUI's input/ directory via the HTTP /upload/image endpoint so it can be referenced in LoadImage nodes. Works for both local and remote ComfyUI. Returns the stored filename.
* action:"video" — Upload a local video file (.mp4, .mov, .webm, .avi, .mkv, .m4v) to the connected ComfyUI's input/ directory via the HTTP /upload/image endpoint for use in video-loading nodes such as VHS\_LoadVideo (ComfyUI-VideoHelperSuite). Works for both local and remote ComfyUI. Returns the stored filename.
* action:"audio" — Upload a local audio file (.wav, .mp3, .flac, .ogg, .m4a, .aac) to the connected ComfyUI's input/ directory via the HTTP /upload/image endpoint for use in audio-conditioned workflows (e.g. LoadAudio). Works for both local and remote ComfyUI. Returns the stored filename.
* action:"stage" — Stage an EXISTING ComfyUI output (or temp/preview) as an INPUT so the next stage's loader (LoadImage / VHS\_LoadVideo / LoadAudio) can read it. This is the CORRECT way to chain a multi-stage pipeline (e.g. Krea2 image → LTX video → WAN extend): it fetches the output's bytes from the server via /view and re-registers them as an input via /upload/image — the same endpoints get\_image and the uploads above use. Because it goes entirely through the server API, it works even when ComfyUI was launched with a CUSTOM input/output directory. Do NOT instead copy the output file or guess a filesystem `input/` path — the server's input dir may be custom and it will reject the file ("Invalid image file"), wasting the render. Pass an existing output reference (\{ filename, subfolder?, type? }); the media kind (image/video/audio) is inferred from the extension unless you set `kind`. Returns the registered input \{ filename, subfolder, type: "input", kind } — drop the returned `filename` straight into the loader's image/video/audio widget.
* action:"output" — Upload a generated ComfyUI output to CLOUD storage (this is the only action that sends bytes off the machine). Source can be asset\_id or a local path under COMFYUI\_PATH/output. Destination can be S3, Azure Blob, HTTP PUT, or HuggingFace via the hf CLI.

<Tip>**In plain terms:** The other direction: putting a file where ComfyUI can read it. A local file goes into ComfyUI's input/ folder (`image`/`video`/`audio`), an existing render is re-registered as an input without touching the disk (`stage` — the correct way to chain one stage into the next), and `output` is the only action that sends anything OFF this machine.</Tip>

### Parameters

<ParamField path="action" type="enum" required>
  What to upload and where. "image"/"video"/"audio" send a LOCAL file (`source_path`) to ComfyUI's input/ directory; "stage" re-registers an EXISTING server-side output (`filename`) as an input; "output" ships a generated output to cloud storage (`destination`).
  Options: `action:"image"`, `action:"video"`, `action:"audio"`, `action:"output"`, `action:"stage"`.
</ParamField>

<ParamField path="source_path" type="string">
  Absolute path to the local file to upload. REQUIRED for actions "image", "video" and "audio".
</ParamField>

<ParamField path="filename" type="string">
  Two meanings, one per action. actions "image"/"video"/"audio" — OPTIONAL override for the filename in ComfyUI's input/ directory (auto-detected from source\_path if omitted). action:"stage" — REQUIRED filename of the EXISTING output/temp asset to re-register (from get\_history or get\_image action:"list\_outputs"), e.g. LTX\_video\_00001.mp4; its destination name override is `as_filename`, not this field.
</ParamField>

<ParamField path="subfolder" type="string">
  action:"stage" — subfolder the source asset currently lives in, if any.
</ParamField>

<ParamField path="type" type="enum">
  action:"stage" — source directory the asset lives in: output (default) or temp (previews).
  Options: `output`, `temp`.
</ParamField>

<ParamField path="kind" type="enum">
  action:"stage" — force the media kind instead of inferring it from the file extension.
  Options: `image`, `video`, `audio`.
</ParamField>

<ParamField path="as_filename" type="string">
  action:"stage" — override the filename it is registered under in the input/ directory (defaults to the source filename).
</ParamField>

<ParamField path="asset_id" type="string">
  action:"output" — registered asset id from a completed job. Provide exactly one of asset\_id or path.
</ParamField>

<ParamField path="path" type="string">
  action:"output" — path to a generated output under COMFYUI\_PATH/output. Provide exactly one of asset\_id or path.
</ParamField>

<ParamField path="destination" type="object">
  action:"output" — REQUIRED. Exactly one upload destination.
</ParamField>

### Examples

**You say:** Use this photo as the starting image.

```json theme={null}
{
  "tool": "upload_image",
  "arguments": {
    "action": "image",
    "source_path": "C:/Users/me/Pictures/cat.png"
  }
}
```

**You get back:** The filename it was stored under in ComfyUI's input/ directory — drop that into a LoadImage node's `image` widget.

**You say:** Now feed that render into the video stage.

```json theme={null}
{
  "tool": "upload_image",
  "arguments": {
    "action": "stage",
    "filename": "portrait_00042_.png"
  }
}
```

**You get back:** The same file registered as an INPUT, with the filename to put in the next stage's loader. Goes through the server API, so it works even when ComfyUI was launched with custom input/output directories — never guess a filesystem `input/` path.

***
