mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 02:15:17 +00:00
Give linux some love
This commit is contained in:
parent
ee62b4ecc2
commit
5cf4079923
13
README.md
13
README.md
@ -39,7 +39,7 @@ Workflow examples can be found on the [Examples page](https://comfyanonymous.git
|
|||||||
## Shortcuts
|
## Shortcuts
|
||||||
|
|
||||||
| Keybind | Explanation |
|
| Keybind | Explanation |
|
||||||
| - | - |
|
|---------------------------|--------------------------------------------------------------------------------------------------------------------|
|
||||||
| Ctrl + Enter | Queue up current graph for generation |
|
| Ctrl + Enter | Queue up current graph for generation |
|
||||||
| Ctrl + Shift + Enter | Queue up current graph as first for generation |
|
| Ctrl + Shift + Enter | Queue up current graph as first for generation |
|
||||||
| Ctrl + S | Save workflow |
|
| Ctrl + S | Save workflow |
|
||||||
@ -59,7 +59,7 @@ Workflow examples can be found on the [Examples page](https://comfyanonymous.git
|
|||||||
| R | Refresh graph |
|
| R | Refresh graph |
|
||||||
| Double-Click LMB | Open node quick search palette |
|
| Double-Click LMB | Open node quick search palette |
|
||||||
|
|
||||||
Ctrl can also be replaced with Cmd instead for MacOS users
|
Ctrl can also be replaced with Cmd instead for macOS users
|
||||||
|
|
||||||
# Installing
|
# Installing
|
||||||
|
|
||||||
@ -77,7 +77,8 @@ See the [Config file](extra_model_paths.yaml.example) to set the search paths fo
|
|||||||
|
|
||||||
## Colab Notebook
|
## Colab Notebook
|
||||||
|
|
||||||
To run it on colab or paperspace you can use my [Colab Notebook](notebooks/comfyui_colab.ipynb) here: [Link to open with google colab](https://colab.research.google.com/github/comfyanonymous/ComfyUI/blob/master/notebooks/comfyui_colab.ipynb)
|
To run it on colab or paperspace you can use my [Colab Notebook](notebooks/comfyui_colab.ipynb) here:
|
||||||
|
<a href="https://colab.research.google.com/github/comfyanonymous/ComfyUI/blob/master/notebooks/comfyui_colab.ipynb" target="_blank">Link to open with Google colab</a>
|
||||||
|
|
||||||
## Manual Install (Windows, Linux)
|
## Manual Install (Windows, Linux)
|
||||||
|
|
||||||
@ -125,7 +126,7 @@ Mac/MPS: There is basic support in the code but until someone makes some install
|
|||||||
|
|
||||||
### I already have another UI for Stable Diffusion installed do I really have to install all of these dependencies?
|
### I already have another UI for Stable Diffusion installed do I really have to install all of these dependencies?
|
||||||
|
|
||||||
You don't. If you have another UI installed and working with it's own python venv you can use that venv to run ComfyUI. You can open up your favorite terminal and activate it:
|
You don't. If you have another UI installed and working with its own python venv you can use that venv to run ComfyUI. You can open up your favorite terminal and activate it:
|
||||||
|
|
||||||
```source path_to_other_sd_gui/venv/bin/activate```
|
```source path_to_other_sd_gui/venv/bin/activate```
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ With Powershell: ```"path_to_other_sd_gui\venv\Scripts\Activate.ps1"```
|
|||||||
|
|
||||||
With cmd.exe: ```"path_to_other_sd_gui\venv\Scripts\activate.bat"```
|
With cmd.exe: ```"path_to_other_sd_gui\venv\Scripts\activate.bat"```
|
||||||
|
|
||||||
And then you can use that terminal to run Comfyui without installing any dependencies. Note that the venv folder might be called something else depending on the SD UI.
|
And then you can use that terminal to run ComfyUI without installing any dependencies. Note that the venv folder might be called something else depending on the SD UI.
|
||||||
|
|
||||||
# Running
|
# Running
|
||||||
|
|
||||||
@ -190,7 +191,7 @@ The default installation includes a fast latent preview method that's low-resolu
|
|||||||
|
|
||||||
## Support and dev channel
|
## Support and dev channel
|
||||||
|
|
||||||
[Matrix space: #comfyui_space:matrix.org](https://app.element.io/#/room/%23comfyui_space%3Amatrix.org) (it's like discord but open source).
|
<a href="https://app.element.io/#/room/%23comfyui_space%3Amatrix.org" target="_blank">Matrix space: #comfyui_space:matrix.org</a> (it's like discord but open source).
|
||||||
|
|
||||||
# QA
|
# QA
|
||||||
|
|
||||||
|
12
main.py
12
main.py
@ -37,9 +37,11 @@ def prompt_worker(q, server):
|
|||||||
e.execute(item[2], item[1], item[3], item[4])
|
e.execute(item[2], item[1], item[3], item[4])
|
||||||
q.task_done(item_id, e.outputs_ui)
|
q.task_done(item_id, e.outputs_ui)
|
||||||
|
|
||||||
|
|
||||||
async def run(server, address='', port=8188, verbose=True, call_on_start=None):
|
async def run(server, address='', port=8188, verbose=True, call_on_start=None):
|
||||||
await asyncio.gather(server.start(address, port, verbose, call_on_start), server.publish_loop())
|
await asyncio.gather(server.start(address, port, verbose, call_on_start), server.publish_loop())
|
||||||
|
|
||||||
|
|
||||||
def hijack_progress(server):
|
def hijack_progress(server):
|
||||||
def hook(value, total, preview_image_bytes):
|
def hook(value, total, preview_image_bytes):
|
||||||
server.send_sync("progress", {"value": value, "max": total}, server.client_id)
|
server.send_sync("progress", {"value": value, "max": total}, server.client_id)
|
||||||
@ -47,11 +49,13 @@ def hijack_progress(server):
|
|||||||
server.send_sync(BinaryEventTypes.PREVIEW_IMAGE, preview_image_bytes, server.client_id)
|
server.send_sync(BinaryEventTypes.PREVIEW_IMAGE, preview_image_bytes, server.client_id)
|
||||||
comfy.utils.set_progress_bar_global_hook(hook)
|
comfy.utils.set_progress_bar_global_hook(hook)
|
||||||
|
|
||||||
|
|
||||||
def cleanup_temp():
|
def cleanup_temp():
|
||||||
temp_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "temp")
|
temp_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "temp")
|
||||||
if os.path.exists(temp_dir):
|
if os.path.exists(temp_dir):
|
||||||
shutil.rmtree(temp_dir, ignore_errors=True)
|
shutil.rmtree(temp_dir, ignore_errors=True)
|
||||||
|
|
||||||
|
|
||||||
def load_extra_path_config(yaml_path):
|
def load_extra_path_config(yaml_path):
|
||||||
with open(yaml_path, 'r') as stream:
|
with open(yaml_path, 'r') as stream:
|
||||||
config = yaml.safe_load(stream)
|
config = yaml.safe_load(stream)
|
||||||
@ -72,6 +76,7 @@ def load_extra_path_config(yaml_path):
|
|||||||
print("Adding extra search path", x, full_path)
|
print("Adding extra search path", x, full_path)
|
||||||
folder_paths.add_model_folder_path(x, full_path)
|
folder_paths.add_model_folder_path(x, full_path)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
cleanup_temp()
|
cleanup_temp()
|
||||||
|
|
||||||
@ -106,15 +111,12 @@ if __name__ == "__main__":
|
|||||||
if args.auto_launch:
|
if args.auto_launch:
|
||||||
def startup_server(address, port):
|
def startup_server(address, port):
|
||||||
import webbrowser
|
import webbrowser
|
||||||
webbrowser.open("http://{}:{}".format(address, port))
|
webbrowser.open(f"http://{address}:{port}")
|
||||||
call_on_start = startup_server
|
call_on_start = startup_server
|
||||||
|
|
||||||
if os.name == "nt":
|
|
||||||
try:
|
try:
|
||||||
loop.run_until_complete(run(server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start))
|
loop.run_until_complete(run(server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start))
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
print("\nStopped server")
|
||||||
else:
|
|
||||||
loop.run_until_complete(run(server, address=args.listen, port=args.port, verbose=not args.dont_print_server, call_on_start=call_on_start))
|
|
||||||
|
|
||||||
cleanup_temp()
|
cleanup_temp()
|
||||||
|
Loading…
Reference in New Issue
Block a user