Skip to content

Instantly share code, notes, and snippets.

@sansmoraxz
Last active August 19, 2024 03:50
Show Gist options
  • Save sansmoraxz/51672049e8d2dfaecc7102dbb63d58de to your computer and use it in GitHub Desktop.
Save sansmoraxz/51672049e8d2dfaecc7102dbb63d58de to your computer and use it in GitHub Desktop.
Conda environment for comfyui
# tkdr; this requires specific versions of c++ and cuda to work. just follow the links and run the required commands in CMD
# Install Visual studio 2022
# with "MSVC 143 - VS 2022 x64/x86 build tools (v14.39-17.9)" "Windows 11 SDK (10.0.22621.0)"
# Download CUDA 12.1 from https://developer.nvidia.com/cuda-12-1-0-download-archive
# Some pip dependencies will be built at runtime, so make sure you have the right compilers installed
# To activate build compilers, run the next lines in CMD changing "Community" to whatever visual studio distribution you are using
# CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" -vcvars_ver=14.39 10.0.22621.0
# SET CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1
# SET CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1
# SET PATH=%CUDA_PATH%\bin;%CUDA_PATH%\libnvvp;%PATH%
# SET DISTUTILS_USE_SDK=1
# This is optional
# To target specific cuda compiler you may use
# set the environment variable `TORCH_CUDA_ARCH_LIST`
# I recoment populating value from below command
# So that any custom builds happen below command
# > nvidia-smi --query-gpu=compute_cap --format=csv,noheader
# so that you use your installed GPU capacity rather than a wide range of distributions
# Downlod this file as comfyui-env.yml and run the next command in the same directory
# conda env create -f comfyui-env.yml
name: comfyui
channels:
- pytorch
- nvidia
- conda-forge
- defaults
dependencies:
- python=3.11
- typer
- ninja
- pip
- accelerate
- segment-anything
- svglib
- fvcore
- ffmpeg
- omegaconf
- libuv>=1.40.0,<2.0a0
- anthropic
- openai
- ftfy
- addict
- fastapi
- sqlalchemy
- numpy
- cachetools
- pynvml
- opencv>=4.7.0.72
- scikit-image
- scikit-learn
- albumentations
- websockets
- yacs
- py-cpuinfo
- piexif
- yapf
- yourdfpy
- cuda-version=12.1
- zipp
- pygit2
- pygithub
- pygltflib
- imageio
- imageio-ffmpeg
- matplotlib
- python-multipart
- gradio
- rich
- 7zip
- plyfile
- certifi
- pytorch
- torchvision
- torchaudio
- pytorch-cuda=12.1
- pyhocon
- onednn
- sccache
- onnxruntime
- trampoline
- diffusers>=0.26.1
- psutil
- einops
- transformers>=4.36.2
- tokenizers
- safetensors
- pytorch-lightning
# higher versions does not work with cuda 12.1
- vs2022_win-64=19.39.33519
- pillow
- deepdiff
- scipy
- tqdm
- kornia
- pysoundfile
- gitpython
- pygithub
- huggingface_hub
- matrix_client
- typing-extensions
- colour-science
- rembg
- torchmetrics
- pytorch-msssim
- jaxtyping
- pymcubes
- packaging
- pyyaml
- send2trash
- simpleeval
- sentencepiece
- iopath
- ultralytics
- tensorboard
- cupy
- cmake
- pip:
# torchsde is only ssupported upto 3.8 in conda-forge
- torchsde
- kiui
- spandrel
- clip-interrogator
- bitsandbytes>=0.43.0
- mediapipe
- pixeloe
- transparent-background
- torchtyping
- xformers
- trimesh[easy]
# cuda dependencies
- tensorrt
- pymeshlab
- nerfacc>=0.5.3
- slangtorch
- open-clip-torch
- xatlas
# extra unstable dependencies
# the original version was bugged. made some changes to fix the issue
# or download prebuilt from https://github.com/sansmoraxz/pointnet2_ops/releases/tag/rtx3060-comp
# and update this to point to that wheel file
- git+https://github.com/sansmoraxz/pointnet2_ops.git@rtx3060-comp
- git+https://github.com/graphdeco-inria/diff-gaussian-rasterization@59f5f77e3ddbac3ed9db93ec2cfe99ed6c5d121d
- git+https://github.com/NVlabs/[email protected]
- git+https://github.com/facebookresearch/[email protected]
- git+https://github.com/rusty1s/[email protected]
# Following environment variables will be automatically set when you activate the environment
variables:
CUDA_VERSION: "12.1"
# As listed above you may also enable the value here
# TORCH_CUDA_ARCH_LIST: "8.6"
CUDA_PATH: "C:\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.1"
CUDA_HOME: "C:\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.1"
DISTUTILS_USE_SDK: "1"
# conda activate comfyui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment