Skip to content

fernicar/ComfyUI_Limited

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComfyUI_Limited: A Lightweight Alternative

Get started with ComfyUI Limited, a stripped-down alternative to run your ComfyUI that meets the minimum requirements for a quick and lightweight graph interface experience. Just like a workflow viewer.

Why Limited Mode?

Using ComfyUI as a workflow viewer can indeed be valuable for various users and developers if it has support for custom nodes. This demo showcase Limited, a lightweight method to run ComfyUI. It's ideal for situations where you need to quickly access the graph interface without the overhead of the full ComfyUI. That said, this demo is capable of loading workflows with custom nodes and without the installation of requirements as fast as possible to restart, same as a workflow viewer. You can modify the script to suit your needs, like letting certain modules to load for dev purposes.

Features

  • Lightweight: ComfyUI Limited requires minimal resources, making it suitable for testing and development environments.
  • Fast: Load the graph interface quickly, without the overhead of the full ComfyUI.
  • Utilizes common practices: ComfyUI Limited uses test-driven development practices to ensure compatibility with your existing ComfyUI setup.
  • Compatibility: ComfyUI Limited do not modify your current ComfyUI setup and updates, including custom nodes updates.

Limitations

  • No image generation: ComfyUI Limited does not support generating images.
  • Limited custom node support: I'm testing a limited list of custom nodes. If you have more installed, they may load, but may not function as expected.
  • Limited error handling: ComfyUI Limited may ignore some error messages, so be aware of this limitation.

Requirements

  • Python 3.x
  • aiohttp
  • git for windows

Installation

Copy limited.py to the root directory of your current ComfyUI installation, next to main.py

Installation from scratch

  1. Lightweight Clone ComfyUI repository and ComfyUI-Manager (recommended):

    git clone --depth 1 --filter=blob:none https://github.com/comfyanonymous/ComfyUI
    cd ComfyUI\custom_nodes
    git clone --depth 1 --filter=blob:none https://github.com/ltdrdata/ComfyUI-Manager
  2. Install the minimum required dependency package in a virtual environment:

    python -s -m pip install aiohttp
  3. Copy limited.py to the root directory of your ComfyUI installation, next to main.py

Usage

Run ComfyUI Limited like this, change port if you want (or make a bat file):

python -s limited.py --cpu --windows-standalone-build --port 8189

Arguments

  • -s: Run python with disable the import of the site module.
  • --cpu: use cpu, not gpu
  • --port: custom port, allow to free standard ComfyUI port 8188.
  • --windows-standalone-build: open the web browser when ready.

Uninstallation

  • Delete limited.py file.
  • Delete limited_modules.log file

Code Overview

whitelist list

Contains the modules this script should not prevent its load.

modules_to_mock list

Contains the blacklist of modules to prevent its load by using a dummy module.

DEBUG variable

Show on console whenever installation of modules gets ignored.

NO_INSTALLS variable

Extra code to prevent installations from custom nodes by alternative methods.

Important Notes

  • ComfyUI Limited is intended for graphical user interface use only, so you won't be able to generate images.
  • ComfyUI Limited now supports dynamically loading custom nodes, provided they aren’t too complex.
  • Keep in mind that ComfyUI Limited is a stripped-down instance of ComfyUI, and all features not related to graph nodes will not be available.

Tested Custom Nodes:

import times for custom nodes when model folder is empty:

tested 2025-01-09

' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\gaussian_blur_ally.py '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rembg-comfyui-node-better '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rembg-comfyui-node '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\modelMergeByKey.py '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Preset_Merger '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUi_NNLatentUpscale '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Florence-2 '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\clipseg.py '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\batchImg-rembg-ComfyUI-nodes '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_ADV_CLIP_emb '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfy-image-saver '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_ImageProcessing '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-BRIA_AI-RMBG '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyLiterals '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\masquerade-nodes-comfyui '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Image-Saver '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_experiments '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-post-processing-nodes '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Subpack '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-inpaint-nodes '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_IPAdapter_plus '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_FaceShaper '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-tooling-nodes '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-control '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_essentials '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-DareMerge '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\efficiency-nodes-comfyui '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\Derfuu_ComfyUI_ModdedNodes '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy '
' 0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-reader-node '
' 0.1 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Crystools '
' 0.1 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Allor '
' 0.1 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\was-node-suite-comfyui '
' 0.1 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_smZNodes '
' 0.1 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Fill-Nodes '
' 0.1 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack '
' 0.2 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_LayerStyle_Advance '
' 0.2 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Easy-Use '
' 0.2 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_LayerStyle '
' 0.2 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Comfyroll_CustomNodes '
' 0.2 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux '
' 0.3 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_tinyterraNodes

Acknowledgments

I would like to thank the original authors of ComfyUI for their work and the contributors to the custom nodes for their contributions to the ComfyUI ecosystem.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

a stripped-down alternative to run your ComfyUI, just like a workflow viewer.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages