The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Remove omegaconf dependency and some ci changes.
comfyanonymous54dbfaf2ec7f
diff --git a/.ci/setup_windows_zip_nightly_pytorch.ps1 b/.ci/setup_windows_zip_nightly_pytorch.ps1index edc3024ab..6d13bad93 100755--- a/.ci/setup_windows_zip_nightly_pytorch.ps1+++ b/.ci/setup_windows_zip_nightly_pytorch.ps1@@ -5,11 +5,12 @@ cd python_embededAdd-Content -Path .\python310._pth -Value 'import site'Invoke-WebRequest -Uri https://bootstrap.pypa.io/get-pip.py -OutFile get-pip.py.\python.exe get-pip.py-.\python.exe -s -m pip install torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu118 -r ../ComfyUI/requirements.txt pygit2+python -m pip wheel torch torchvision torchaudio --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu118 -r ../ComfyUI/requirements.txt pygit2 -w ../temp_wheel_dir+ls ../temp_wheel_dir+.\python.exe -s -m pip install --pre (get-item ..\temp_wheel_dir\*)"../ComfyUI`n" + (Get-Content .\python310._pth -Raw) | Set-Content .\python310._pthcd ..-mkdir ComfyUI_windows_portablemv python_embeded ComfyUI_windows_portable_nightly_pytorchmv ComfyUI_copy ComfyUI_windows_portable_nightly_pytorch/ComfyUIdiff --git a/.github/workflows/windows_release.yml b/.github/workflows/windows_release.ymlindex a6cb883b7..be48b7eae 100644--- a/.github/workflows/windows_release.yml+++ b/.github/workflows/windows_release.yml@@ -25,10 +25,11 @@ jobs:.\setup_windows_zip.ps1ls- - uses: "marvinpinto/action-automatic-releases@latest"+ - name: Upload binaries to release+ uses: svenstaro/upload-release-action@v2with:- repo_token: "${{ secrets.GITHUB_TOKEN }}"- automatic_release_tag: "latest"- prerelease: true- title: "ComfyUI Standalone Portable Windows Build (For NVIDIA or CPU only)"- files: ComfyUI_windows_portable_nvidia_or_cpu.7z+ repo_token: ${{ secrets.GITHUB_TOKEN }}+ file: ComfyUI_windows_portable_nvidia_or_cpu.7z+ tag: "latest"+ overwrite: true+diff --git a/.github/workflows/windows_release_nightly_pytorch.yml b/.github/workflows/windows_release_nightly_pytorch.ymlindex f958a4ab7..1aeaef45a 100644--- a/.github/workflows/windows_release_nightly_pytorch.yml+++ b/.github/workflows/windows_release_nightly_pytorch.yml@@ -17,7 +17,9 @@ jobs:- uses: actions/checkout@v3with:fetch-depth: 0-+ - uses: actions/setup-python@v4+ with:+ python-version: '3.10.9'- run: |cd ..cp ComfyUI/.ci/setup_windows_zip_nightly_pytorch.ps1 ./diff --git a/comfy/cldm/cldm.py b/comfy/cldm/cldm.pyindex 8d14a6907..c60abf80b 100644--- a/comfy/cldm/cldm.py+++ b/comfy/cldm/cldm.py@@ -59,9 +59,9 @@ class ControlNet(nn.Module):if context_dim is not None:assert use_spatial_transformer, 'Fool!! You forgot to use the spatial transformer for your cross-attention conditioning...'- from omegaconf.listconfig import ListConfig- if type(context_dim) == ListConfig:- context_dim = list(context_dim)+ # from omegaconf.listconfig import ListConfig+ # if type(context_dim) == ListConfig:+ # context_dim = list(context_dim)if num_heads_upsample == -1:num_heads_upsample = num_headsdiff --git a/comfy/ldm/models/diffusion/ddpm.py b/comfy/ldm/models/diffusion/ddpm.pyindex 802034c72..42ed2add7 100644--- a/comfy/ldm/models/diffusion/ddpm.py+++ b/comfy/ldm/models/diffusion/ddpm.py@@ -18,7 +18,6 @@ import itertoolsfrom tqdm import tqdmfrom torchvision.utils import make_grid# from pytorch_lightning.utilities.distributed import rank_zero_only-from omegaconf import ListConfigfrom ldm.util import log_txt_as_img, exists, default, ismap, isimage, mean_flat, count_params, instantiate_from_configfrom ldm.modules.ema import LitEma@@ -1124,8 +1123,8 @@ class LatentDiffusion(DDPM):def get_unconditional_conditioning(self, batch_size, null_label=None):if null_label is not None:xc = null_label- if isinstance(xc, ListConfig):- xc = list(xc)+ # if isinstance(xc, ListConfig):+ # xc = list(xc)if isinstance(xc, dict) or isinstance(xc, list):c = self.get_learned_conditioning(xc)else:diff --git a/comfy/ldm/modules/diffusionmodules/openaimodel.py b/comfy/ldm/modules/diffusionmodules/openaimodel.pyindex 9a652c295..09ab1a066 100644--- a/comfy/ldm/modules/diffusionmodules/openaimodel.py+++ b/comfy/ldm/modules/diffusionmodules/openaimodel.py@@ -477,9 +477,9 @@ class UNetModel(nn.Module):if context_dim is not None:assert use_spatial_transformer, 'Fool!! You forgot to use the spatial transformer for your cross-attention conditioning...'- from omegaconf.listconfig import ListConfig- if type(context_dim) == ListConfig:- context_dim = list(context_dim)+ # from omegaconf.listconfig import ListConfig+ # if type(context_dim) == ListConfig:+ # context_dim = list(context_dim)if num_heads_upsample == -1:num_heads_upsample = num_headsdiff --git a/comfy/sd.py b/comfy/sd.pyindex fd434ba6a..3f5ce24e9 100644--- a/comfy/sd.py+++ b/comfy/sd.py@@ -6,7 +6,7 @@ import sd2_clipimport model_managementfrom .ldm.util import instantiate_from_configfrom .ldm.models.autoencoder import AutoencoderKL-from omegaconf import OmegaConf+import yamlfrom .cldm import cldmfrom .t2i_adapter import adapter@@ -726,7 +726,8 @@ def load_clip(ckpt_path, embedding_directory=None):return clipdef load_checkpoint(config_path, ckpt_path, output_vae=True, output_clip=True, embedding_directory=None):- config = OmegaConf.load(config_path)+ with open(config_path, 'r') as stream:+ config = yaml.safe_load(stream)model_config_params = config['model']['params']clip_config = model_config_params['cond_stage_config']scale_factor = model_config_params['scale_factor']@@ -750,7 +751,7 @@ def load_checkpoint(config_path, ckpt_path, output_vae=True, output_clip=True, ew.cond_stage_model = clip.cond_stage_modelload_state_dict_to = [w]- model = instantiate_from_config(config.model)+ model = instantiate_from_config(config["model"])sd = load_torch_file(ckpt_path)model = load_model_weights(model, sd, verbose=False, load_state_dict_to=load_state_dict_to)return (ModelPatcher(model), clip, vae)diff --git a/requirements.txt b/requirements.txtindex 45f2599d9..bc8b3c558 100644--- a/requirements.txt+++ b/requirements.txt@@ -1,7 +1,6 @@torchtorchdiffeqtorchsde-omegaconfeinopsopen-clip-torchtransformers@@ -9,3 +8,4 @@ safetensorspytorch_lightningaiohttpaccelerate+pyyaml