Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One of the more recent updates have broken SeargeSDXL nodes and it fails to load. #137

Open
axdwct opened this issue Apr 5, 2024 · 9 comments

Comments

@axdwct
Copy link

axdwct commented Apr 5, 2024

Traceback (most recent call last):
File "C:\ProgramData\anaconda3\envs\ComfyUI\ComfyUI\nodes.py", line 1889, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in call_with_frames_removed
File "C:\ProgramData\anaconda3\envs\ComfyUI\ComfyUI\custom_nodes\SeargeSDXL_init
.py", line 35, in
from .searge_sdxl import SEARGE_CLASS_MAPPINGS, SEARGE_DISPLAY_NAME_MAPPINGS
File "C:\ProgramData\anaconda3\envs\ComfyUI\ComfyUI\custom_nodes\SeargeSDXL\searge_sdxl.py", line 54, in
from .modules.magic_box import SeargeMagicBox
File "C:\ProgramData\anaconda3\envs\ComfyUI\ComfyUI\custom_nodes\SeargeSDXL\modules\magic_box.py", line 38, in
from .stage_latent_detailer import SeargeStageLatentDetailer
File "C:\ProgramData\anaconda3\envs\ComfyUI\ComfyUI\custom_nodes\SeargeSDXL\modules\stage_latent_detailer.py", line 29, in
from comfy.sample import prepare_mask
ImportError: cannot import name 'prepare_mask' from 'comfy.sample' (C:\ProgramData\anaconda3\envs\ComfyUI\ComfyUI\comfy\sample.py)

@MicPec
Copy link

MicPec commented Apr 5, 2024

Same here:

Searge-SDXL v4.3.1 in /run/media/AI/StabilityMatrix-linux-x64/Data/Packages/ComfyUI/custom_nodes/SeargeSDXL
Traceback (most recent call last):
File "/run/media/AI/StabilityMatrix-linux-x64/Data/Packages/ComfyUI/nodes.py", line 1889, in load_custom_node
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/run/media/AI/StabilityMatrix-linux-x64/Data/Packages/ComfyUI/custom_nodes/SeargeSDXL/init.py", line 35, in
from .searge_sdxl import SEARGE_CLASS_MAPPINGS, SEARGE_DISPLAY_NAME_MAPPINGS
File "/run/media/AI/StabilityMatrix-linux-x64/Data/Packages/ComfyUI/custom_nodes/SeargeSDXL/searge_sdxl.py", line 54, in
from .modules.magic_box import SeargeMagicBox
File "/run/media/AI/StabilityMatrix-linux-x64/Data/Packages/ComfyUI/custom_nodes/SeargeSDXL/modules/magic_box.py", line 38, in
from .stage_latent_detailer import SeargeStageLatentDetailer
File "/run/media/AI/StabilityMatrix-linux-x64/Data/Packages/ComfyUI/custom_nodes/SeargeSDXL/modules/stage_latent_detailer.py", line 29, in
from comfy.sample import prepare_mask
ImportError: cannot import name 'prepare_mask' from 'comfy.sample' (/run/media/AI/StabilityMatrix-linux-x64/Data/Packages/ComfyUI/comfy/sample.py)

Cannot import /run/media/AI/StabilityMatrix-linux-x64/Data/Packages/ComfyUI/custom_nodes/SeargeSDXL module for custom nodes: cannot import name 'prepare_mask' from 'comfy.sample' (/run/media/AI/StabilityMatrix-linux-x64/Data/Packages/ComfyUI/comfy/sample.py)

@Arron17
Copy link

Arron17 commented Apr 5, 2024

Some of the Comfy sample settings have been moved.

in the file "SeargeSDXL\Modules\stage_latent_detailer.py" at line 29 change

from comfy.sample import prepare_mask

to

from comfy.sampler_helpers import prepare_mask

That should fix it.

@jobunk
Copy link

jobunk commented Apr 5, 2024

EDIT: I made a PR (#140) for a permanent solution. The fix described here is no longer needed! As stated it was a very hacky temporary solution.

@Arron17 This fix works for loading the modules. However custom_sdxl_ksampler.py also got broken by these changes, but the error only occurs when actually trying to run the SDLX Sampler v3 module. I tried some quick fixes that just led to errors in different places, so for now I went with a temporary solution:

Instead of adjusting SeargeSDXL you can edit the sample.py and sampler.py and revert them to older versions.
https://github.com/comfyanonymous/ComfyUI/blob/977eda19a6471fbff253dc92c3c2f1a4a67b1793/comfy/sample.py
https://github.com/comfyanonymous/ComfyUI/blob/e6482fbbfc83cd25add0532b2e4c51d305e8a232/comfy/samplers.py

Obviously this fix is very temporary and will eventually stop working, so changes to SeargeSDXL are definitely needed.

@jeffyspoke
Copy link

@Arron17 This fix works for loading the modules. However custom_sdxl_ksampler.py also got broken by these changes, but the error only occurs when actually trying to run the SDLX Sampler v3 module. I tried some quick fixes that just led to errors in different places, so for now I went with a temporary solution: Instead of adjusting SeargeSDXL you can edit the sample.py and sampler.py and revert them to older versions. https://github.com/comfyanonymous/ComfyUI/blob/977eda19a6471fbff253dc92c3c2f1a4a67b1793/comfy/sample.py https://github.com/comfyanonymous/ComfyUI/blob/e6482fbbfc83cd25add0532b2e4c51d305e8a232/comfy/samplers.py

Obviously this fix is very temporary and will eventually stop working, so changes to SeargeSDXL are definitely needed.

This fixed it for me - thank you

@bitshifter52
Copy link

bitshifter52 commented Apr 6, 2024

This happened in a Debian environment:

_Trying to load custom node /media/drives/16TB/ComfyUI/custom_nodes/SeargeSDXL Searge-SDXL v4.3.1 in /media/drives/16TB/ComfyUI/custom_nodes/SeargeSDXL Traceback (most recent call last): File "/media/drives/16TB/ComfyUI/nodes.py", line 1889, in load_custom_node module_spec.loader.exec_module(module) File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/media/drives/16TB/ComfyUI/custom_nodes/SeargeSDXL/__init__.py", line 35, in from .searge_sdxl import SEARGE_CLASS_MAPPINGS, SEARGE_DISPLAY_NAME_MAPPINGS File "/media/drives/16TB/ComfyUI/custom_nodes/SeargeSDXL/searge_sdxl.py", line 54, in from .modules.magic_box import SeargeMagicBox File "/media/drives/16TB/ComfyUI/custom_nodes/SeargeSDXL/modules/magic_box.py", line 38, in from .stage_latent_detailer import SeargeStageLatentDetailer File "/media/drives/16TB/ComfyUI/custom_nodes/SeargeSDXL/modules/stage_latent_detailer.py", line 29, in from comfy.sample import prepare_mask ImportError: cannot import name 'prepare_mask' from 'comfy.sample' (/media/drives/16TB/ComfyUI/comfy/sample.py)

Cannot import /media/drives/16TB/ComfyUI/custom_nodes/SeargeSDXL module for custom nodes: cannot import name 'prepare_mask' from 'comfy.sample' (/media/drives/16TB/ComfyUI/comfy/sample.py)_

Will try the above mentioned work-arounds.

=======

Update:
Tried the suggested sample.py and samplers.py files and SeargeSDXL loaded. However, a couple of other nodes broke.

@jobunk
Copy link

jobunk commented Apr 6, 2024

I managed to fix the errors caused by the changes to sample.py etc:
jobunk@9d11b6d.

However there was another recent change that I don't know how to deal with. Relevant commit:
comfyanonymous/ComfyUI@1a0486b

Another user also reported running into the same error, but with another sampler module, so let's see if it can be resolved on their side, or if more changes to this project are needed.
comfyanonymous/ComfyUI#3217

@mskiller
Copy link

mskiller commented Apr 7, 2024

I commented out the line 29 of stage_latent_detailer.py , it let searge loads as module, and I could get back my workflow running. but not sure it will not run into some issue later.

@hashmil
Copy link

hashmil commented Apr 7, 2024

@Arron17 This fix works for loading the modules. However custom_sdxl_ksampler.py also got broken by these changes, but the error only occurs when actually trying to run the SDLX Sampler v3 module. I tried some quick fixes that just led to errors in different places, so for now I went with a temporary solution: Instead of adjusting SeargeSDXL you can edit the sample.py and sampler.py and revert them to older versions. https://github.com/comfyanonymous/ComfyUI/blob/977eda19a6471fbff253dc92c3c2f1a4a67b1793/comfy/sample.py https://github.com/comfyanonymous/ComfyUI/blob/e6482fbbfc83cd25add0532b2e4c51d305e8a232/comfy/samplers.py

Obviously this fix is very temporary and will eventually stop working, so changes to SeargeSDXL are definitely needed.

this broke my comfy somewhat:

Traceback (most recent call last):
  File "/Users/hash.milhan/ComfyUI/nodes.py", line 1864, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/hash.milhan/ComfyUI/comfy_extras/nodes_custom_sampler.py", line 386, in <module>
    class Guider_Basic(comfy.samplers.CFGGuider):
                       ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'comfy.samplers' has no attribute 'CFGGuider'

@jobunk
Copy link

jobunk commented Apr 7, 2024

I have an open PR that should fix everything described here. Just get the newest version of comfyUI and this module and then adjust the files changed in my PR. #140

The last change to this repo was 5 months ago so I don't know how fast my PR will be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants