huchenlei / ComfyUI-layerdiffuse

Layer Diffuse custom nodes
Apache License 2.0
1.49k stars 145 forks source link

[Bug]: diffusers>=0.25.0 even with 0.27.1 #60

Closed heyider closed 8 months ago

heyider commented 8 months ago

What happened?

I'm getting the error diffusers>=0.25.0, but in Forge it works normally, when checking the installed version it says I have 0.27.1

If you change the requirements in the models.py file, it does not give the error, but it gives the following error when running Layer Diffuse Decode (RGBA): UNetMidBlock2D.init() got an unexpected keyword argument 'attn_groups' .

image

Can someone help me?

Steps to reproduce the problem

1 Open Comfyui or 2 Execute Layer Diffuse Decode (RGBA)

What should have happened?

Work?

Commit where the problem happens

ComfyUI: ComfyUI-layerdiffuse:

Sysinfo

RTX 3090

Console logs

Traceback (most recent call last):
  File "C:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1888, 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 "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\__init__.py", line 1, in <module>
    from .layered_diffusion import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\layered_diffusion.py", line 23, in <module>
    from .lib_layerdiffusion.models import TransparentVAEDecoder
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\lib_layerdiffusion\models.py", line 22, in <module>
    check_diffusers_version()
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\lib_layerdiffusion\models.py", line 17, in check_diffusers_version
    assert parse(diffusers.__version__) >= parse(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: diffusers>=0.25.0 requirement not satisfied. Please install correct diffusers version.

Traceback (most recent call last):
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\layered_diffusion.py", line 198, in decode
    image, mask = super().decode(samples, images, sd_version, sub_batch_size)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\layered_diffusion.py", line 155, in decode
    self.vae_transparent_decoder[sd_version] = TransparentVAEDecoder(
                                               ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\lib_layerdiffusion\models.py", line 253, in __init__
    model = UNet1024(in_channels=3, out_channels=4)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\configuration_utils.py", line 636, in inner_init
    init(self, *args, **init_kwargs)
  File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\lib_layerdiffusion\models.py", line 142, in __init__
    self.mid_block = UNetMidBlock2D(
                     ^^^^^^^^^^^^^^^
TypeError: UNetMidBlock2D.__init__() got an unexpected keyword argument 'attn_groups'

Workflow json file

layer_diffusion_fg_example_rgba.json

Additional information

No response

huchenlei commented 8 months ago

Are you sure you install 0.27.1 version diffusers in the correct python env? The screenshot only shows that you have diffusers installed in your default python env.

What is the command you used to launch ComfyUI?

huchenlei commented 8 months ago

The unexpected keyword argument error is the same as https://github.com/huchenlei/ComfyUI-layerdiffuse/issues/26.

heyider commented 8 months ago

Are you sure you install 0.27.1 version diffusers in the correct python env? The screenshot only shows that you have diffusers installed in your default python env.

What is the command you used to launch ComfyUI?

I don't think so, how can I do that? That requirements.txt command doesn't work.

The command I use to start is this: .\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --fp8_e5m2-text-enc --fp8_e5m2-unet

Is the correct folder python_embeded? How should I proceed?

EDIT: My comfyui had version 0.21.0. I copied 0.25.0 from the Forge folder and it resolved it.