English | 中文说明
Just like ComfyUI official Standalone Portable, but preloaded with numerous custom nodes and Python packages, with all dependencies resolved.
For better compatibility, I made a dedicated package for ComfyUI-3D-Pack:
New releases of this ComfyUI-Windows-Portable
will not include 3D-Pack.
Previous releases will remain unchanged.
-
Pre-installed with 40+ commonly-used custom nodes. [Full List]
-
With all the model files that need to be downloaded on the first run (which may cause freezing for users with a poor Internet connection).
-
-
Includes 240+ mutually compatible Python packages, including:
-
insightface
,dlib
, etc., which require compilation during installation. -
xFormers, which is not included in the ComfyUI official package for an understandable reason. It may not be significant for text-to-image, but could be useful for video workflows.
-
-
Only a few functional models are pre-installed; users please prepare SD models of your favorite.
-
This repo uses the GitHub pipeline for packaging, making it easy for DIY. No need to configure CI/CD, simply fork the repository on GitHub to run the packaging script. See Creating Your Own AIO Package.
-
Only NVIDIA GPUs are supported, preferably with the latest driver installed.
-
Install Git for Windows. The setup will prompt you with several options; it’s fine to use the default settings for all of them.
-
Download the package files from the release page:
-
https://github.com/YanWenKun/ComfyUI-Windows-Portable/releases
-
Note that there are multiple files (
.7z.001
,.7z.002
…) that need to be downloaded. -
Open the
.7z.001
and extract it to a convenient place. If you can’t open 7z files, install 7-zip or PeaZip first.
-
-
Place SD models in
ComfyUI\models\checkpoints
.-
Subdirectories can be created for better organization.
-
-
Edit and run
run_nvidia_gpu.bat
to start ComfyUI.-
If you need to config HTTP proxy, follow the instruction in this file.
-
If you don’t want the browser to open automatically, add
--disable-auto-launch
to the startup arguments. -
If you’re using 40/Ada series or newer GPU, you can try adding
--fast
to the startup arguments. It has magic.
-
-
After starting, the program will automatically open a browser, or you can visit: http://localhost:8188/
-
Change language: Click the gear (⚙) icon at the bottom left corner of the ComfyUI page to modify settings. Find AGL to change the language (default is English, options are {Chinese, Japanese, Korean, Russian}).
-
Take full advantage of ComfyUI-Manager (the Manager button in the top-right corner of the ComfyUI page) to manage custom nodes: install, update, disable, and uninstall.
-
Be cautious when using "Update All"; there’s no need to update unused nodes to avoid Python package conflicts.
-
-
To disable xFormers, add
--use-pytorch-cross-attention
to the ComfyUI startup parameters.-
This will enable the native PyTorch cross-attention. Once enabled, the time, VRAM usage, and image consistency for SD image generation may vary slightly.
-
It is recommended not to disable xFormers if you plan to generate videos.
-
-
For power users, consider using Sandboxie to limit cache files while isolating the environment.
-
For better I/O performance when using Sandboxie, it is recommended to configure the program’s main directory (
ComfyUI_Windows_portable
) as "Open Access" in "Sandbox Options" → "Resource Access".
-
ComfyUI can load model files from directories outside of the main directory. Here’s how to configure it:
-
Rename
extra_model_paths.yaml.example
in theComfyUI
directory to remove the.example
suffix. -
Edit
extra_model_paths.yaml
, where lines starting with#
are comments.
Example file (click to expand)
comfyui: base_path: D:\models\ animatediff_models: animatediff_models animatediff_motion_lora: animatediff_motion_lora bert-base-uncased: bert-base-uncased checkpoints: checkpoints clip: clip clip_vision: clip_vision configs: configs controlnet: controlnet depthfm: depthfm diffusers: diffusers embeddings: embeddings facerestore_models: facerestore_models gligen: gligen grounding-dino: grounding-dino hypernetworks: hypernetworks insightface: insightface ipadapter: ipadapter loras: loras mmdets: mmdets onnx: onnx photomaker: photomaker reactor: reactor sams: sams style_models: style_models ultralytics: ultralytics unet: unet upscale_models: upscale_models vae: vae vae_approx: vae_approx
ComfyUI has three main locations for saving model files:
-
The official
models
directory (and the aforementioned external model directory) -
Model files downloaded locally by each node in
custom_nodes
-
Model files downloaded via
HuggingFace Hub
(the official HF downloader)
By default, HF Hub downloads files to C:\Users\UserName\.cache\huggingface\hub
.
This package modifies this path to
ComfyUI_Windows_portable\HuggingFaceHub
in the startup script for easier file management.
If you have multiple ComfyUI instances and wants to share a common HF Hub model directory, modify the startup script as follows:
set HF_HUB_CACHE=%~dp0\HuggingFaceHub
To something like:
set HF_HUB_CACHE=D:\HuggingFaceHub
This method bypasses ComfyUI-Manager updates and directly replaces the old package with a new version. If done correctly, it avoids installing or upgrading Python packages, thus preventing dependency version conflicts.
-
First, install Git for Windows, and select Git Bash (default).
-
Unzip the new version of pre-built package.
-
Delete the
ComfyUI
andHuggingFaceHub
folders in the new version. -
Copy the two folders from the old version into the new one.
-
In the new main directory, open Git Bash (right-click in an empty area and select "Open Git Bash here").
-
Copy and paste the following command in Git Bash (right-click to paste and hit Enter):
bash force-update-all.sh
-
Refer to the "How to Use" section to edit and run the startup script.
-
If any nodes fail to load, you may need to click "try fix" in ComfyUI-Manager.
If compatibility issues arise, you can try disabling conflicting nodes in ComfyUI-Manager.
This repository utilizes a pipeline to build the package, and the codebase doesn’t contain specific configurations or require additional access permissions. Hence, you can directly fork this repository to start executing the GitHub Workflow.
-
After forking, go to Actions on the page.
-
Locate Build & Upload Package.
-
For example, it looks like this on my repository page.
-
-
Click Run Workflow.
-
Wait about 20~40 minutes until the workflow run complete.
-
If you want to speed up the compression process, edit
stage3.sh
and set the parameters to-mx=3 -mfb=32 -md=4m
. This adjustment will reduce the workflow duration to under 15 minutes, at the cost of a larger file size.
-
-
Go to the releases page of your repository, where you’ll find the newly generated draft for download or publish.
Originally, the code was copied from ComfyUI’s GitHub workflow, but I found it difficult to debug, so I rewrote the script.
However, the packaging concept is similar: providing a self-contained, portable, and fully equipped environment with a pre-installed Python Embedded.
The difference is that I didn’t download wheels first and then install them in bulk like Comfy did. Because dependency relationships are too tricky, I went straight to pip install
for dependency solving.
As a note, a common issue with Python Embedded in such pre-installed packages is that most of the executables in the Scripts
directory cannot run properly. This is because these executables are often Python command wrappers that invoke python.exe
through an absolute path. Once the directory changes (or is relocated), they naturally fail to execute. Fortunately, this does not affect the current project significantly.
Thanks to the ComfyUI GitHub workflow, from which I drew inspiration.