Skip to content

Add multi gpus feature #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nvdamien
Copy link
Contributor

Related to #258

Comfyui-cli uses a config file config.ini to save and check if a Comfyui server was started:

[DEFAULT]
enable_tracking = False
recent_workspace = /home/user/Documents/comfyui/ComfyUI
background = ('127.0.0.1', '8188', 1131305)

A new command line flag ("--name") was added to the "launch" and "stop" command. When "--name" is added, this is adding a new section into the config.ini.

For example:

comfy --launch --name GPU_0 -- --port 8188 --cuda-device 0
comfy --launch --name GPU_1 -- --port 8288 --cuda-device 1

Will give in the config.ini:

[DEFAULT]
enable_tracking = False
recent_workspace = /home/user/Documents/comfyui/ComfyUI

[GPU_0]
background = ('127.0.0.1', '8188', 1131305)

[GPU_1]
background = ('127.0.0.1', '8288', 1132502)

From here, we can stop a server using the same --name flag:

comfy stop --name GPU_0

Will stop the server GPU_0 and remove the session GPU_0 from the config.ini

This feature let us starts multiple servers on the same machine that has multiple GPUs.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 25, 2025
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 38.80597% with 41 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
comfy_cli/config_manager.py 45.00% 22 Missing ⚠️
comfy_cli/command/launch.py 23.07% 10 Missing ⚠️
comfy_cli/cmdline.py 37.50% 5 Missing ⚠️
comfy_cli/command/run.py 20.00% 4 Missing ⚠️
Flag Coverage Δ
unittests 44.66% <38.80%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
comfy_cli/constants.py 100.00% <100.00%> (ø)
comfy_cli/command/run.py 17.22% <20.00%> (+0.06%) ⬆️
comfy_cli/cmdline.py 47.47% <37.50%> (-0.38%) ⬇️
comfy_cli/command/launch.py 17.55% <23.07%> (+0.09%) ⬆️
comfy_cli/config_manager.py 52.22% <45.00%> (-2.58%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant