The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
Go to file
Matt Miller 84e0692a3d
feat(assets): cursor-based pagination on GET /api/assets (#14014)
* spec(assets): add cursor pagination params to GET /api/assets

Add 'after' query param and 'next_cursor' response field for keyset
pagination. Matches the cloud Go implementation (BE-893) so frontend
sees a unified contract across runtimes. Offset/limit remain as a
deprecated fallback.

* feat(assets): add cursor encode/decode helpers for keyset pagination

Port of cloud common/pagination/cursor.go. Wire format is base64url of
{"s", "v", "id"} JSON; times are Unix microseconds UTC to match
PostgreSQL timestamp precision.

Includes a byte-identity fixture pinned against the cloud Go wire
format so cross-runtime FE pagination can't silently drift.

* feat(assets): thread cursor through schemas, service, and query layer

list_assets_page accepts an opaque 'after' cursor and returns
next_cursor when more pages are available. The query applies a keyset
WHERE clause and a secondary ORDER BY id for deterministic tiebreak.

Cursor sort field is validated against the request sort, and a
last_access_time sort (OSS-only) falls back to offset/limit. Offset is
ignored whenever a cursor is supplied.

* feat(assets): wire cursor pagination through GET /api/assets handler

Adds integration tests for: full cursor walk, invalid-cursor 400,
sort/cursor mismatch 400, cursor-wins-over-offset, absent next_cursor
when no more results, and pagination stability across deletes.

* fix(assets): address cursor-review verified findings

- Mint next_cursor on every cursor-supported sort, not only when 'after'
  was supplied. A first request (no 'after') previously returned
  next_cursor=None, leaving cursor mode unreachable from a clean start.
- Over-fetch limit+1 so an exactly-full terminal page doesn't mint a
  spurious cursor pointing at a phantom next page.
- Map crafted out-of-range microsecond cursors (OverflowError / OSError
  in datetime construction) to 400 INVALID_CURSOR instead of leaking 500.
- Bump MAX_CURSOR_VALUE_LENGTH 256 -> 512 to match the AssetReference
  name column max; without this, a long-named asset minted a cursor the
  same server then refused on the next request. Cross-runtime byte
  identity with cloud is unaffected because no cloud cursor ever carries
  a value > 256 (cloud schema doesn't permit it).
- Return None from _encode_next_cursor when the boundary row carries a
  NULL sort value (e.g. an Asset without size_bytes backfilled), instead
  of silently encoding 0 and mis-positioning the keyset.
- Fix schemas_in.py comment so it matches actual handler behavior
  (last_access_time + 'after' raises 400, does not fall back).
- Add AssetsApiError schema + 400 response to GET /api/assets in
  openapi.yaml so generated clients know the INVALID_CURSOR envelope.
- Extend integration coverage: first-page mint, exact-multiple terminal
  page, cursor walks for created_at/updated_at/size sorts, datetime
  overflow surfaces as 400 not 500.
- Add unit coverage for datetime overflow and 512-char round-trip.

* feat(assets): bind cursor to sort order + Go-compat JSON escaping

Address three needs-judgment items from the cursor-review judge synthesis:

1. Cursor wire format now includes an "o" key carrying the sort
   direction ("asc" / "desc") it was minted under. A request that
   replays the cursor with a flipped `order` parameter is rejected
   with 400 INVALID_CURSOR instead of silently walking the wrong
   direction. Legacy cursors without "o" still decode (the binding
   is best-effort until cloud mirrors the field — follow-up filed
   separately).

2. JSON serialization now escapes `<`, `>`, `&`, U+2028, U+2029
   to mirror Go's default `json.Marshal` behavior. Without this, an
   asset name containing those characters produced different bytes on
   Python vs cloud Go. The escaped form is what both runtimes emit.

3. Add direct query-layer tests for the keyset tiebreaker — the secondary
   ORDER BY id branch was previously unexercised. Two scenarios: all
   rows share a primary sort value, and mixed ties straddle page
   boundaries. Both assert no row is dropped or duplicated across the
   walk.

Wire-format note: Python cursors now differ from current cloud cursors
by exactly the "o" key. Cloud follow-up will bring the two back into
byte alignment.

* fix(assets): address bot review comments

- Soften offset param prose: it's not deprecated, just not preferred for
  sequential walks. Random-access UIs (jump-to-page, item count displays)
  legitimately still want offset, so dropping the 'deprecated' framing
  rather than promoting it to a machine-readable deprecated:true flag.
- Add explicit HTTP status assertions before every json() / next_cursor
  read in test_list_cursor.py so a failing request surfaces as an HTTP
  error instead of a confusing KeyError on a 4xx/5xx body.

* feat(assets): require cursor o field, drop legacy permissive path

Cursor pagination hasn't shipped on either runtime yet — this PR is
still draft and cloud's mirror is just behind it — so there are no
legacy no-o cursors in the wild. Make o mandatory from day one
rather than landing permissive and tightening later.

decode_cursor now rejects any payload without o (or with a non-string
o) as malformed. CursorPayload.order becomes a required str. Tests
that constructed CursorPayload directly now pass order="desc";
test_legacy_cursor_without_order_accepted flips to
test_cursor_without_order_rejected.

* chore(assets): drop cross-repo prose from cursor comments

Strip prose references to sibling Go implementations and external
ticket IDs from cursor.py, the cursor tests, the keyset integration
tests, asset_management's sort-field comment, and the legacy
prompt_id alias comment. Pure docstring/comment scrub — no behavior
or wire-format changes. x-runtime: [cloud] field annotations in
openapi.yaml are unchanged; those are the spec's structural
cross-runtime convention, not internal references.

* test(assets): include 'o' in microsecond-boundary cursor payload

The boundary test was building a cursor without the required `o` key, so
decode failed on the missing-order branch before reaching the µs-overflow
path the test is asserting. Both paths return 400 INVALID_CURSOR so the
assertion passed for the wrong reason. Add `o` to the payload and matching
`order=` to the request so the decode reaches the intended branch.

* fix(assets): address ultrareview findings on cursor pagination

Six fact-checked findings from the multi-model review pass:

- Encoder/decoder length asymmetry: encode_cursor now rejects empty id,
  oversized id (>128), oversized value (>512), and invalid order tokens
  symmetrically with decode_cursor. Prevents the same server from minting
  a cursor it then 400s on the next request (e.g. a filesystem-scanned
  asset name >512 chars). The bad-order path now raises InvalidCursorError
  (still subclasses ValueError) so route-layer handling stays uniform.
- Raw U+2028/U+2029 in cursor.py source: ripgrep treated those lines as
  line-terminators, confirming the bytes were the actual separators. Any
  editor save / autoformat / git tooling that normalizes invisibles would
  silently break the encoder. Replaced with explicit 
 / 

  Python escape sequences.
- set(seen) == set(names) hid ordering regressions: a cursor walk that
  dropped a row at a page boundary or returned duplicates could pass.
  Reworked the assertion to (1) reject duplicates, (2) require full
  coverage, and (3) assert strict positional order for size sort, the
  only field with a clock-independent ordering.
- Flaky time.sleep(0.05) between inserts: Windows CI clock resolution is
  ~15ms, so back-to-back inserts under load could collide and exercise
  the tiebreaker instead of the documented path. Removed the sleep and
  let the strengthened assertion above carry coverage / no-duplicates,
  with size sort carrying strict order.
- Cursor error envelope diverged from the rest of routes.py: cursor 400s
  emitted {error: {code, message}} while every other 400 in the file
  emits {error: {code, message, details}} via _build_error_response.
  Switched to _build_error_response and added the details field to the
  AssetsApiError schema in openapi.yaml.
- "Byte-identity fixtures" only checked substring containment, defeating
  the test class's stated purpose of pinning the wire format. Switched
  to exact-bytes equality against an inline expected payload string per
  fixture, so any whitespace / key-order / escape drift fails loudly.

Also dropped Go / json.Marshal references from docstrings — the byte
format is the contract, not the runtime that mints it.

* fix(assets): cap cursors by encoded wire size, not just char count

Char-count guards on value/id can still let multibyte or escape-heavy
inputs blow past MAX_ENCODED_CURSOR_LENGTH once UTF-8 + escape expansion
+ base64url runs. A 512-character name of 'é' (2 bytes UTF-8) or '<'
(serializes to the 6-byte '<' escape) passes the char check, mints
a ~1500-byte cursor, then 400s when handed back on the next request.

Compute the final encoded form and reject it before returning if it
exceeds the wire cap. Adds regression tests for both inflation paths.

* refactor(assets): extract cursor JSON escaping helper; size wire cap above per-field caps

Addresses review feedback on cursor.py:

- Extract the inline escape chain into _apply_wire_compatible_json_escapes()
  with a comment pinning it to the wire format's escape set, so the parity
  intent is explicit rather than reading as an ad-hoc transform.
- Raise MAX_ENCODED_CURSOR_LENGTH to 8192 (comfortably above the ~5.2KB
  worst-case the per-field caps can produce) and drop the mint-time length
  guard. Encoder/decoder symmetry now holds by construction: the encoder
  can't produce a cursor the decode path rejects, so there is no confusing
  user-visible 'cursor too long' failure at mint time.
- Rewrite the two over-wire-cap tests to assert worst-case multibyte and
  escape-heavy values mint and round-trip, instead of being rejected.

* refactor(assets): drop cross-runtime cursor escaping; cursors are opaque

The custom JSON escaping of <, >, &, U+2028, and U+2029 existed only to
keep the encoded cursor byte-identical with the Cloud implementation of
the same payload format. Cursors are opaque tokens, so byte-level
compatibility across implementations is not needed — plain json.dumps
output is sufficient. Remove the escaping helper and the byte-identity
test fixtures that pinned the wire format; keep round-trip coverage for
the affected characters.

---------

Co-authored-by: guill <jacob.e.segal@gmail.com>
2026-06-09 21:14:03 -07:00
.ci Use windows line endings for windows portable readmes. (#14334) 2026-06-07 23:56:53 -04:00
.github Update line endings check to ignore .ci files. (#14319) 2026-06-06 19:33:03 -07:00
alembic_db chore(assets): drop vestigial tags.tag_type column (#14248) 2026-06-09 21:07:10 -07:00
api_server fix: append directory type annotation to internal files endpoint response (#13078) (#13305) 2026-04-18 23:21:22 -04:00
app feat(assets): cursor-based pagination on GET /api/assets (#14014) 2026-06-09 21:14:03 -07:00
blueprints Add new open-source model and built-in tool blueprints (#13980) 2026-05-25 12:25:16 -07:00
comfy [Trainer/bug] Ensure model is not inference mode (CORE-72) (#13400) 2026-06-09 23:07:47 -04:00
comfy_api feat: add PreviewGaussianSplat + PreviewPointCloud nodes (#14194) 2026-06-05 12:30:58 -07:00
comfy_api_nodes [Partner Nodes] feat: add temperature and top_p to NanoBanan node (#14305) 2026-06-05 11:52:15 -07:00
comfy_config Add new fields to the config types (#8507) 2025-06-18 15:12:29 -04:00
comfy_execution Remove useless annotations imports. (#14105) 2026-05-25 19:23:29 -07:00
comfy_extras [Trainer/bug] Ensure model is not inference mode (CORE-72) (#13400) 2026-06-09 23:07:47 -04:00
custom_nodes Update nodes categories and display names (CORE-89) (#13786) 2026-05-08 01:02:55 -04:00
input LoadLatent and SaveLatent should behave like the LoadImage and SaveImage. 2023-05-18 00:09:12 -04:00
middleware fix: use no-store cache headers to prevent stale frontend chunks (#12911) 2026-03-14 18:25:09 -04:00
models Update MediaPipe nodes to standardize with existing code base (CORE-242) (#14025) 2026-05-21 14:39:30 +08:00
output Initial commit. 2023-01-16 22:37:14 -05:00
script_examples Update comment in api example. (#9708) 2025-09-03 18:43:29 -04:00
tests Multi-threaded load of models from disk (big load time speedups & Offload to disk) (CORE-43,CORE-152,CORE-164,CORE-165,CORE-117) (#13802) 2026-05-20 17:03:58 -07:00
tests-unit feat(assets): cursor-based pagination on GET /api/assets (#14014) 2026-06-09 21:14:03 -07:00
utils Update logging level for invalid version format (#13526) 2026-04-22 20:21:43 -04:00
.coderabbit.yaml chore: tune CodeRabbit config to limit review scope and disable for drafts (#12567) 2026-02-21 18:32:15 -08:00
.gitattributes Add Veo3 video generation node with audio support (#9110) 2025-08-05 01:52:25 -04:00
.gitignore Add deploy environment header (Comfy-Env) to partner node API calls (#13425) 2026-05-04 20:17:56 -07:00
.spectral.yaml Suppress false-positive Spectral lint on WebSocket endpoint (#13842) 2026-05-12 13:14:50 -07:00
alembic.ini Add support for sqlite database (#8444) 2025-06-11 16:43:39 -04:00
CODEOWNERS Repo security stuff. (#14019) 2026-05-20 17:17:55 -07:00
comfyui_version.py ComfyUI v0.24.0 2026-06-03 12:42:13 -04:00
CONTRIBUTING.md Add CONTRIBUTING.md (#3910) 2024-07-01 13:51:00 -04:00
cuda_malloc.py Always enable cuda malloc on cu130 and higher. (#14381) 2026-06-09 21:39:24 -04:00
execution.py Multi-threaded load of models from disk (big load time speedups & Offload to disk) (CORE-43,CORE-152,CORE-164,CORE-165,CORE-117) (#13802) 2026-05-20 17:03:58 -07:00
extra_model_paths.yaml.example Fix a1111 typo in extra_model_paths.yaml (#2720) 2026-05-04 16:01:46 +08:00
folder_paths.py Remove useless annotations imports. (#14105) 2026-05-25 19:23:29 -07:00
hook_breaker_ac10a0.py Prevent custom nodes from hooking certain functions. (#7825) 2025-04-26 20:52:56 -04:00
latent_preview.py Support LTX2 tiny vae (taeltx_2) (#11929) 2026-01-21 23:03:51 -05:00
LICENSE Initial commit. 2023-01-16 22:37:14 -05:00
main.py main/server: Add --debug-hang (#14371) 2026-06-09 09:55:00 -04:00
manager_requirements.txt bump manager version to 4.2.1 (#13516) 2026-04-22 18:12:06 -04:00
node_helpers.py Fix issue blend images with alpha (#13615) 2026-05-03 18:17:08 +08:00
nodes.py Depth anything 3 (Core-135) (#13853) 2026-06-10 09:28:24 +08:00
openapi.yaml chore(openapi): sync shared API contract from cloud@ca12913 (#14367) 2026-06-10 09:58:42 +08:00
protocol.py Support for async node functions (#8830) 2025-07-10 14:46:19 -04:00
pyproject.toml ComfyUI v0.24.0 2026-06-03 12:42:13 -04:00
pytest.ini Execution Model Inversion (#2666) 2024-08-15 11:21:11 -04:00
QUANTIZATION.md Update quant doc so it's not completely wrong. (#13381) 2026-04-12 23:27:38 -04:00
README.md fix: correct description of where compiled FE files live (#14013) 2026-05-24 10:48:31 +08:00
requirements.txt chore: update embedded docs to v0.5.3 (#14350) 2026-06-08 22:58:52 +08:00
SECURITY.md Create SECURITY.md. (#13902) 2026-05-14 16:02:22 -07:00
server.py main/server: Add --debug-hang (#14371) 2026-06-09 09:55:00 -04:00

ComfyUI

The most powerful and modular AI engine for content creation.

Website Dynamic JSON Badge Twitter Matrix

ComfyUI Screenshot

ComfyUI is the AI creation engine for visual professionals who demand control over every model, every parameter, and every output. Its powerful and modular node graph interface empowers creatives to generate images, videos, 3D models, audio, and more...

  • ComfyUI natively supports the latest open-source state of the art models.
  • API nodes provide access to the best closed source models such as Nano Banana, Seedance, Hunyuan3D, etc.
  • It is available on Windows, Linux, and macOS, locally with our desktop application, our portable install or on our cloud.
  • The most sophisticated workflows can be exposed through a simple UI thanks to App Mode.
  • It integrates seamlessly into production pipelines with our API endpoints.

Get Started

Local

Desktop Application

  • The easiest way to get started.
  • Available on Windows & macOS.

Windows Portable Package

  • Get the latest commits and completely portable.
  • Available on Windows.

Manual Install

Supports all operating systems and GPU types (NVIDIA, AMD, Intel, Apple Silicon, Ascend).

Cloud

Comfy Cloud

  • Our official paid cloud version for those who can't afford local hardware.

Examples

See what ComfyUI can do with the newer template workflows or old example workflows.

Features

Workflow examples can be found on the Examples page

Release Process

ComfyUI follows a weekly release cycle targeting Monday but this regularly changes because of model releases or large changes to the codebase. There are three interconnected repositories:

  1. ComfyUI Core

    • Releases a new major stable version (e.g., v0.7.0) roughly every 2 weeks.
    • Starting from v0.4.0 patch versions will be used for fixes backported onto the current stable release.
    • Minor versions will be used for releases off the master branch.
    • Patch versions may still be used for releases on the master branch in cases where a backport would not make sense.
    • Commits outside of the stable release tags may be very unstable and break many custom nodes.
    • Serves as the foundation for the desktop release
  2. ComfyUI Desktop

    • Builds a new release using the latest stable core version
  3. ComfyUI Frontend

    • Every 2+ weeks frontend updates are merged into the core repository
    • Features are frozen for the upcoming core release
    • Development continues for the next release cycle

Shortcuts

Keybind Explanation
Ctrl + Enter Queue up current graph for generation
Ctrl + Shift + Enter Queue up current graph as first for generation
Ctrl + Alt + Enter Cancel current generation
Ctrl + Z/Ctrl + Y Undo/Redo
Ctrl + S Save workflow
Ctrl + O Load workflow
Ctrl + A Select all nodes
Alt + C Collapse/uncollapse selected nodes
Ctrl + M Mute/unmute selected nodes
Ctrl + B Bypass selected nodes (acts like the node was removed from the graph and the wires reconnected through)
Delete/Backspace Delete selected nodes
Ctrl + Backspace Delete the current graph
Space Move the canvas around when held and moving the cursor
Ctrl/Shift + Click Add clicked node to selection
Ctrl + C/Ctrl + V Copy and paste selected nodes (without maintaining connections to outputs of unselected nodes)
Ctrl + C/Ctrl + Shift + V Copy and paste selected nodes (maintaining connections from outputs of unselected nodes to inputs of pasted nodes)
Shift + Drag Move multiple selected nodes at the same time
Ctrl + D Load default graph
Alt + + Canvas Zoom in
Alt + - Canvas Zoom out
Ctrl + Shift + LMB + Vertical drag Canvas Zoom in/out
P Pin/Unpin selected nodes
Ctrl + G Group selected nodes
Q Toggle visibility of the queue
H Toggle visibility of history
R Refresh graph
F Show/Hide menu
. Fit view to selection (Whole graph when nothing is selected)
Double-Click LMB Open node quick search palette
Shift + Drag Move multiple wires at once
Ctrl + Alt + LMB Disconnect all wires from clicked slot

Ctrl can also be replaced with Cmd instead for macOS users

Installing

Windows Portable

There is a portable standalone build for Windows that should work for running on Nvidia GPUs or for running on your CPU only on the releases page.

Simply download, extract with 7-Zip or with the windows explorer on recent windows versions and run. For smaller models you normally only need to put the checkpoints (the huge ckpt/safetensors files) in: ComfyUI\models\checkpoints but many of the larger models have multiple files. Make sure to follow the instructions to know which subfolder to put them in ComfyUI\models\

If you have trouble extracting it, right click the file -> properties -> unblock

The portable above currently comes with python 3.13 and pytorch cuda 13.0. Update your Nvidia drivers if it doesn't start.

All Official Portable Downloads:

Portable for AMD GPUs

Portable for Intel GPUs

Portable for Nvidia GPUs (supports 20 series and above).

Portable for Nvidia GPUs with pytorch cuda 12.6 and python 3.12 (Supports Nvidia 10 series and older GPUs).

How do I share models between another UI and ComfyUI?

See the Config file to set the search paths for models. In the standalone windows build you can find this file in the ComfyUI directory. Rename this file to extra_model_paths.yaml and edit it with your favorite text editor.

comfy-cli

You can install and start ComfyUI using comfy-cli:

pip install comfy-cli
comfy install

Manual Install (Windows, Linux)

Python 3.14 works but some custom nodes may have issues. The free threaded variant works but some dependencies will enable the GIL so it's not fully supported.

Python 3.13 is very well supported. If you have trouble with some custom node dependencies on 3.13 you can try 3.12

torch 2.4 and above is supported but some features and optimizations might only work on newer versions. We generally recommend using the latest major version of pytorch with the latest cuda version unless it is less than 2 weeks old.

Instructions:

Git clone this repo.

Put your SD checkpoints (the huge ckpt/safetensors files) in: models/checkpoints

Put your VAE in: models/vae

AMD GPUs (Linux)

AMD users can install rocm and pytorch with pip if you don't have it already installed, this is the command to install the stable version:

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm7.2

This is the command to install the nightly with ROCm 7.2 which might have some performance improvements:

pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm7.2

AMD GPUs (Experimental: Windows and Linux), RDNA 3, 3.5 and 4 only.

These have less hardware support than the builds above but they work on windows. You also need to install the pytorch version specific to your hardware.

RDNA 3 (RX 7000 series):

pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx110X-all/

RDNA 3.5 (Strix halo/Ryzen AI Max+ 365):

pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx1151/

RDNA 4 (RX 9000 series):

pip install --pre torch torchvision torchaudio --index-url https://rocm.nightlies.amd.com/v2/gfx120X-all/

Intel GPUs (Windows and Linux)

Intel Arc GPU users can install native PyTorch with torch.xpu support using pip. More information can be found here

  1. To install PyTorch xpu, use the following command:

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/xpu

This is the command to install the Pytorch xpu nightly which might have some performance improvements:

pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/xpu

NVIDIA

Nvidia users should install stable pytorch using this command:

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130

This is the command to install pytorch nightly instead which might have performance improvements.

pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu132

Troubleshooting

If you get the "Torch not compiled with CUDA enabled" error, uninstall torch with:

pip uninstall torch

And install it again with the command above.

Dependencies

Install the dependencies by opening your terminal inside the ComfyUI folder and:

pip install -r requirements.txt

After this you should have everything installed and can proceed to running ComfyUI.

Others:

Apple Mac silicon

You can install ComfyUI in Apple Mac silicon (M1 or M2) with any recent macOS version.

  1. Install pytorch nightly. For instructions, read the Accelerated PyTorch training on Mac Apple Developer guide (make sure to install the latest pytorch nightly).
  2. Follow the ComfyUI manual installation instructions for Windows and Linux.
  3. Install the ComfyUI dependencies. If you have another Stable Diffusion UI you might be able to reuse the dependencies.
  4. Launch ComfyUI by running python main.py

Note

: Remember to add your models, VAE, LoRAs etc. to the corresponding Comfy folders, as discussed in ComfyUI manual installation.

Ascend NPUs

For models compatible with Ascend Extension for PyTorch (torch_npu). To get started, ensure your environment meets the prerequisites outlined on the installation page. Here's a step-by-step guide tailored to your platform and installation method:

  1. Begin by installing the recommended or newer kernel version for Linux as specified in the Installation page of torch-npu, if necessary.
  2. Proceed with the installation of Ascend Basekit, which includes the driver, firmware, and CANN, following the instructions provided for your specific platform.
  3. Next, install the necessary packages for torch-npu by adhering to the platform-specific instructions on the Installation page.
  4. Finally, adhere to the ComfyUI manual installation guide for Linux. Once all components are installed, you can run ComfyUI as described earlier.

Cambricon MLUs

For models compatible with Cambricon Extension for PyTorch (torch_mlu). Here's a step-by-step guide tailored to your platform and installation method:

  1. Install the Cambricon CNToolkit by adhering to the platform-specific instructions on the Installation
  2. Next, install the PyTorch(torch_mlu) following the instructions on the Installation
  3. Launch ComfyUI by running python main.py

Iluvatar Corex

For models compatible with Iluvatar Extension for PyTorch. Here's a step-by-step guide tailored to your platform and installation method:

  1. Install the Iluvatar Corex Toolkit by adhering to the platform-specific instructions on the Installation
  2. Launch ComfyUI by running python main.py

ComfyUI-Manager

ComfyUI-Manager is an extension that allows you to easily install, update, and manage custom nodes for ComfyUI.

Setup

  1. Install the manager dependencies:

    pip install -r manager_requirements.txt
    
  2. Enable the manager with the --enable-manager flag when running ComfyUI:

    python main.py --enable-manager
    

Command Line Options

Flag Description
--enable-manager Enable ComfyUI-Manager
--enable-manager-legacy-ui Use the legacy manager UI instead of the new UI (requires --enable-manager)
--disable-manager-ui Disable the manager UI and endpoints while keeping background features like security checks and scheduled installation completion (requires --enable-manager)

Running

python main.py

For AMD cards not officially supported by ROCm

Try running it with this command if you have issues:

For 6700, 6600 and maybe other RDNA2 or older: HSA_OVERRIDE_GFX_VERSION=10.3.0 python main.py

For AMD 7600 and maybe other RDNA3 cards: HSA_OVERRIDE_GFX_VERSION=11.0.0 python main.py

AMD ROCm Tips

You can enable experimental memory efficient attention on recent pytorch in ComfyUI on some AMD GPUs using this command, it should already be enabled by default on RDNA3. If this improves speed for you on latest pytorch on your GPU please report it so that I can enable it by default.

TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1 python main.py --use-pytorch-cross-attention

You can also try setting this env variable PYTORCH_TUNABLEOP_ENABLED=1 which might speed things up at the cost of a very slow initial run.

Notes

Only parts of the graph that have an output with all the correct inputs will be executed.

Only parts of the graph that change from each execution to the next will be executed, if you submit the same graph twice only the first will be executed. If you change the last part of the graph only the part you changed and the part that depends on it will be executed.

Dragging a generated png on the webpage or loading one will give you the full workflow including seeds that were used to create it.

You can use () to change emphasis of a word or phrase like: (good code:1.2) or (bad code:0.8). The default emphasis for () is 1.1. To use () characters in your actual prompt escape them like \( or \).

You can use {day|night}, for wildcard/dynamic prompts. With this syntax "{wild|card|test}" will be randomly replaced by either "wild", "card" or "test" by the frontend every time you queue the prompt. To use {} characters in your actual prompt escape them like: \{ or \}.

Dynamic prompts also support C-style comments, like // comment or /* comment */.

To use a textual inversion concepts/embeddings in a text prompt put them in the models/embeddings directory and use them in the CLIPTextEncode node like this (you can omit the .pt extension):

embedding:embedding_filename.pt

How to show high-quality previews?

Use --preview-method auto to enable previews.

The default installation includes a fast latent preview method that's low-resolution. To enable higher-quality previews with TAESD, download the taesd_decoder.pth, taesdxl_decoder.pth, taesd3_decoder.pth and taef1_decoder.pth and place them in the models/vae_approx folder. Once they're installed, restart ComfyUI and launch it with --preview-method taesd to enable high-quality previews.

How to use TLS/SSL?

Generate a self-signed certificate (not appropriate for shared/production use) and key by running the command: openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname"

Use --tls-keyfile key.pem --tls-certfile cert.pem to enable TLS/SSL, the app will now be accessible with https://... instead of http://....

Note: Windows users can use alexisrolland/docker-openssl or one of the 3rd party binary distributions to run the command example above.

If you use a container, note that the volume mount -v can be a relative path so ... -v ".\:/openssl-certs" ... would create the key & cert files in the current directory of your command prompt or powershell terminal.

Support and dev channel

Discord: Try the #help or #feedback channels.

Matrix space: #comfyui_space:matrix.org (it's like discord but open source).

See also: https://www.comfy.org/

psst — we're hiring! Help build ComfyUI: comfy.org/careers

Frontend Development

As of August 15, 2024, we have transitioned to a new frontend, which is now hosted in a separate repository: ComfyUI Frontend. The compiled JS files (from TS/Vue) are published to pypi and installed as a dependency in ComfyUI.

Reporting Issues and Requesting Features

For any bugs, issues, or feature requests related to the frontend, please use the ComfyUI Frontend repository. This will help us manage and address frontend-specific concerns more efficiently.

Using the Latest Frontend

The new frontend is now the default for ComfyUI. However, please note:

  1. The frontend in the main ComfyUI repository is updated fortnightly.
  2. Daily releases are available in the separate frontend repository.

To use the most up-to-date frontend version:

  1. For the latest daily release, launch ComfyUI with this command line argument:

    --front-end-version Comfy-Org/ComfyUI_frontend@latest
    
  2. For a specific version, replace latest with the desired version number:

    --front-end-version Comfy-Org/ComfyUI_frontend@1.2.2
    

This approach allows you to easily switch between the stable fortnightly release and the cutting-edge daily updates, or even specific versions for testing purposes.

Accessing the Legacy Frontend

If you need to use the legacy frontend for any reason, you can access it using the following command line argument:

--front-end-version Comfy-Org/ComfyUI_legacy_frontend@latest

This will use a snapshot of the legacy frontend preserved in the ComfyUI Legacy Frontend repository.

QA

Which GPU should I buy for this?

See this page for some recommendations