Giter Site home page Giter Site logo

A few hours ago comfy changed the content in samplers.py, which resulted in errors like cannot import name 'CompVisVDenoiser' from 'comfy.samplers' about efficiency-nodes-comfyui HOT 8 CLOSED

jags111 avatar jags111 commented on August 22, 2024 1
A few hours ago comfy changed the content in samplers.py, which resulted in errors like cannot import name 'CompVisVDenoiser' from 'comfy.samplers'

from efficiency-nodes-comfyui.

Comments (8)

picobyte avatar picobyte commented on August 22, 2024 6

pip install k-diffusion and

diff --git a/py/smZ_cfg_denoiser.py b/py/smZ_cfg_denoiser.py
index e6a4ce1..dfe3b5f 100644
--- a/py/smZ_cfg_denoiser.py
+++ b/py/smZ_cfg_denoiser.py
@@ -4,8 +4,8 @@ import torch
 from typing import List
 import comfy.sample
 from comfy import model_base, model_management
-from comfy.samplers import KSampler, CompVisVDenoiser, KSamplerX0Inpaint
-from comfy.k_diffusion.external import CompVisDenoiser
+from comfy.samplers import KSampler, KSamplerX0Inpaint
+from k_diffusion.external import DiscreteVDDPMDenoiser,CompVisDenoiser
 import nodes
 import inspect
 import functools
@@ -17,6 +17,15 @@ import itertools
 import torch
 from comfy import model_management
 
+
+class CompVisVDenoiser(DiscreteVDDPMDenoiser):
+    def __init__(self, model, quantize=False, device='cpu'):
+        super().__init__(model, model.alphas_cumprod, quantize=quantize)
+
+    def get_v(self, x, t, cond, **kwargs):
+        return self.inner_model.apply_model(x, t, cond, **kwargs)
+
+
 def catenate_conds(conds):
     if not isinstance(conds[0], dict):
         return torch.cat(conds)
@@ -318,4 +327,4 @@ def set_model_k(self: KSampler):
 class SDKSampler(comfy.samplers.KSampler):
     def __init__(self, *args, **kwargs):
         super(SDKSampler, self).__init__(*args, **kwargs)
-        set_model_k(self)
\ No newline at end of file
+        set_model_k(self)

from efficiency-nodes-comfyui.

jags111 avatar jags111 commented on August 22, 2024 2

I am on it to see if there is a workaround for same . else the node will be paused until rest workflow will continue.. The change in comfy sampler code will not allow CompVisDenoiser to work so have to add another module or new script to handle same.

from efficiency-nodes-comfyui.

jags111 avatar jags111 commented on August 22, 2024 1

all sorted and if any further open a new issue

from efficiency-nodes-comfyui.

sapientsnap avatar sapientsnap commented on August 22, 2024 1

Thanks @jags111 for engineering and posting this.
But... I'm not quite sure what to do with that code you pasted.
I ran pip install k-diffusion, but the loading error still occurs, so I assume that code needs to be put somewhere?

Thanks for any assist.
(PS: Using Terminal on a Mac, if that makes a difference)

from efficiency-nodes-comfyui.

noahjgreer avatar noahjgreer commented on August 22, 2024

Yes, this seems to have caused an issue with importing the Efficiency Nodes module. Any ideas on how to fix it?

from efficiency-nodes-comfyui.

lord-lethris avatar lord-lethris commented on August 22, 2024

I have the same issue - I posted it here first.

LucianoCirino#235

I didn't know about this Branch of the project :)
I hope its fixable. in the interim, I might see if I can roll back the breaking Commit from ComfyUI.

from efficiency-nodes-comfyui.

jags111 avatar jags111 commented on August 22, 2024

will check as for now the particular node is throwing errors and will fix same and update.

from efficiency-nodes-comfyui.

jags111 avatar jags111 commented on August 22, 2024

oh will look into this again and update

from efficiency-nodes-comfyui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.