From 0b28914eef0c3d6874fd43db3774b2425c1c4c29 Mon Sep 17 00:00:00 2001 From: Robin Huang Date: Fri, 15 Nov 2024 14:12:43 -0800 Subject: [PATCH] Improve descriptions for electron app structure. --- README.md | 68 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index f45554ec..aacd01ed 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) @@ -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` @@ -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: @@ -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: @@ -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:`: @@ -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" -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 @@ -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: +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