Share the code using which I can install the below dependencies through python embeded…
- User
Share the code using which I can install the below dependencies through python embeded folder of comfyui.
comfyui-frontend-package==1.16.8 comfyui-workflow-templates==0.1.1 torch torchsde torchvision torchaudio numpy>=1.25.0 einops transformers>=4.28.1 tokenizers>=0.13.3 sentencepiece safetensors>=0.4.2 aiohttp>=3.11.8 yarl>=1.18.0 pyyaml Pillow scipy tqdm psutil
#non essential dependencies: kornia>=0.7.1 spandrel soundfile av
- Assistant
To install the specified dependencies using Python embedded within the ComfyUI folder, you typically need to run pip commands using that embedded Python executable.
Assuming your ComfyUI embedded Python folder is something like
ComfyUI/python, and that the Python executable is within it (python.exeon Windows orpythonon Linux/macOS), you can run the following commands from a script or command line:# Navigate to your ComfyUI embedded Python folder cd path/to/ComfyUI/python # On Windows, use python.exe .\python.exe -m pip install --upgrade pip # Install the required dependencies .\python.exe -m pip install comfyui-frontend-package==1.16.8 comfyui-workflow-templates==0.1.1 torch torchsde torchvision torchaudio numpy>=1.25.0 einops transformers>=4.28.1 tokenizers>=0.13.3 sentencepiece safetensors>=0.4.2 aiohttp>=3.11.8 yarl>=1.18.0 pyyaml Pillow scipy tqdm psutil kornia>=0.7.1 spandrel soundfile avIf you want a Python script you can run from within the embedded Python which installs all requirements, here is a script you can run:
import subprocess import sys packages = [ "comfyui-frontend-package==1.16.8", "comfyui-workflow-templates==0.1.1", "torch", "torchsde", "torchvision", "torchaudio", "numpy>=1.25.0", "einops", "transformers>=4.28.1", "tokenizers>=0.13.3", "sentencepiece", "safetensors>=0.4.2", "aiohttp>=3.11.8", "yarl>=1.18.0", "pyyaml", "Pillow", "scipy", "tqdm", "psutil", # non-essential dependencies: "kornia>=0.7.1", "spandrel", "soundfile", "av" ] def install(packages): subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "pip"]) for package in packages: subprocess.check_call([sys.executable, "-m", "pip", "install", package]) if __name__ == "__main__": install(packages)How to use:
- Save this Python script (e.g.,
install_deps.py) inside the ComfyUI embedded python folder. - Run it using the embedded Python executable:
-
On Windows:
python.exe install_deps.py -
On Linux/macOS:
./python install_deps.py
-
This will upgrade pip first and then install all required dependencies.
Notes:
- Sometimes
torchand related packages may require matching CUDA versions and special indexes. If you run into issues, you may want to install torch separately using the official instructions from pytorch.org. - If the embedded Python environment does not have internet access or pip installed, you need to set that up first.
Let me know if you want me to provide a version with special handling for torch or a requirements.txt file!
- Save this Python script (e.g.,
- User
share a py file based on the below dependencies too.
comfyui-frontend-package==1.16.9 comfyui-workflow-templates==0.1.3 torch torchsde torchvision torchaudio numpy>=1.25.0 einops transformers>=4.28.1 tokenizers>=0.13.3 sentencepiece safetensors>=0.4.2 aiohttp>=3.11.8 yarl>=1.18.0 pyyaml Pillow scipy tqdm psutil
#non essential dependencies: kornia>=0.7.1 spandrel soundfile av
- Assistant
Certainly! Here's a Python script (
install_comfyui_deps.py) that you can run within the ComfyUI embedded Python environment to install your specified dependencies, including the updated versions you listed:import subprocess import sys packages = [ "comfyui-frontend-package==1.16.9", "comfyui-workflow-templates==0.1.3", "torch", "torchsde", "torchvision", "torchaudio", "numpy>=1.25.0", "einops", "transformers>=4.28.1", "tokenizers>=0.13.3", "sentencepiece", "safetensors>=0.4.2", "aiohttp>=3.11.8", "yarl>=1.18.0", "pyyaml", "Pillow", "scipy", "tqdm", "psutil", # Non-essential dependencies "kornia>=0.7.1", "spandrel", "soundfile", "av", ] def upgrade_pip(): print("Upgrading pip...") subprocess.check_call([sys.executable, "-m", "pip", "install", "--upgrade", "pip"]) def install_packages(packages): for pkg in packages: print(f"Installing {pkg}...") subprocess.check_call([sys.executable, "-m", "pip", "install", pkg]) def main(): try: upgrade_pip() install_packages(packages) print("All packages installed successfully.") except subprocess.CalledProcessError as e: print(f"Error installing packages: {e}") sys.exit(1) if __name__ == "__main__": main()Usage:
- Save this content into a file named
install_comfyui_deps.pyinside the ComfyUI embedded Python folder. - Open a terminal/command prompt in that folder.
- Run the script using the embedded python executable:
- On Windows:
python.exe install_comfyui_deps.py- On Linux/macOS:
./python install_comfyui_deps.py
Note on
torchand related packages:- PyTorch (
torch,torchvision,torchaudio) can have specific CUDA or CPU-only versions depending on your environment. The above script installs the default version, which usually matches your system. - If you require a specific CUDA version or special repository (like
--extra-index-urlfor NVIDIA), you may need to adjust the script or install those packages manually following PyTorch's official guidance: https://pytorch.org/get-started/locally/
If you'd like, I can help you adapt this script for specific CUDA versions!
- Save this content into a file named
- User
thanks!
- Assistant
You're welcome! If you need any more help, just let me know. Happy coding with ComfyUI! 😊🚀