---
url: 'https://docs.flimra.ai/agents/comfyui.md'
description: >-
  Keep a ComfyUI graph as a workflow of your Flimra project, feed it the
  project's media and prompts, and use Flimra's models in it with your credits.
---

# ComfyUI graphs as workflows

Build a graph in ComfyUI, with your own local models or Flimra's models paid by your credits, and keep it as a workflow of the project. Anyone in the project can then run it like Flimra's built-in Image and Video workflows: the same inputs, runs that record what they were made from, and results as versions in the library.

::: info
ComfyUI support is switched off in the current release of Flimra. While it is off, the **ComfyUI** button, **Open in ComfyUI** and **New ComfyUI gen** do not appear, and the ComfyUI chat tools are not offered to the chat or over MCP. This page describes how it works when it is on.
:::

## What you need

* ComfyUI on the same Mac, with the Flimra nodes installed in its custom nodes and ComfyUI restarted.
* Flimra open with a project. The nodes talk to it.

The nodes hand files over on this Mac, so a ComfyUI running on another machine cannot use them.

## The Flimra nodes

| Node | What it does |
|---|---|
| **Flimra Input** | A picture, clip or sound of the project, by its reference (`med012`, `gen004`, `gen004.v02`, `bin005`). Its title is the input's name in Flimra. |
| **Flimra Prompt** | The gen's prompt. Flimra writes it in when it runs the graph. |
| **Flimra Context** | Words from the project: the film's look, or a bin's `description` property. |
| **Flimra Image** | A picture from one of Flimra's image models (GPT Image, Nano Banana, Seedream), paid with your credits. |
| **Flimra Video** | A video from one of Flimra's video models (Seedance, Kling, Veo, Gemini Omni, MiniMax, FLUX), paid with your credits. It can start from a picture or a Flimra Image. |
| **Flimra Output** | Sends what the graph made back to the project, as the results of the run. |

A graph built only from ComfyUI's own nodes and local models costs nothing. Flimra fills in a graph's inputs and prompt. Its other settings, such as a seed or a model's strength, stay the graph's own.

## Steps

1. **Open ComfyUI in Flimra** with **ComfyUI** in the Edit toolbar.
2. **Build the graph** with Flimra Input, Prompt and Output nodes, plus Flimra Image or Video when you want Flimra's models.
3. **Save it** with **Save as workflow ▸ New workflow…**. Its Flimra Input nodes become the workflow's inputs, named by their titles. Saving again makes a new version.
4. **Make a gen from it** with **New gen ▸** and the workflow, or right-click a file and choose **New ComfyUI gen ▸**. It is a gen like any other, with its inputs and its prompt.
5. **Run it.** Paid nodes are priced and confirmed first. Each input is pinned to the exact file it points at now, the graph is queued in ComfyUI, and what reaches its Flimra Output nodes becomes the gen's new versions.
6. **Change it later** with **Open in ComfyUI** on the gen: its graph opens with the gen's inputs and prompt filled in.

## Graphs queued in ComfyUI itself

A graph with Flimra nodes queued straight from ComfyUI first asks in Flimra whether it may use the project (**Allow**, **Allow Until Flimra Quits** or **Refuse**). Once allowed, the run is recorded as a gen "… (from ComfyUI)". Each of its paid Flimra nodes asks in Flimra before spending credits.

## Paying for paid nodes

A run started from Flimra carries the credits you confirmed; a paid job that would go past them is not made, and its node fails with the reason. The price counts each paid node once, at the length and resolution set on the node, so set those on the node itself and feed it one picture at a time.

## From the chat or an assistant

When ComfyUI support is on, the chat and assistants over [MCP](/agents/mcp) have four tools for it: `comfy_status` (is ComfyUI reachable, are the Flimra nodes installed, which workflows the project has), `set_comfy_server` (the ComfyUI address; one that is not on this Mac asks you first), `open_comfy` and `save_comfy_workflow`. A gen of a ComfyUI workflow is made with `new_gen` and run with `run_gen`, like any other.

## When something goes wrong

* **ComfyUI is not running**, or not at the address set: the panel and `comfy_status` say so, and a run stops before anything is spent.
* **The Flimra nodes are not installed**: ComfyUI refuses the graph as an unknown node type.
* **Flimra is closed**: Flimra nodes fail with "Flimra is not answering".
* **You refuse** a graph queued in ComfyUI, or do not answer within 15 minutes: its Flimra nodes fail and nothing of the project is read.
* **The graph fails in ComfyUI**: the run fails with ComfyUI's message. Paid nodes that did run are charged, and their results are kept.

## Related

* [Generate](/generate/)
* [Takes and versions](/generate/takes)
* [The chat](/agents/chat)
* [Drive Flimra over MCP](/agents/mcp)
