comfy-cli 0.0.19__tar.gz → 0.0.20.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/PKG-INFO +49 -6
  2. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/README.md +48 -5
  3. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/cmdline.py +57 -34
  4. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/command/custom_nodes/command.py +202 -86
  5. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/command/install.py +10 -3
  6. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/config_manager.py +59 -3
  7. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/constants.py +3 -0
  8. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/logging.py +1 -1
  9. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/registry/config_parser.py +15 -8
  10. comfy_cli-0.0.20.dev0/comfy_cli/tracking.py +131 -0
  11. comfy_cli-0.0.20.dev0/comfy_cli/update.py +66 -0
  12. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/workspace_manager.py +8 -0
  13. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli.egg-info/PKG-INFO +49 -6
  14. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli.egg-info/SOURCES.txt +1 -0
  15. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/pyproject.toml +1 -1
  16. comfy_cli-0.0.19/comfy_cli/tracking.py +0 -69
  17. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/LICENSE +0 -0
  18. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/__init__.py +0 -0
  19. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/__main__.py +0 -0
  20. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/command/__init__.py +0 -0
  21. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/command/custom_nodes/__init__.py +0 -0
  22. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/command/models/models.py +0 -0
  23. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/command/run.py +0 -0
  24. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/env_checker.py +0 -0
  25. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/registry/__init__.py +0 -0
  26. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/registry/api.py +0 -0
  27. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/registry/types.py +0 -0
  28. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/registry/zip.py +0 -0
  29. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/ui.py +0 -0
  30. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli/utils.py +0 -0
  31. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli.egg-info/dependency_links.txt +0 -0
  32. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli.egg-info/entry_points.txt +0 -0
  33. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli.egg-info/requires.txt +0 -0
  34. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/comfy_cli.egg-info/top_level.txt +0 -0
  35. {comfy_cli-0.0.19 → comfy_cli-0.0.20.dev0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: comfy-cli
3
- Version: 0.0.19
3
+ Version: 0.0.20.dev0
4
4
  Summary: A CLI tool for installing and using ComfyUI.
5
5
  Maintainer-email: Yoland Yan <yoland@drip.art>, James Kwon <hongilkwon316@gmail.com>, Robin Huang <robin@drip.art>, "Dr.Lt.Data" <dr.lt.data@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -714,10 +714,19 @@ comfy-cli is a command line tool that helps users easily install and manage [Com
714
714
 
715
715
  ## Installation
716
716
 
717
- To install comfy-cli, make sure you have Python 3.7 or higher installed on your system. Then, run the following command:
717
+ 1. (Recommended, but not necessary) Enable virtual environment ([venv](https://docs.python.org/3/library/venv.html)/[conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html))
718
718
 
719
- `pip install comfy-cli`
719
+ 2. To install comfy-cli, make sure you have Python 3.9 or higher installed on your system. Then, run the following command:
720
720
 
721
+ `pip install comfy-cli`
722
+
723
+ ### Shell Autocomplete
724
+
725
+ To install autocompletion hints in your shell run:
726
+
727
+ `comfy --install-completion`
728
+
729
+ This enables you to type `comfy [TAP]` to autocomplete commands and options
721
730
 
722
731
  ## Usage
723
732
 
@@ -758,6 +767,16 @@ will simply update the comfy.yaml file to reflect the local setup
758
767
  * You can use the `comfy which` command to check the path of the target workspace.
759
768
  * e.g `comfy --recent which`, `comfy --here which`, `comfy which`, ...
760
769
 
770
+
771
+ ### Default Setup
772
+
773
+ The default sets the option that will be executed by default when no specific workspace's ComfyUI has been set for the command.
774
+
775
+ `comfy set-default <workspace path> ?[--launch-extras="<extra args>"]`
776
+
777
+ - `--launch-extras` option specifies extra args that are applied only during launch by default. However, if extras are specified at the time of launch, this setting is ignored.
778
+
779
+
761
780
  ### Launch ComfyUI
762
781
 
763
782
  Comfy provides commands that allow you to easily run the installed ComfyUI.
@@ -770,6 +789,8 @@ Comfy provides commands that allow you to easily run the installed ComfyUI.
770
789
 
771
790
  `comfy launch -- --cpu --listen 0.0.0.0`
772
791
 
792
+ - When you manually configure the extra options, the extras set by set-default will be overridden.
793
+
773
794
  - To run background
774
795
 
775
796
  `comfy launch --background`
@@ -807,6 +828,18 @@ comfy node [show|simple-show] [installed|enabled|not-installed|disabled|all|snap
807
828
  `comfy node restore-snapshot <snapshot name>`
808
829
 
809
830
 
831
+ - Install dependencies:
832
+
833
+ `comfy node install-deps --deps=<deps .json file>`
834
+
835
+ `comfy node install-deps --workflow=<workflow .json/.png file>`
836
+
837
+
838
+ - Generate deps:
839
+
840
+ `comfy node deps-in-workflow --workflow=<workflow .json/.png file>`
841
+
842
+
810
843
  ### Managing Models
811
844
 
812
845
  - Model downloading
@@ -872,22 +905,32 @@ custom_nodes:
872
905
  ...
873
906
  ```
874
907
 
908
+ ## Analytics
909
+
910
+ We track analytics using Mixpanel to help us understand usage patterns and know where to prioritize our efforts. When you first download the cli, it will ask you to give consent. If at any point you wish to opt out:
911
+
912
+ ```
913
+ comfy tracking disable
914
+ ```
915
+
916
+ Check out the usage here: [Mixpanel Board](https://mixpanel.com/p/13hGfPfEPdRkjPtNaS7BYQ)
917
+
875
918
  ## Contributing
876
919
 
877
920
  We welcome contributions to comfy-cli! If you have any ideas, suggestions, or
878
921
  bug reports, please open an issue on our [GitHub
879
- repository](https://github.com/Comfy-Org/comfy-cli/issues). If you'd like to contribute code,
922
+ repository](https://github.com/yoland68/comfy-cli/issues). If you'd like to contribute code,
880
923
  please fork the repository and submit a pull request.
881
924
 
882
925
  Check out the [Dev Guide](/DEV_README.md) for more details.
883
926
 
884
927
  ## License
885
928
 
886
- comfy is released under the [GNU General Public License v3.0](https://github.com/drip-art/comfy-cli/blob/master/LICENSE).
929
+ comfy is released under the [GNU General Public License v3.0](https://github.com/yoland68/comfy-cli/blob/master/LICENSE).
887
930
 
888
931
  ## Support
889
932
 
890
- If you encounter any issues or have questions about comfy-cli, please [open an issue](https://github.com/comfy-cli/issues) on our GitHub repository. We'll be happy to assist you!
933
+ If you encounter any issues or have questions about comfy-cli, please [open an issue](https://github.com/comfy-cli/issues) on our GitHub repository or contact us on [Discord](https://discord.gg/comfycontrib). We'll be happy to assist you!
891
934
 
892
935
  Happy diffusing with ComfyUI and comfy-cli! 🎉
893
936
 
@@ -13,10 +13,19 @@ comfy-cli is a command line tool that helps users easily install and manage [Com
13
13
 
14
14
  ## Installation
15
15
 
16
- To install comfy-cli, make sure you have Python 3.7 or higher installed on your system. Then, run the following command:
16
+ 1. (Recommended, but not necessary) Enable virtual environment ([venv](https://docs.python.org/3/library/venv.html)/[conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html))
17
17
 
18
- `pip install comfy-cli`
18
+ 2. To install comfy-cli, make sure you have Python 3.9 or higher installed on your system. Then, run the following command:
19
19
 
20
+ `pip install comfy-cli`
21
+
22
+ ### Shell Autocomplete
23
+
24
+ To install autocompletion hints in your shell run:
25
+
26
+ `comfy --install-completion`
27
+
28
+ This enables you to type `comfy [TAP]` to autocomplete commands and options
20
29
 
21
30
  ## Usage
22
31
 
@@ -57,6 +66,16 @@ will simply update the comfy.yaml file to reflect the local setup
57
66
  * You can use the `comfy which` command to check the path of the target workspace.
58
67
  * e.g `comfy --recent which`, `comfy --here which`, `comfy which`, ...
59
68
 
69
+
70
+ ### Default Setup
71
+
72
+ The default sets the option that will be executed by default when no specific workspace's ComfyUI has been set for the command.
73
+
74
+ `comfy set-default <workspace path> ?[--launch-extras="<extra args>"]`
75
+
76
+ - `--launch-extras` option specifies extra args that are applied only during launch by default. However, if extras are specified at the time of launch, this setting is ignored.
77
+
78
+
60
79
  ### Launch ComfyUI
61
80
 
62
81
  Comfy provides commands that allow you to easily run the installed ComfyUI.
@@ -69,6 +88,8 @@ Comfy provides commands that allow you to easily run the installed ComfyUI.
69
88
 
70
89
  `comfy launch -- --cpu --listen 0.0.0.0`
71
90
 
91
+ - When you manually configure the extra options, the extras set by set-default will be overridden.
92
+
72
93
  - To run background
73
94
 
74
95
  `comfy launch --background`
@@ -106,6 +127,18 @@ comfy node [show|simple-show] [installed|enabled|not-installed|disabled|all|snap
106
127
  `comfy node restore-snapshot <snapshot name>`
107
128
 
108
129
 
130
+ - Install dependencies:
131
+
132
+ `comfy node install-deps --deps=<deps .json file>`
133
+
134
+ `comfy node install-deps --workflow=<workflow .json/.png file>`
135
+
136
+
137
+ - Generate deps:
138
+
139
+ `comfy node deps-in-workflow --workflow=<workflow .json/.png file>`
140
+
141
+
109
142
  ### Managing Models
110
143
 
111
144
  - Model downloading
@@ -171,22 +204,32 @@ custom_nodes:
171
204
  ...
172
205
  ```
173
206
 
207
+ ## Analytics
208
+
209
+ We track analytics using Mixpanel to help us understand usage patterns and know where to prioritize our efforts. When you first download the cli, it will ask you to give consent. If at any point you wish to opt out:
210
+
211
+ ```
212
+ comfy tracking disable
213
+ ```
214
+
215
+ Check out the usage here: [Mixpanel Board](https://mixpanel.com/p/13hGfPfEPdRkjPtNaS7BYQ)
216
+
174
217
  ## Contributing
175
218
 
176
219
  We welcome contributions to comfy-cli! If you have any ideas, suggestions, or
177
220
  bug reports, please open an issue on our [GitHub
178
- repository](https://github.com/Comfy-Org/comfy-cli/issues). If you'd like to contribute code,
221
+ repository](https://github.com/yoland68/comfy-cli/issues). If you'd like to contribute code,
179
222
  please fork the repository and submit a pull request.
180
223
 
181
224
  Check out the [Dev Guide](/DEV_README.md) for more details.
182
225
 
183
226
  ## License
184
227
 
185
- comfy is released under the [GNU General Public License v3.0](https://github.com/drip-art/comfy-cli/blob/master/LICENSE).
228
+ comfy is released under the [GNU General Public License v3.0](https://github.com/yoland68/comfy-cli/blob/master/LICENSE).
186
229
 
187
230
  ## Support
188
231
 
189
- If you encounter any issues or have questions about comfy-cli, please [open an issue](https://github.com/comfy-cli/issues) on our GitHub repository. We'll be happy to assist you!
232
+ If you encounter any issues or have questions about comfy-cli, please [open an issue](https://github.com/comfy-cli/issues) on our GitHub repository or contact us on [Discord](https://discord.gg/comfycontrib). We'll be happy to assist you!
190
233
 
191
234
  Happy diffusing with ComfyUI and comfy-cli! 🎉
192
235
 
@@ -16,9 +16,14 @@ from comfy_cli import constants, env_checker, logging, tracking, ui, utils
16
16
  from comfy_cli.command import custom_nodes
17
17
  from comfy_cli.command import install as install_inner
18
18
  from comfy_cli.command.models import models as models_command
19
+ from comfy_cli.update import check_for_updates
19
20
  from comfy_cli.config_manager import ConfigManager
20
21
  from comfy_cli.env_checker import EnvChecker, check_comfy_server_running
21
- from comfy_cli.workspace_manager import WorkspaceManager, check_comfy_repo
22
+ from comfy_cli.workspace_manager import (
23
+ WorkspaceManager,
24
+ check_comfy_repo,
25
+ WorkspaceType,
26
+ )
22
27
 
23
28
  logging.setup_logging()
24
29
  app = typer.Typer()
@@ -151,6 +156,7 @@ def install(
151
156
  Optional[str], typer.Option(help="Specify commit hash for ComfyUI")
152
157
  ] = None,
153
158
  ):
159
+ check_for_updates()
154
160
  checker = EnvChecker()
155
161
 
156
162
  comfy_path = workspace_manager.get_specified_workspace()
@@ -231,31 +237,32 @@ def install(
231
237
  print(f"ComfyUI is installed at: {comfy_path}")
232
238
 
233
239
 
234
- # @app.command(help="Update ComfyUI custom nodes")
235
- # @tracking.track_command()
236
- # def update(target: str = typer.Argument("comfy", help="[all|comfy]")):
237
- # if target not in ["all", "comfy"]:
238
- # typer.echo(
239
- # f"Invalid target: {target}. Allowed targets are 'all', 'comfy'.",
240
- # err=True,
241
- # )
242
- # raise typer.Exit(code=1)
243
-
244
- # comfy_path = workspace_manager.workspace_path
245
-
246
- # if "all" == target:
247
- # custom_nodes.command.execute_cm_cli(["update", "all"])
248
- # else:
249
- # print(f"Updating ComfyUI in {comfy_path}...")
250
- # if comfy_path is None:
251
- # print("ComfyUI path is not found.")
252
- # raise typer.Exit(code=1)
253
- # os.chdir(comfy_path)
254
- # subprocess.run(["git", "pull"], check=True)
255
- # subprocess.run(
256
- # [sys.executable, "-m", "pip", "install", "-r", "requirements.txt"],
257
- # check=True,
258
- # )
240
+ @app.command(help="Update ComfyUI Environment [all|comfy]")
241
+ @tracking.track_command()
242
+ def update(target: str = typer.Argument("comfy", help="[all|comfy]")):
243
+ if target not in ["all", "comfy"]:
244
+ typer.echo(
245
+ f"Invalid target: {target}. Allowed targets are 'all', 'comfy'.",
246
+ err=True,
247
+ )
248
+ raise typer.Exit(code=1)
249
+
250
+ _env_checker = EnvChecker()
251
+ comfy_path = workspace_manager.workspace_path
252
+
253
+ if "all" == target:
254
+ custom_nodes.command.execute_cm_cli(["update", "all"])
255
+ else:
256
+ print(f"Updating ComfyUI in {comfy_path}...")
257
+ if comfy_path is None:
258
+ print("ComfyUI path is not found.")
259
+ raise typer.Exit(code=1)
260
+ os.chdir(comfy_path)
261
+ subprocess.run(["git", "pull"], check=True)
262
+ subprocess.run(
263
+ [sys.executable, "-m", "pip", "install", "-r", "requirements.txt"],
264
+ check=True,
265
+ )
259
266
 
260
267
 
261
268
  # @app.command(help="Run workflow file")
@@ -382,6 +389,7 @@ def launch(
382
389
  ] = False,
383
390
  extra: List[str] = typer.Argument(None),
384
391
  ):
392
+ check_for_updates()
385
393
  resolved_workspace = workspace_manager.workspace_path
386
394
  if not resolved_workspace:
387
395
  print(
@@ -390,6 +398,16 @@ def launch(
390
398
  )
391
399
  raise typer.Exit(code=1)
392
400
 
401
+ if (
402
+ extra is None or len(extra) == 0
403
+ ) and workspace_manager.workspace_type == WorkspaceType.DEFAULT:
404
+ launch_extras = workspace_manager.config_manager.config["DEFAULT"].get(
405
+ constants.CONFIG_KEY_DEFAULT_LAUNCH_EXTRAS, ""
406
+ )
407
+
408
+ if launch_extras != "":
409
+ extra = launch_extras.split(" ")
410
+
393
411
  print(f"\nLaunching ComfyUI from: {resolved_workspace}\n")
394
412
 
395
413
  # Update the recent workspace
@@ -402,24 +420,27 @@ def launch(
402
420
  @app.command("set-default", help="Set default ComfyUI path")
403
421
  @tracking.track_command()
404
422
  def set_default(
405
- # todo: support clear option
406
- # clear: Annotated[bool, typer.Option(help="Clear existing default path")] = False,
407
- workspace_path: Annotated[
408
- str, typer.Argument(help="Path to ComfyUI workspace")
409
- ] = None
423
+ workspace_path: str,
424
+ launch_extras: Annotated[
425
+ str, typer.Option(help="Specify extra options for launch")
426
+ ] = "",
410
427
  ):
411
- comfy_path = os.path.expanduser(workspace_path)
428
+ comfy_path = os.path.abspath(os.path.expanduser(workspace_path))
412
429
 
413
430
  if not os.path.exists(comfy_path):
414
431
  print(f"Path not found: {comfy_path}.")
415
432
  raise typer.Exit(code=1)
416
433
 
417
- if not check_comfy_repo(comfy_path)[0]:
434
+ is_comfy_repo, comfy_repo = check_comfy_repo(comfy_path)
435
+ if not is_comfy_repo:
418
436
  print(f"Specified path is not a ComfyUI path: {comfy_path}.")
419
437
  raise typer.Exit(code=1)
420
438
 
439
+ comfy_path = comfy_repo.working_dir
440
+
421
441
  print(f"Specified path is set as default ComfyUI path: {comfy_path} ")
422
442
  workspace_manager.set_default_workspace(comfy_path)
443
+ workspace_manager.set_default_launch_extras(launch_extras)
423
444
 
424
445
 
425
446
  @app.command(help="Show which ComfyUI is selected.")
@@ -438,6 +459,7 @@ def which():
438
459
  @app.command(help="Print out current environment variables.")
439
460
  @tracking.track_command()
440
461
  def env():
462
+ check_for_updates()
441
463
  _env_checker = EnvChecker()
442
464
  _env_checker.print()
443
465
 
@@ -493,4 +515,5 @@ def feedback():
493
515
 
494
516
  app.add_typer(models_command.app, name="model", help="Manage models.")
495
517
  app.add_typer(custom_nodes.app, name="node", help="Manage custom nodes.")
496
- app.add_typer(custom_nodes.manager_app, name="manager", help="Manager ComfyUI-Manager.")
518
+ app.add_typer(custom_nodes.manager_app, name="manager", help="Manage ComfyUI-Manager.")
519
+ app.add_typer(tracking.app, name="tracking", help="Manage analytics tracking settings.")