Skip to content
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

Package request: comfyui #227006

Open
theoparis opened this issue Apr 19, 2023 · 4 comments · May be fixed by #268378
Open

Package request: comfyui #227006

theoparis opened this issue Apr 19, 2023 · 4 comments · May be fixed by #268378
Labels
0.kind: packaging request Request for a new package to be added

Comments

@theoparis
Copy link
Contributor

Project description

ComfyUI is a node editor for AI models such as stable diffusion. It requires a few python packages that are not currently packaged in nixpkgs. It also would be nice to get #226998 implemented first.

See https://github.com/comfyanonymous/ComfyUI/blob/master/requirements.txt for more information.

Metadata

An example of running comfyui with ipv6 support and without NixOS:

python3 -m pip install -r requirements.txt
python3 main.py --listen :: --cpu # specifies to use only the CPU with pytorch
@theoparis theoparis added the 0.kind: packaging request Request for a new package to be added label Apr 19, 2023
@fazo96 fazo96 linked a pull request Nov 18, 2023 that will close this issue
13 tasks
@nonetrix
Copy link
Contributor

nonetrix commented Jan 18, 2024

This would be great, I am struggling to get ComfyUi to work on NixOS. It doesn't even work in Distrobox I think because the NixOS package is broken, but I haven't verified enough to make a issue but I think it expects a HFS filesystem

@wizardlink
Copy link
Contributor

wizardlink commented Jan 30, 2024

Was meaning to try ComfyUI for a few months now and had this post bookmarked...

@nonetrix if you haven't looked at #268378 I suggest you taking a gander. If you don't know how to use it or don't want to use it that way until it's merged you could just clone ComfyUI and make a flake or a shell there with the packages listed in their README.

Here's a flake example using nix python packages:
{
  inputs = {
    utils.url = "github:numtide/flake-utils";
  };
  outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
    let
      pkgs = nixpkgs.legacyPackages.${system};
    in
    {
      devShell = pkgs.mkShell {
        buildInputs = with pkgs; [
          python311
          python311Packages.accelerate
          python311Packages.torchWithRocm
          python311Packages.torchsde
          python311Packages.torchvision
          python311Packages.torchaudio
          python311Packages.einops
          python311Packages.transformers
          python311Packages.safetensors
          python311Packages.aiohttp
          python311Packages.pyyaml
          python311Packages.pillow
          python311Packages.scipy
          python311Packages.tqdm
          python311Packages.psutil
        ];
      };
    }
  );
}
And here so you can install your packages using pip:
{
  inputs = {
    utils.url = "github:numtide/flake-utils";
  };
  outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system:
    let
      pkgs = nixpkgs.legacyPackages.${system};
    in
    {
      devShell = pkgs.mkShell {
        LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";

        buildInputs = with pkgs; [
          python311
          python311Packages.pip
        ];

        shellHook = ''
          # Tells pip to put packages into $PIP_PREFIX instead of the usual locations.
          # See https://pip.pypa.io/en/stable/user_guide/#environment-variables.
          export PIP_PREFIX=$(pwd)/_build/pip_packages
          export PYTHONPATH="$PIP_PREFIX/${pkgs.python3.sitePackages}:$PYTHONPATH"
          export PATH="$PIP_PREFIX/bin:$PATH"
          unset SOURCE_DATE_EPOCH
        '';
      };
    }
  );
}

@lboklin
Copy link

lboklin commented Apr 11, 2024

See also the flake at https://github.com/BatteredBunny/nix-ai-stuff which has a comfyui package. It just doesn't have custom_nodes.

@lboklin
Copy link

lboklin commented Apr 11, 2024

And here's a fork of https://github.com/nixified-ai/flake with comfyui added: https://github.com/ksenia-portu/flake

Edit: nvm, I don't know why I thought it was packaged. Probably confused with it having an updated InvokeAI version. (But the readme mentions ComfyUI, so I don't know what's with that.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: packaging request Request for a new package to be added
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants