> ## Documentation Index
> Fetch the complete documentation index at: https://comfyreel.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom workflows

> Run your own ComfyUI workflow behind a ComfyReel feature by titling its nodes.

Each ComfyReel feature runs a built-in workflow. You can add your own ComfyUI workflow to a feature: ComfyReel fills in the prompt, the images and the size, and takes the result from the output node. A workflow for a generation feature (image, video, audio) appears as an extra model in the model list of that node, next to the built-in models; a workflow for a tool (remove background, upscale, erase, multiple angles, expand, split into layers, video upscale, remove object, remove subtitles) runs in place of the tool's built-in one. The tools built on text to image, image edit and image to video (inpaint, relight, panorama, scene presets, character studio, title cards and more) follow your workflow for that feature too.

## Mark the workflow

ComfyReel finds the nodes to fill by their **title**. In ComfyUI, rename the nodes (double-click the title) with `@` marks, then export with **File → Export (API)**.

| Mark | Put it on | Receives |
| - | - | - |
| `@prompt` | a node holding the text in a widget (CLIP Text Encode, a String node…) | the prompt, or the text to read |
| `@size` | a node with `width` and `height` (Empty Latent Image…) | the size; its `batch_size` gets the count when there is no `@count` |
| `@width`, `@height` | an Int node | the size, as an alternative to `@size` |
| `@count` | an Int node, or a node with `batch_size` / `amount` | how many results |
| `@seconds` | an Int or Float node, or a node with `seconds` / `duration` | length in seconds |
| `@frames` | an Int node, or a node with `length` / `frames` / `frame_count` | length in frames |
| `@image`, `@image2` | Load Image | the first and second input image |
| `@last` | Load Image | the last frame |
| `@mask` | Load Image (as Mask); for applying a video edit, Load Video | the area to change, white = change; a mask video for a video edit |
| `@video` | Load Video | the input video |
| `@audio` | Load Audio | the input recording |
| `@lyrics` | a node holding the lyrics in a widget | the lyrics |
| `@pad` | a node with `left`, `top`, `right`, `bottom` (Pad Image for Outpainting…) | the border to add, in pixels |
| `@layers` | an Int node, or a node with `layers` | how many layers |
| `@unet` | the model loader (Load Diffusion Model, Load Checkpoint…) | the LoRAs picked on an image or video node are chained after it; without it they go after the loader at the top of the KSampler model chain |
| `@save` | the output node | needed when the workflow has more than one end node |

Titles are case-insensitive, other words are ignored ("Positive @prompt" works), and one node can carry several marks ("@prompt @size"). Seeds are randomized on every run.

## Features

| Feature | Needs | Optional | Where it appears |
| - | - | - | - |
| Text to image | `@prompt`, `@size` | `@count`, `@unet` | image node model list, for prompts without images |
| Image to image / edit | `@image`, `@prompt` | `@image2`, `@size`, `@count`, `@unet` | image node model list, for connected images |
| Remove background | `@image` | | replaces the tool |
| Upscale | `@image` | | replaces the tool |
| Erase | `@image`, `@mask` | | replaces the tool |
| Multiple angles | `@image`, `@prompt` | | replaces the tool; `@prompt` gets camera words such as `<qma> right side view eye-level shot medium shot` |
| Expand | `@image`, `@pad` | `@prompt`, `@count` | replaces the tool |
| Split into layers | `@image` | `@prompt`, `@layers` | replaces the tool; `@save` gets the layers as one image batch |
| Text to video | `@prompt`, `@size` | `@seconds`, `@unet` | video node model list, text mode |
| Image to video / first and last frame | `@image`, `@prompt` | `@last`, `@size`, `@seconds`, `@unet` | video node model list, image and first/last frame modes |
| Reference to video | `@prompt` | `@image`, `@image2`, `@video`, `@audio`, `@size`, `@seconds`, `@unet` | video node model list, reference modes |
| Video upscale | `@video` | | replaces the tool |
| Remove object | `@video`, `@prompt` | | replaces the tool when the object is named; `@prompt` gets "Remove the cup." |
| Remove subtitles | `@video` | | replaces the tool, in one job on the whole clip, when no text areas are marked by hand |
| Apply an edited frame to the clip | `@video`, `@image`, `@prompt` | `@mask`, `@frames`, `@seconds`, `@size`, `@unet` | replaces the model step of Modify subject and video edit (see below) |
| Music | `@prompt` | `@lyrics`, `@seconds` | audio node model list |
| Sound effect | `@prompt` | `@seconds` | audio node model list |
| Voiceover | `@prompt` | | audio node model list |
| Voice clone | `@audio`, `@prompt` | | audio node model list, with a connected recording |

## Tools that follow a feature

Many tools are built on the image edit, text to image or image to video workflow. When you set a workflow for that feature, they run it too: each tool puts its own instruction text into `@prompt`, its input image into `@image`, a reference into `@image2` and its output size into `@size`, then adds its own steps after `@save`.

| Feature | Tools that follow it |
| - | - |
| Image to image / edit | inpaint, element edit, erase with Qwen or several results, relight, expression grid, product mockup, text edit, panorama from an image, scene presets on an image, the reference frame of a video edit, subject "complete other views", character studio (create from a photo, edit, sheets), opening title card |
| Text to image | panorama from text, scene presets from text, character studio (create from text) |
| Image to video / first and last frame | opening title motion |

Several results come from `@count`, the `batch_size` of `@size`, or a copy of the `@prompt` branch per result. When a tool needs something your workflow lacks, that run uses the built-in workflow instead, for example:

* a fixed output size (panorama, scene presets, character photos) needs `@size`;
* a reference image needs `@image2`, and two or more references always run built in;
* the panorama seam fix needs a KSampler → VAE Decode → `@save` chain;
* the opening title motion needs `@last` when it blends into live footage, and a workflow without `@last` when it starts on the title card alone.

The bottom of the **Custom workflows** dialog lists every tool with the workflow it uses now and the cases that run built in. Extend, reshoot, long video takes, removing a marked subject, subject replace, character switch, video matting, motion capture, audio separation and the 3D Director's render to picture always run their built-in graphs. **Final** runs on the model of the draft's video node, so a draft made with your video workflow is finished with it too.

![The Custom workflows dialog: one row per feature with Built in or an uploaded workflow](https://mintcdn.com/comfyreel/Pmftaa_AWO286WCQ/images/custom-workflows.webp?fit=max\&auto=format\&n=Pmftaa_AWO286WCQ\&q=85\&s=ccd311728bcb43579dac4e1d25f4e075)

### Video edit: your model for applying the edit

The [video edit](https://comfyreel.org/guides/video-tools.md#video-edit) (**Modify subject**, or **Edit video** in the video mode menu) works in two steps: ComfyReel edits the reference frame with the image editor (Image to image / edit, so your edit workflow runs there too), then carries that frame through the clip. Your **Apply an edited frame to the clip** workflow (action `applyEdit`) replaces the model of the second step, in place of the **Fast** and **High quality** engines:

* `@video` gets the source clip and `@image` the edited reference frame (the first frame unless the user picked another);
* `@mask` gets a mask video of the area to change in every frame, white = change, on a Load Video node. A clicked part is tracked; a boxed or brushed area (still camera only) is the area the frame edit changed, with the people in front of it cut out. A whole-clip edit has no area, so a workflow with `@mask` leaves it to the built-in MiniMax H3 route;
* `@prompt` gets what the area looks like after the edit, in English; `@frames` the frame count, `@seconds` the length and `@size` the source size.

Everything around it stays ComfyReel's: the frame edit and its preview, the mask, cutting or padding your result to the clip's frame count, scaling it to the source size, pasting it back through the faded mask and keeping the source sound. `@save` needs a video or images input. It runs in one job on the whole clip.

### A workflow and prompt per tool

Each tool row in **Tools and features** has its own workflow choice. **Follow** keeps the tool on the workflow of its base feature; picking one of your workflows for that feature gives the tool a workflow of its own, which it runs whatever the base feature uses. A tool with its own workflow is checked only against what that tool needs.

**Prompts** opens the instruction texts a tool sends to the model: the scene presets, relight, expressions, product mockup, text edit, panorama, subject views, inpaint and erase. Edit a text and click outside the box to save it; **Reset to built-in** brings back the original. Words in braces, such as `{0}` or `{p}`, are filled in by the tool, so keep them in your version.

## Install it

1. On a canvas, open the logo menu and click **Custom workflows…**.
2. Click the upload button of the feature and pick the exported file. ComfyReel checks the marks and tells you what is missing.
3. For a generation feature, the workflow now shows in the node's model list under its file name ("Your custom workflow"); pick it there like any other model. For a tool, the tool now runs your workflow. Choose **Built in** in the same list to take it out again.

Uploaded workflows are saved with your ComfyReel data. To remove one, pick it and click the bin next to it.

## Let the Agent do it

Ask the ComfyReel Agent to connect a workflow: give it the API-format JSON and say which feature it is for. It reads the rules, titles the nodes, checks the result and installs it with the `custom_workflow` tool. **Copy rules** in the dialog copies the same rules for any other agent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.