Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve descriptions for electron app structure. #264

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 36 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,15 @@

# Overview

This electron app is the simplest way to use [ComfyUI](https://github.com/comfyanonymous/ComfyUI) comes bundled with a few things:
This electron app is the simplest way to use [ComfyUI](https://github.com/comfyanonymous/ComfyUI) and comes bundled with a few things:

- [standalone](https://github.com/indygreg/python-build-standalone) python runtime
- comfyui manager [core](https://github.com/Comfy-Org/manager-core)
- [comfy-cli](https://github.com/Comfy-Org/comfy-cli)
- Stable version of ComfyUI from [releases](https://github.com/comfyanonymous/ComfyUI/releases)
- comfyui [manager-core](https://github.com/Comfy-Org/manager-core)
- [uv](https://github.com/astral-sh/uv)

On startup, it will install all the necessary python dependencies and start the server.
On startup, it will install all the necessary python dependencies with uv and start the ComfyUI server. The app will automatically update with stable releases of ComfyUI, ComfyUI-Manager, and the uv executable.

We publish updates in line with the stable releases of ComfyUI.

The app uses our electron update server hosted at https://updater.comfy.org.

## Application Files
## Installed Files

### Electron

Expand All @@ -27,10 +22,10 @@ The desktop application comes bundled with:
- ComfyUI-Manager
- Electron, Chromium binaries, and node modules

These are placed here by the installer:

**Windows**

We use the [NSIS installer](https://www.electron.build/nsis.html) for Windows and it will install files in these locations:

Bundled Resources: `%APPDATA%\Local\Programs\comfyui-electron`

![screenshot of resources directory](https://github.com/user-attachments/assets/0e1d4a9a-7b7e-4536-ad4b-9e6123873706)
Expand All @@ -41,17 +36,21 @@ Automatic Updates: `%APPDATA%\Local\comfyui-electron-updater`

**macOS**

The macOS application is distributed as a [DMG](https://www.electron.build/dmg) and will install files in:

`~/Library/Application Support/ComfyUI`

The application will be dragged into `/Applications`

**Linux**

`~/.config/ComfyUI`

### ComfyUI

You will also be asked to select a location to store ComfyUI files like models, inputs, outputs, custom_nodes and saved workflows.
ComfyUI will also write files to disk as you use it. You will also be asked to select a location to store ComfyUI files like models, inputs, outputs, custom_nodes and saved workflows.

An `extra_model_config.yaml` is created to store the paths to this directory. You can edit it to add additional model paths that you want to use.
An `extra_model_config.yaml` is created to tell ComfyUI where to look for these files. You can edit this file to do things like add additional model files to the search path.

On Windows: `%APPDATA%\Roaming\ComfyUI\extra_model_config.yaml`

Expand All @@ -71,14 +70,14 @@ on Windows: %AppData%\Roaming\{app name}\logs

# Development

## Local Server
## NPM Dependencies

This project uses `yarn` as its package manager. If you do not already have a `yarn` binary available on your PATH, run:

```bash
# corepack is a set of utilities included with all recent distributions of node
corepack enable
yarn set version stable
yarn set version v4.5.0 # Look at the packageManager key in package.json for the exact version.
```

This will install a usable `yarn` binary. Then, in the root directory of this repo (ie adjacent to the top-level package.json file), run:
Expand All @@ -87,9 +86,13 @@ This will install a usable `yarn` binary. Then, in the root directory of this re
yarn install
```

## Setup Python
## ComfyUI Assets

Make sure you have python 3.12+ installed. It is recommended to setup a virtual environment to run the python code.
Before you can start the electron application, you need to download the ComfyUI source code and other things that are usually bundled with the application. We use [comfy-cli](https://github.com/Comfy-Org/comfy-cli) to install everything.

### Setup Python

Make sure you have python 3.12+ installed. It is recommended to setup a virtual environment.

Linux/MacOS:

Expand All @@ -105,15 +108,15 @@ py -3.12 -m venv venv
.\venv\Scripts\Activate.ps1
```

## Setup comfy-cli
### Install comfy-cli

With the python environment activated, install comfy-cli:

```bash
pip install comfy-cli
pip install -U comfy-cli
```

## Building/Running
### ComfyUI and other dependencies

First, initialize the application resources by running `make:assets:<gpu>`:

Expand Down Expand Up @@ -143,15 +146,17 @@ yarn make

# Release

We use Todesktop to build and codesign our releases. To make a new release:
We use Todesktop to build and codesign our distributables. To make a new release:

1. Make a PR titled "v<semantic version>"
2. Add the label "Release" (case sensitive)
3. Merge the PR
4. A build will automatically start and you can view it at https://app.todesktop.com
1. Make a PR with the semantic version. eg. `v1.0.1`
1. Add the label `Release` to the PR.
1. Merge the PR
1. A build will automatically start and you can view it at https://app.todesktop.com

### Publish Locally

Follow the above steps for local development setup first.

```bash
# Authentication will be required.
yarn publish
Expand All @@ -164,16 +169,15 @@ A number of utility scripts are defined under the "scripts" field of package.jso
```bash
yarn clean

# Remove files created by yarn make:assets:<gpu>
yarn:clean:assets

# clean:slate also removes node_modules
yarn clean:slate
```

# Download

## Windows

x64 [Download](https://download.comfy.org/windows/nsis/x64)

## Mac
Windows NSIS x64: [Download](https://download.comfy.org/windows/nsis/x64)

ARM64 [Download]()
macOS ARM
Loading