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

# Build and edit

Building a ViewComfy app is a simple process and can be done via our online [editor](https://editor.viewcomfy.com/) or locally with our [open source solution](https://github.com/ViewComfy/ViewComfy).

We have two video guides to help people get started:

* [Making your first app](https://youtu.be/Su_rbjodvEI)
* [Using the ViewComfy Utils node pack to build advanced apps](https://youtu.be/kMSHMvVe-W8)

## Building the app

To get started, you need to use the workflow\_api.json file from the workflow you want to turn into an app. There are more details on how to get that file [here](/deployments/create_a_deployment_\(deploy_a_workflow\)).

Once you have the file ready, you just need to drop it in the editor.

<img src="https://mintcdn.com/viewcomfy/KS7pOsPdQMk5_soH/public/viewcomfy_app_editor.webp?fit=max&auto=format&n=KS7pOsPdQMk5_soH&q=85&s=cd579b1514fd0e745764cd254209cd23" alt="ViewComfy app editor" width="1088" height="605" data-path="public/viewcomfy_app_editor.webp" />

After clicking "Save changes", you can add more workflows to the same app by using the "Add Workflow" button.

## Editing the app

<img src="https://mintcdn.com/viewcomfy/KS7pOsPdQMk5_soH/public/viewcomfy_app_editor_2.webp?fit=max&auto=format&n=KS7pOsPdQMk5_soH&q=85&s=fb6085648319121d3a8991699c317336" alt="ViewComfy app editor" width="1235" height="831" data-path="public/viewcomfy_app_editor_2.webp" />

The "App Title" and "App Image URL" allow you to brand your app. Note that you need to provide a URL for the image, meaning it needs to be hosted somewhere.

The "Title" will be the name of your workflow. If you have multiple ones, they will appear in a dropdown at the top.

## Link your App with the ViewComfy Cloud API Endpoint

The "ViewComfy Endpoint" is the API link to your [deployment](/deployments/description). The deployment is where the workflow you used to make the app will run (ei. generate content).

With the latest update of our cloud, you can simply select the name of the deployment you want to use to run your workflow using the dropdown. Alternatively, you can get the endpoint from your workflow dashboard.

<img src="https://mintcdn.com/viewcomfy/KS7pOsPdQMk5_soH/public/viewcomfy_api.webp?fit=max&auto=format&n=KS7pOsPdQMk5_soH&q=85&s=2e1f921a38e0ea8f31c0e08e849889da" alt="ViewComfy API" width="1520" height="111" data-path="public/viewcomfy_api.webp" />

By default, the editor will load all the parameters in the workflow. You can remove parameters by clicking the bin icon next to each of them.

You can also add preview images to show your users the kind of output the app will generate. Again, you will need a URL to add the images.

## Editing inputs

In the app editor, you can delete the parameters you don't want to expose, update default values and control the way your inputs will be displayed.

To update the default value of an input you don't want to expose in the UI, you need to hide it instead of deleting it. Deleting it will revert to the value that was saved in the workflow\_api file you used to create the app.

Using the input menu, you can change the following input properties:

* input name (label)
* input type
* validation values
* default values (in cases where you want to expose the input to the user)
* add help text, tooltip and custom error messages

<img src="https://mintcdn.com/viewcomfy/Dso5PfP1tJNaYW8k/public/input_menu.webp?fit=max&auto=format&n=Dso5PfP1tJNaYW8k&q=85&s=a03805618b0ffd94f20c5e7d4b4d397c" alt="ViewComfy App Editor input menu" width="1003" height="561" data-path="public/input_menu.webp" />

## Using the mask editor

To allow your users to apply a mask on the images they use as input, you need to select the "Image with Mask Editor" input type. This input type behaves the same way as the load image node in ComfyUI.

<img src="https://mintcdn.com/viewcomfy/Dso5PfP1tJNaYW8k/public/mask_editor.webp?fit=max&auto=format&n=Dso5PfP1tJNaYW8k&q=85&s=065489a7b6638b0b650ad357edd19f09" alt="ViewComfy App Mask Editor" width="1081" height="798" data-path="public/mask_editor.webp" />

## managing outputs

Supported output types are rendered by their [mime-type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types/Common_types)

* Image (image/)
* Video (video/)
* Audio (audio/)
* Text (.txt)
* PSD Files (image/vnd.adobe.photoshop)

#### Compare images side by side

You can compare any two images using the compare output feature

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_output_compare.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=947f266c76667c6c01a15f7ba3738759" alt="ViewComfy compare output" width="800" height="250" data-path="public/viewcomfy_output_compare.webp" />

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_compare_images_output.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=b56a2014c930c84d1f35548364d79818" alt="ViewComfy compare images output" width="1488" height="1490" data-path="public/viewcomfy_compare_images_output.webp" />

#### Display text

To display text, you need to save the text in your workflow using the "save text" node from our [utils node pack](/viewcomfy_apps/utils_node_pack) and enable text output in the app editor.

<img src="https://mintcdn.com/viewcomfy/Dso5PfP1tJNaYW8k/public/enable_text_output_checkbox.webp?fit=max&auto=format&n=Dso5PfP1tJNaYW8k&q=85&s=8f2888f989858d55e365901807fa39b5" alt="Enable text output in your apps" width="974" height="126" data-path="public/enable_text_output_checkbox.webp" />

#### Display the name of the output file

You can enable this option to display the file name in the output section of the playground

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_showfilename_output.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=291bd7fc5ecc207cc111d0005988077d" alt="ViewComfy show filename output" width="1186" height="174" data-path="public/viewcomfy_showfilename_output.webp" />

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_showfilename_full_output.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=138679ea6da57453a78bbb70df73fa3e" alt="ViewComfy show filename full output" width="646" height="632" data-path="public/viewcomfy_showfilename_full_output.webp" />

If you surround the file name with `__`, for example: `__text__`, the text between ' \_\_'  will be shown instead.

* In the case of the SaveImage Node, it will automatically add an \_ to the file name, that's why you should only add 1 after the name, like in the picture

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_showfilename_filenameprefix_output.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=6ffce8b29d2c7f6e9b980c6fced2b896" alt="ViewComfy show filename filename prefix output" width="988" height="254" data-path="public/viewcomfy_showfilename_filenameprefix_output.webp" />

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_showfilename_parsed_output.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=d9f8c47bcbf709f15a15359733128943" alt="ViewComfy show filename parsed output" width="596" height="600" data-path="public/viewcomfy_showfilename_parsed_output.webp" />

#### Example creating a PSD file Output

To create a .psd file that ViewComfy can display in the playground page, you need to connect it to a "Show Any" node and make sure that the output has the following shape.

```
{
    "type": "output",
    "filename": "psd_file_name.psd"
}
```

You can find an example workflow\_api.json [here](https://github.com/ViewComfy/cloud-public/tree/main/workflows/psd-file) that uses this feature with the string core nodes.

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_psd.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=fb4043716619a1ea53ae7cfbd80d553b" alt="PSD workflow" width="2678" height="1286" data-path="public/viewcomfy_psd.webp" />

## Editing the app (Advanced)

It is also possible to make more advanced edits to the apps by making changes directly in the view\_comfy.json file. If you use Cursor, you can use our [Cursor Rule](https://github.com/ViewComfy/ViewComfy/blob/main/.cursor/rules/view-comfy-json-rules.mdc) to help you. (We have some examples on how to do that [here](https://www.viewcomfy.com/blog/comfyui-to-web-app-in-less-than-5-minutes)).

### Supported input types

* text
* long-text
* number
* boolean
* video
* image
* audio
* seed => seed, noise\_seed, rand\_seed
* number slider => with min, max and step.
* select => list of options (label and value) e.g:

```json theme={null}
{
    "label": "Depth",
    "value": "Depth"
}
```

#### view\_comfy.json file structure

You can download the view\_comfy.json file from the editor ("Download as ViewComfy JSON").

The section of the json file called "viewComfyJSON" is what defines the UI elements inside the app. More specifically, the "input" and "advancedInputs" sections are the ones that define the parameters.

```json theme={null}
"viewComfyJSON": {
    "title": "Controlnet",
    "description": "",
    "viewcomfyEndpoint": "https://viewcomfy--108-3-td5l2v-comfyui-infer.modal.run",
    "previewImages": [
        null,
        null,
        null
    ],
    "inputs": [
    {
    "title": "Load Image",
    "inputs": [
        {
        "title": "Load Image",
        "placeholder": "Load Image",
        "value": null,
        "workflowPath": [
            "17",
            "inputs",
            "image"
        ],
        "helpText": "Helper Text",
        "valueType": "image",
        "validations": {
            "required": true
        },
        "key": "17-inputs-image"
        }
    ],
    "key": "17-LoadImage"
    },
    {
    "title": "CLIP Text Encode (Positive Prompt)",
    "inputs": [
        {
        "title": "CLIP Text Encode (Positive Prompt)",
        "placeholder": "CLIP Text Encode (Positive Prompt)",
        "value": "A picture of the ViewComfy jersey",
        "workflowPath": [
            "23",
            "inputs",
            "text"
        ],
        "helpText": "Helper Text",
        "valueType": "long-text",
        "validations": {
            "required": true
        },
        "key": "23-inputs-text"
        }
    ],
    "key": "23-CLIPTextEncode"
    }
    ],
    "advancedInputs": [
        {
        "title": "String",
        "inputs": [
            {
            "title": "Value",
            "placeholder": "Value",
            "value": "Depth",
            "workflowPath": [
                "37",
                "inputs",
                "value"
            ],
            "helpText": "Helper Text",
            "valueType": "string",
            "validations": {
                "required": true
            },
            "key": "37-inputs-value"
            }
        ],
        "key": "37-String"
        }
    ],
    "id": "452c9cee8f9128"
}
```

The key things to know are:

* The input name in the UI is the input "title"
* Default values are stored in "value"
* The UI will render the inputs in the same order as in the json
* You can create dropdowns by changing the input type to select and adding a list of labels.

#### Rename parameters

So, for example, you can rename the "CLIP Text Encode (Positive Prompt)" input to "prompt" and remove the default value by changing that input to:

```json theme={null}
{
    "title": "Prompt",
    "placeholder": "Write a prompt",
    "value": "",
    "workflowPath": [
        "23",
        "inputs",
        "text"
    ],
    "helpText": "Helper Text",
    "valueType": "long-text",
    "validations": {
        "required": true
    },
    "key": "23-inputs-text"
}
```

#### Create dropdowns

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_dropdown.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=9347b2564131815ce098eebec20432a9" alt="ViewComfy dropdown input" width="1090" height="322" data-path="public/viewcomfy_dropdown.webp" />

You can create a dropdown for the "String" input where users will be able to select between two types of controlnets by changing the value type for that input to "select", and adding a list of options (the label is what will show in the UI and the value is what will be sent to the node.)

```javascript Dropdown lines theme={null}
{
    "title": "String",
    "inputs": [
        {
        "title": "Value",
        "placeholder": "Value",
        "value": "Depth",
        "workflowPath": [
            "37",
            "inputs",
            "value"
        ],
        "helpText": "Helper Text",
        "valueType": "select",
        "options": [
            {
            "label": "Depth",
            "value": "Depth"
            },
            {
            "label": "Canny",
            "value": "Canny"
            }
        ],
        "validations": {
            "required": true
        },
        "key": "37-inputs-value"
        }
    ],
    "key": "37-String"
}
```

#### Organise parameters

And finally, you can rename that input to "Controlnet type" and bring it to the top (and outside of the advanced input section), so that the viewComfyJSON section of the json ends up looking like this:

```json theme={null}
"viewComfyJSON": {
    "title": "Controlnet",
    "description": "",
    "viewcomfyEndpoint": "https://viewcomfy--1594-1369-mb0g8a-comfyui-infer.modal.run",
    "previewImages": [
        null,
        null,
        null
    ],
    "inputs": [
        {
        "title": "Controlnet type",
        "inputs": [
            {
            "title": "Controlnet type",
            "placeholder": "Controlnet type",
            "value": "Depth",
            "workflowPath": [
                "37",
                "inputs",
                "value"
            ],
            "helpText": "Helper Text",
            "valueType": "select",
            "options": [
                {
                "label": "Depth",
                "value": "Depth"
                },
                {
                "label": "Canny",
                "value": "Canny"
                }
            ],
            "validations": {
                "required": true
            },
            "key": "37-inputs-value"
            }
        ],
        "key": "37-String"
        },
        {
        "title": "Prompt",
        "inputs": [
            {
            "title": "Prompt",
            "placeholder": "Write a prompt",
            "value": "",
            "workflowPath": [
                "23",
                "inputs",
                "text"
            ],
            "helpText": "Helper Text",
            "valueType": "long-text",
            "validations": {
                "required": true
            },
            "key": "23-inputs-text"
            }
        ],
        "key": "23-CLIPTextEncode"
        },
        {
        "title": "Image",
        "inputs": [
            {
            "title": "Image",
            "placeholder": "Image",
            "value": null,
            "workflowPath": [
                "17",
                "inputs",
                "image"
            ],
            "helpText": "Helper Text",
            "valueType": "image",
            "validations": {
                "required": true
            },
            "key": "17-inputs-image"
            }
        ],
        "key": "17-LoadImage"
        }
    ],
    "advancedInputs": [
    ],
    "id": "452c9cee8f9128"
}
```

#### Create sliders

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_slider_input.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=d085e9bf1d43dad9cf94a125df6046b1" alt="ViewComfy slider input" width="1054" height="340" data-path="public/viewcomfy_slider_input.webp" />

You can create a slider by adding a slider object to a parameter with min, max and step.

```json theme={null}
{
            "title": "KSampler",
            "inputs": [
              {
                "title": "Cfg",
                "placeholder": "Cfg",
                "value": 8,
                "workflowPath": [
                  "3",
                  "inputs",
                  "cfg"
                ],
                "helpText": "Helper Text",
                "valueType": "slider",
                "slider": {
                  "min": 1,
                  "max": 10,
                  "step": 1
                },
                "validations": {
                  "required": true
                },
                "key": "3-inputs-cfg"
              }
            ]
}
```

#### Input Tooltips

You can add tooltips beside your input to add helpful information to the user

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_tooltip_input.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=83dac88956de9ff3be745b51f012c827" alt="ViewComfy tooltip input" width="1090" height="354" data-path="public/viewcomfy_tooltip_input.webp" />

You can add a tooltip by adding a `tooltip` key to a parameter and if you want to add a new line you can add the `\n`

```json theme={null}

    {
        "title": "Seed",
        "placeholder": "Seed",
        "value": 40741760227630,
        "workflowPath": [
            "3",
            "inputs",
            "seed"
        ],
        "tooltip": "This is a tooltip\n new line",
        "helpText": "Helper Text",
        "valueType": "seed",
        "validations": {
            "required": true
        },
        "key": "3-inputs-seed"
    },

```

#### Input Help text

You can add a help text below your input to add guidance information to the user

<img src="https://mintcdn.com/viewcomfy/qf8-x9mIjl7Epr_H/public/viewcomfy_helptext_input.webp?fit=max&auto=format&n=qf8-x9mIjl7Epr_H&q=85&s=ae08ee94c60c0bab0861ff3110e72651" alt="ViewComfy helptext input" width="1150" height="254" data-path="public/viewcomfy_helptext_input.webp" />

You can add or modify `helpText` key of a parameter and if you want to add a new line you can add the `\n`

```json theme={null}

    {
        "title": "Seed",
        "placeholder": "Seed",
        "value": 40741760227630,
        "workflowPath": [
            "3",
            "inputs",
            "seed"
        ],
        "helpText": "Helper Text\n new line",
        "valueType": "seed",
        "validations": {
            "required": true
        },
        "key": "3-inputs-seed"
    },

```
