-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
comfyui, comfyui-manager: init at 0.20.1 / 4.2.1 #515744
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
caniko
wants to merge
6
commits into
NixOS:master
Choose a base branch
from
caniko:comfyui-0.20.1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8d7dfdf
comfyui: init at 0.20.1
caniko 5e5d5f9
comfyui: bundle ComfyUI-Manager into pythonEnv
caniko 379a014
comfyui: explicitly disable tests for new Python helpers
caniko ae9fb03
comfyui: create custom node runtime directory
caniko a0ba005
comfyui: address review comments
caniko 469943f
comfyui: make manager opt-in
caniko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| { | ||
| lib, | ||
| callPackage, | ||
| fetchFromGitHub, | ||
| makeBinaryWrapper, | ||
| nix-update-script, | ||
| python3Packages, | ||
| withManager ? false, | ||
| }: | ||
|
|
||
| let | ||
| appDependencies = | ||
| ps: | ||
| with ps; | ||
| [ | ||
| aiohttp | ||
| alembic | ||
| av | ||
| blake3 | ||
| comfy-aimdo | ||
| comfy-kitchen | ||
| comfyui-embedded-docs | ||
| comfyui-frontend-package | ||
| comfyui-workflow-templates | ||
| einops | ||
| filelock | ||
| glfw | ||
| kornia | ||
| numpy | ||
| pillow | ||
| psutil | ||
| pydantic | ||
| pydantic-settings | ||
| pyopengl | ||
| pyyaml | ||
| requests | ||
| safetensors | ||
| scipy | ||
| sentencepiece | ||
| simpleeval | ||
| spandrel | ||
| sqlalchemy | ||
| tokenizers | ||
| torch | ||
| torchaudio | ||
| torchsde | ||
| torchvision | ||
| tqdm | ||
| transformers | ||
| yarl | ||
| ] | ||
| ++ lib.optionals withManager [ | ||
| ps.comfyui-manager | ||
| ]; | ||
| pythonEnv = python3Packages.python.withPackages appDependencies; | ||
| in | ||
| python3Packages.buildPythonApplication (finalAttrs: { | ||
| pname = "comfyui"; | ||
| version = "0.20.1"; | ||
|
|
||
| pyproject = false; | ||
|
|
||
| strictDeps = true; | ||
| __structuredAttrs = true; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "Comfy-Org"; | ||
| repo = "ComfyUI"; | ||
| tag = "v${finalAttrs.version}"; | ||
| hash = "sha256-CYrOLwfQvj4024WZ7OlGbJOxyj8qKHuwIfVluNVHIk4="; | ||
| }; | ||
|
|
||
| nativeBuildInputs = [ makeBinaryWrapper ]; | ||
|
|
||
| patches = [ ./use-writable-runtime-paths.patch ]; | ||
|
|
||
| dependencies = appDependencies python3Packages; | ||
|
|
||
| dontBuild = true; | ||
| dontWrapPythonPrograms = true; | ||
|
|
||
| installPhase = '' | ||
| runHook preInstall | ||
|
|
||
| mkdir -p $out/share/comfyui $out/bin | ||
| cp -r . $out/share/comfyui | ||
|
|
||
| makeBinaryWrapper ${lib.getExe pythonEnv} $out/bin/comfyui \ | ||
| --add-flag "$out/share/comfyui/main.py" | ||
|
|
||
| runHook postInstall | ||
| ''; | ||
|
|
||
| doInstallCheck = true; | ||
| installCheckPhase = '' | ||
| runHook preInstallCheck | ||
|
|
||
| "$out"/bin/comfyui --help | ||
| export XDG_DATA_HOME="$(mktemp -d)" | ||
| "$out"/bin/comfyui --cpu --quick-test-for-ci | ||
|
|
||
| runHook postInstallCheck | ||
| ''; | ||
|
|
||
| passthru = { | ||
| inherit pythonEnv; | ||
| updateScript = nix-update-script { }; | ||
| } | ||
| // lib.optionalAttrs (!withManager) { | ||
| tests.withManager = callPackage ./package.nix { | ||
| withManager = true; | ||
| }; | ||
| }; | ||
|
|
||
| meta = { | ||
| description = "Modular diffusion model GUI, API, and backend with graph and nodes interface"; | ||
| homepage = "https://github.com/Comfy-Org/ComfyUI"; | ||
| changelog = "https://github.com/Comfy-Org/ComfyUI/releases/tag/v${finalAttrs.version}"; | ||
| license = lib.licenses.gpl3Only; | ||
| mainProgram = "comfyui"; | ||
| maintainers = with lib.maintainers; [ | ||
| caniko | ||
| jk | ||
| ]; | ||
| platforms = lib.platforms.linux; | ||
| }; | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| diff --git a/comfy/cli_args.py b/comfy/cli_args.py | ||
| index 810c90935..09d5bad61 100644 | ||
| --- a/comfy/cli_args.py | ||
| +++ b/comfy/cli_args.py | ||
| @@ -42,7 +42,9 @@ parser.add_argument("--enable-cors-header", type=str, default=None, metavar="ORI | ||
| parser.add_argument("--enable-cors-header", type=str, default=None, metavar="ORIGIN", nargs="?", const="*", help="Enable CORS (Cross-Origin Resource Sharing) with optional origin or allow all with default '*'.") | ||
| parser.add_argument("--max-upload-size", type=float, default=100, help="Set the maximum upload size in MB.") | ||
|
|
||
| -parser.add_argument("--base-directory", type=str, default=None, help="Set the ComfyUI base directory for models, custom_nodes, input, output, temp, and user directories.") | ||
| +xdg_data_home = os.environ.get("XDG_DATA_HOME") or os.path.expanduser("~/.local/share") | ||
| +comfyui_data_home = os.path.join(xdg_data_home, "comfyui") | ||
| +parser.add_argument("--base-directory", type=str, default=comfyui_data_home, help="Set the ComfyUI base directory for models, custom_nodes, input, output, temp, and user directories.") | ||
| parser.add_argument("--extra-model-paths-config", type=str, default=None, metavar="PATH", nargs='+', action='append', help="Load one or more extra_model_paths.yaml files.") | ||
| parser.add_argument("--output-directory", type=str, default=None, help="Set the ComfyUI output directory. Overrides --base-directory.") | ||
| parser.add_argument("--temp-directory", type=str, default=None, help="Set the ComfyUI temp directory (default is in the ComfyUI directory). Overrides --base-directory.") | ||
| @@ -233,9 +235,7 @@ parser.add_argument( | ||
| help="Set the base URL for the ComfyUI API. (default: https://api.comfy.org)", | ||
| ) | ||
|
|
||
| -database_default_path = os.path.abspath( | ||
| - os.path.join(os.path.dirname(__file__), "..", "user", "comfyui.db") | ||
| -) | ||
| +database_default_path = os.path.join(comfyui_data_home, "user", "comfyui.db") | ||
| parser.add_argument("--database-url", type=str, default=f"sqlite:///{database_default_path}", help="Specify the database URL, e.g. for an in-memory database you can use 'sqlite:///:memory:'.") | ||
| parser.add_argument("--enable-assets", action="store_true", help="Enable the assets system (API routes, database synchronization, and background scanning).") | ||
|
|
||
| diff --git a/folder_paths.py b/folder_paths.py | ||
| index 2a7a7a996..8062cc1b6 100644 | ||
| --- a/folder_paths.py | ||
| +++ b/folder_paths.py | ||
| @@ -40,7 +40,8 @@ folder_names_and_paths["upscale_models"] = ([os.path.join(models_dir, "upscale_ | ||
|
|
||
| folder_names_and_paths["latent_upscale_models"] = ([os.path.join(models_dir, "latent_upscale_models")], supported_pt_extensions) | ||
|
|
||
| -folder_names_and_paths["custom_nodes"] = ([os.path.join(base_path, "custom_nodes")], set()) | ||
| +custom_nodes_directory = os.path.join(base_path, "custom_nodes") | ||
| +folder_names_and_paths["custom_nodes"] = ([custom_nodes_directory], set()) | ||
|
|
||
| folder_names_and_paths["hypernetworks"] = ([os.path.join(models_dir, "hypernetworks")], supported_pt_extensions) | ||
|
|
||
| @@ -101,11 +102,12 @@ def map_legacy(folder_name: str) -> str: | ||
| "clip": "text_encoders"} | ||
| return legacy.get(folder_name, folder_name) | ||
|
|
||
| -if not os.path.exists(input_directory): | ||
| - try: | ||
| - os.makedirs(input_directory) | ||
| - except: | ||
| - logging.error("Failed to create input directory") | ||
| +for default_directory in (input_directory, custom_nodes_directory): | ||
| + if not os.path.exists(default_directory): | ||
| + try: | ||
| + os.makedirs(default_directory) | ||
| + except: | ||
| + logging.error(f"Failed to create {default_directory}") | ||
|
|
||
| def set_output_directory(output_dir: str) -> None: | ||
| global output_directory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| lib, | ||
| buildPythonPackage, | ||
| fetchFromGitHub, | ||
| setuptools, | ||
| setuptools-scm, | ||
| }: | ||
|
|
||
| buildPythonPackage (finalAttrs: { | ||
| pname = "comfy-aimdo"; | ||
| version = "0.2.14"; | ||
| pyproject = true; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "Comfy-Org"; | ||
| repo = "comfy-aimdo"; | ||
| tag = "v${finalAttrs.version}"; | ||
| hash = "sha256-jmBVUwQkd6ceLVx1ZSNiByx1vZF+Al7/jmgz0sy+B/E="; | ||
| }; | ||
|
|
||
| build-system = [ | ||
| setuptools | ||
| setuptools-scm | ||
| ]; | ||
|
|
||
| # Upstream ships no test suite at this tag. | ||
| doCheck = false; | ||
|
|
||
| pythonImportsCheck = [ "comfy_aimdo.control" ]; | ||
|
|
||
| meta = { | ||
| description = "AI model dynamic offloader for ComfyUI"; | ||
| homepage = "https://github.com/Comfy-Org/comfy-aimdo"; | ||
| license = lib.licenses.gpl3Only; | ||
| maintainers = with lib.maintainers; [ caniko ]; | ||
| }; | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| lib, | ||
| buildPythonPackage, | ||
| fetchFromGitHub, | ||
| nanobind, | ||
| setuptools, | ||
| torch, | ||
| }: | ||
|
|
||
| buildPythonPackage (finalAttrs: { | ||
| pname = "comfy-kitchen"; | ||
| version = "0.2.8"; | ||
| pyproject = true; | ||
|
|
||
| src = fetchFromGitHub { | ||
| owner = "Comfy-Org"; | ||
| repo = "comfy-kitchen"; | ||
| tag = "v${finalAttrs.version}"; | ||
| hash = "sha256-u83fTb65wALGzgBZO53UJMEFSm1w727IBhiS5XVEoc4="; | ||
| }; | ||
|
|
||
| build-system = [ | ||
| nanobind | ||
| setuptools | ||
| ]; | ||
|
|
||
| dependencies = [ torch ]; | ||
|
|
||
| postPatch = '' | ||
| substituteInPlace setup.py \ | ||
| --replace-fail "BUILD_NO_CUDA = False" "BUILD_NO_CUDA = True" | ||
| ''; | ||
|
|
||
| # Upstream tests exercise the CUDA/Triton kernel backends; this build | ||
| # uses BUILD_NO_CUDA = True so those backends are unavailable and the | ||
| # suite cannot run in the sandbox. | ||
| doCheck = false; | ||
|
|
||
| pythonImportsCheck = [ "comfy_kitchen" ]; | ||
|
|
||
| meta = { | ||
| description = "Fast kernel library for ComfyUI with multiple compute backends"; | ||
| homepage = "https://github.com/Comfy-Org/comfy-kitchen"; | ||
| license = lib.licenses.asl20; | ||
| maintainers = with lib.maintainers; [ caniko ]; | ||
| }; | ||
| }) |
32 changes: 32 additions & 0 deletions
32
pkgs/development/python-modules/comfyui-embedded-docs/default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| lib, | ||
| buildPythonPackage, | ||
| fetchPypi, | ||
| setuptools, | ||
| }: | ||
|
|
||
| buildPythonPackage (finalAttrs: { | ||
| pname = "comfyui-embedded-docs"; | ||
| version = "0.4.4"; | ||
| pyproject = true; | ||
|
|
||
| src = fetchPypi { | ||
| pname = "comfyui_embedded_docs"; | ||
| inherit (finalAttrs) version; | ||
| hash = "sha256-+ZoRloCC+TQtszf8BpFkqN6UT2Op9efoMZ+8TQZhedk="; | ||
| }; | ||
|
|
||
| build-system = [ setuptools ]; | ||
|
|
||
| # Package only ships static Markdown documentation; no tests. | ||
| doCheck = false; | ||
|
|
||
| pythonImportsCheck = [ "comfyui_embedded_docs" ]; | ||
|
|
||
| meta = { | ||
| description = "Embedded node documentation for ComfyUI"; | ||
| homepage = "https://github.com/Comfy-Org/embedded-docs"; | ||
| license = lib.licenses.gpl3Only; | ||
| maintainers = with lib.maintainers; [ caniko ]; | ||
| }; | ||
| }) |
32 changes: 32 additions & 0 deletions
32
pkgs/development/python-modules/comfyui-frontend-package/default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| lib, | ||
| buildPythonPackage, | ||
| fetchPypi, | ||
| setuptools, | ||
| }: | ||
|
|
||
| buildPythonPackage (finalAttrs: { | ||
| pname = "comfyui-frontend-package"; | ||
| version = "1.42.15"; | ||
| pyproject = true; | ||
|
|
||
| src = fetchPypi { | ||
| pname = "comfyui_frontend_package"; | ||
| inherit (finalAttrs) version; | ||
| hash = "sha256-V1j+wiJSMyePkySd0PaNs99XLx3B4zT/tp7uV3AxuBQ="; | ||
| }; | ||
|
|
||
| build-system = [ setuptools ]; | ||
|
|
||
| # Package only ships the prebuilt frontend bundle; no tests. | ||
| doCheck = false; | ||
|
|
||
| pythonImportsCheck = [ "comfyui_frontend_package" ]; | ||
|
|
||
| meta = { | ||
| description = "Frontend assets for ComfyUI"; | ||
| homepage = "https://github.com/Comfy-Org/ComfyUI_frontend"; | ||
| license = lib.licenses.gpl3Only; | ||
| maintainers = with lib.maintainers; [ caniko ]; | ||
| }; | ||
| }) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.