# Workflow

## Introduction

Currently, the Workflow mainly targets AI image generation. To reduce the learning curve for users, we chose to support ComfyUI's interaction style and be compatible with a large number of ComfyUI custom nodes. In addition, we are also working hard to implement other LLM-related (such as GPT) and tools (such as code block) Widgets.

The usage of Workflow is very similar to ComfyUI. We are compatible with a large number of ComfyUI custom nodes, but we currently do not support users directly downloading and running ComfyUI custom nodes.

<figure><img src="/files/FzfDDQyI1RUQSWj15QQI" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
We currently do not support users directly downloading and running ComfyUI custom nodes. If you really need some certain custom nodes, please contact [us](mailto:hance@myshell.ai), with your reasons, we will evaluate your request and support at our best effort. If the custom nodes you need are not related to AI models but are plugins that optimize the interaction experience or modify the UI, support may not be very timely.
{% endhint %}

## ComfyUI-like Interaction

Compared to the standard ComfyUI, we mainly added the start node and end node. These two nodes are mainly to facilitate packaging the entire workflow into a single node for use by the App Builder. For documentation conciseness, we will not detail the ComfyUI tutorial here, please find ComfyUI tutorials by yourself, there are plenty!

{% hint style="info" %}
If you do not intend to package the workflow into a widget for the App Builder, you can ignore the start and end nodes and edit the image flow in the ComfyUI way.
{% endhint %}

### Importing ComfyUI Workflow (beta)

<figure><img src="/files/5Cx1riNC6gddVHeKSZxD" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
Currently, we only support ComfyUI workflows exported in JSON format.
{% endhint %}

After importing, some ComfyUI nodes may not be supported.

<figure><img src="/files/aVHliLHAU3XCcWmLKIjW" alt="" width="375"><figcaption></figcaption></figure>

Since these unsupported nodes cannot run when the ShellAgent is deployed to the MyShell main site, we currently do not support one-click download of missing nodes, but will be supported soon.

We suggest:

1. Replace the node with another node that has the same function (if available).
2. Contact [us](mailto:hance@myshell.ai) to let ShellAgent and MyShell support the node simultaneously. It may take some time, so only do it when such node is very necessary.

For missing Models, you can download them in the Manager. See [#model-and-widget-management](#model-and-widget-management "mention")

## Start Node

<figure><img src="/files/PemUIWCmFK0vgOY8vujM" alt=""><figcaption></figcaption></figure>

The start node includes:

* **Input**: When you want to run the workflow as a single widget, you can specify which variables need to be input when calling the workflow widget through Input. Each input needs to specify its name and type, and you can add descriptions and validation items in more settings.
* **Context**: If there are some primitive variables that are used repeatedly within the workflow, you can choose to collect them all into the context. Each context variable needs to specify its name (including type) and its value.

### Using Input/Context Variables

For example, if you want to support users uploading images in Load Image, you can do this:

* Change the image of the Load Image widget to the widget's input.

<figure><img src="/files/hAyn7f4o88mxDszKErRJ" alt="" width="375"><figcaption></figcaption></figure>

* Connect the image in the start node's Input.

<figure><img src="/files/UDLhMeN0aKdaLbZvanQi" alt="" width="375"><figcaption></figcaption></figure>

Each variable has a type, and currently our variables support six types:

* text
* image
* audio
* video
* text\_file
* file

These types affect what the form item is when users input. For example, **text** is a text input box, and the other five are file uploads (different types support different file extensions and sizes).

{% hint style="info" %}
These variables are essentially treated as strings when associated. **text** is a text string, and the other five are paths to images/videos/files. Therefore, when using them, you need to use Load Image or Text Encode to input them into the image generation model.
{% endhint %}

## End Node

<figure><img src="/files/CY4ZCRAmM0d80BvddC4u" alt="" width="375"><figcaption></figcaption></figure>

The Output of the end node is similar to the Input of the start node, indicating what the final output result of the workflow widget should be.

{% hint style="info" %}
The default type of Output is **unknown**. Because its type depends on the associated input variables, and many input variables are arrays, objects, or other composite types, we cannot represent them well at the moment. When the App Builder calls the output of this Workflow, you need to pay attention to the output of composite types.
{% endhint %}

## Run

<figure><img src="/files/zAKItmIne9LHvHmP2BYN" alt="" width="375"><figcaption></figcaption></figure>

Run the workflow; after filling in the specified parameters, you can execute it.

## Version Management

<figure><img src="/files/Sy6KhsSmDehCQiFK6Unx" alt="" width="369"><figcaption></figcaption></figure>

We also support version management of the workflow. Click **publish** to enter a name to specify the corresponding version. You can return to edit this version later.

## Model and Widget Management

Through **Manager**, you can manage local Models and Widgets.

<figure><img src="/files/wYJBoYNUEY1PNnfqNtGi" alt=""><figcaption></figcaption></figure>

For models not listed in the list, you can customize the installation through **Install from Link** in the upper right corner.

<figure><img src="/files/XDOKb0CxgDl0nwCwuIJ2" alt=""><figcaption></figcaption></figure>

If you already have many downloaded models locally, you can adjust the model location by setting the **settings**.

<figure><img src="/files/PpXFrHFPkfsiKw5tE5mI" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.myshell.ai/create/shellagent-mode/workflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
