Clybius / ComfyUI-Extra-Samplers

A repository of extra samplers, usable within ComfyUI for most nodes.
BSD 3-Clause "New" or "Revised" License
67 stars 10 forks source link

IMPORT FAILED #1

Closed AlexD81 closed 7 months ago

AlexD81 commented 9 months ago

Hi, I've installed it with Manager.
But it doen't work, the following error appears: 0.8 seconds (IMPORT FAILED): C:\Users***\ComfyUI\custom_nodes\ComfyUI-Extra-Samplers

изображение

it's on windows

Clybius commented 9 months ago

If you scroll up in the console, there should be an error spit out while ComfyUI is loading. Do you happen to have a more detailed error log of the failed import?

Having checked the things I should off the top of my head, there is an extraneous import relating to scipy, which I will push a fix for within an hour. If that fixes it, let me know, otherwise that log would greatly help me further diagnose the failed import.

Sorry about the issue!

AlexD81 commented 9 months ago

Hi Clybius, hope it's necessary part of log, thank you

Traceback (most recent call last): File "C:\Users\A\ComfyUI\nodes.py", line 1893, in load_custom_node module_spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "C:\Users\A\ComfyUI\custom_nodes\ComfyUI-Extra-Samplers\__init__.py", line 1, in <module> from . import extra_samplers File "C:\Users\A\ComfyUI\custom_nodes\ComfyUI-Extra-Samplers\extra_samplers.py", line 599, in <module> from k_diffusion.sampling import sample_lcm ImportError: cannot import name 'sample_lcm' from 'k_diffusion.sampling' (C:\Users\A\AppData\Local\Programs\Python\Python310\lib\site-packages\k_diffusion\sampling.py)

blepping commented 9 months ago

@AlexD81 if you change

from k_diffusion.sampling import sample_lcm

to

from comfy.k_diffusion.sampling import sample_lcm

in extra_samplers.py around line 599 does that fix the issue for you? edit: or if you know how you can try pull #3. both suggestions may not help you if your comfy version is very old though (the alternate fix would be to try to update the diffusers package in your venv)

(@Clybius is there a reason to use the package k_diffusion_sampling at all instead of the comfy version?)

AlexD81 commented 9 months ago

there's no import error anymore, however in log i see this

C:\Users\A\ComfyUI\custom_nodes\ComfyUI-Extra-Samplers\nodes.py:251: SyntaxWarning: "is" with a literal. Did you mean "=="? samples = sampler.sample(model_wrap, temp_sigmas, extra_args, callback, noise.to(device) if i is 0 else torch.zeros(latent_image.size(), dtype=latent_image.dtype, layout=latent_image.layout, device=device), samples if samples is not None else latent_image, denoise_mask, True) C:\Users\A\ComfyUI\custom_nodes\ComfyUI-Extra-Samplers\nodes.py:254: SyntaxWarning: "is" with a literal. Did you mean "=="? samples = sampler2.sample(model_wrap2, temp_sigmas2, extra_args2, callback2, noise.to(device2) if i is 0 else torch.zeros(latent_image.size(), dtype=latent_image.dtype, layout=latent_image.layout, device=device2), samples if samples is not None else latent_image, denoise_mask2, True)

blepping commented 9 months ago

however in log i see this

that shouldn't cause any issues, basically just a coding style thing since it's an integer value.