Git Product home page Git Product logo

comfyui-layerdiffuse's People

Contributors

huchenlei avatar kijai avatar robinjhuang avatar xingren23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

comfyui-layerdiffuse's Issues

Join Image with Alpha node

Image from Gyazo
In the sample workflow, Apply Mask to Image is used to create a transparent image from an RGB image and a mask. However, ComfyUI has a default node called Join Image with Alpha that can do the same thing.

It’s a minor issue, but this might be a better choice for the sample.

An error occurs when using layer_diffusion_cond_fg_all.json

An error occurs when using layer_diffusion_cond_fg_all.json
After I downloaded it and ran it directly, the following error occurred:

Error occurred when executing KSampler:

Sizes of tensors must match except in dimension 1. Expected size 128 but got size 144 for tensor number 1 in the list.

File "D:\Software\Ai\ComfyUI-aki-v1.2\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\Software\Ai\ComfyUI-aki-v1.2\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\Software\Ai\ComfyUI-aki-v1.2\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\Software\Ai\ComfyUI-aki-v1.2\nodes.py", line 1368, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
File "D:\Software\Ai\ComfyUI-aki-v1.2\nodes.py", line 1338, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "D:\Software\Ai\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 22, in informative_sample
raise e
File "D:\Software\Ai\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample
return original_sample(*args, **kwargs) # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations.
File "D:\Software\Ai\ComfyUI-aki-v1.2\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 248, in motion_sample
return orig_comfy_sample(model, noise, *args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\sample.py", line 100, in sample
samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 703, in sample
return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 608, in sample
samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 547, in sample
samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
File "D:\Software\Ai\ComfyUI-aki-v1.2\python\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\k_diffusion\sampling.py", line 137, in sample_euler
denoised = model(x, sigma_hat * s_in, **extra_args)
File "D:\Software\Ai\ComfyUI-aki-v1.2\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 285, in forward
out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, model_options=model_options, seed=seed)
File "D:\Software\Ai\ComfyUI-aki-v1.2\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self.call_impl(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in call_impl
return forward_call(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 272, in forward
return self.apply_model(*args, **kwargs)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 269, in apply_model
out = sampling_function(self.inner_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 249, in sampling_function
cond_pred, uncond_pred = calc_cond_uncond_batch(model, cond, uncond
, x, timestep, model_options)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\samplers.py", line 223, in calc_cond_uncond_batch
output = model.apply_model(input_x, timestep
, **c).chunk(batch_chunks)
File "D:\Software\Ai\ComfyUI-aki-v1.2\comfy\model_base.py", line 76, in apply_model
xc = torch.cat([xc] + [c_concat], dim=1)

At the "layer diffusion apply" node, such an error occurs. How to solve it? Thank you so much! !

Error occurred when executing LayeredDiffusionApply:

File "D:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "D:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "D:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "D:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI\custom_nodes\ComfyUI-layerdiffusion-main\layered_diffusion.py", line 129, in apply_layered_diffusion
model_path = load_file_from_url(
File "D:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI\custom_nodes\ComfyUI-layerdiffusion-main\lib_layerdiffusion\utils.py", line 111, in load_file_from_url
download_url_to_file(url, cached_file, progress=progress)
File "D:\ComfyUI_windows_portable_nvidia_cu118_or_cpu\python_embeded\lib\site-packages\torch\hub.py", line 611, in download_url_to_file
u = urlopen(req)
File "urllib\request.py", line 216, in urlopen
File "urllib\request.py", line 519, in open
File "urllib\request.py", line 536, in _open
File "urllib\request.py", line 496, in _call_chain
File "urllib\request.py", line 1391, in https_open
File "urllib\request.py", line 1351, in do_open

Execution of these two modules by the mac computer will cause the environment to crash,“Layer Diffusion Decode”和“Layer Diffusion Decode(BGBA)”

The error message is as follows
“/AppleInternal/Library/BuildRoots/2acced82-df86-11ed-9b95-428477786501/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSNDArray/Kernels/MPSNDArraySort.mm:283: failed assertion `(null)" Axis = 4. This class only supports axis = 0, 1, 2, 3”

Please help me fix it, it's very important to me, thanks a lot!

SDXL Lightning produces terrible results

I tried your sample workflow using an SDXL Lightning model and the results were really quite bad. When I switched to a standard SDXL model, the result was much better. Is this something you expect? Have you tried a lightning model yourself?

Thank you for your work.

can we make it work with cascade?

Error occurred when executing LayeredDiffusionDecode:

The size of tensor a (256) must match the size of tensor b (512) at non-singleton dimension 3

Any suggestion to improve output image?

image

Hi, it seem like the layerdiffusion is a big lora to generate a transparent background image, but it effect the original image a lot. I test it with same step, same seed, same model but worse result. I see that you get great image from your workflow example, how do you get this result? thanks

LayeredDiffusionApply: Error while deserializing header: MetadataIncompleteBuffer

Tried loading the first work flow just to generate the foreground with "Layered Diffusion Apply"
Using: Windows Portable latest install

Get this error when trying to run, no other similar issues found.

Note: I saw in issue #12 where they might have needed to download the Huggingface models, I don't think that is my issue.
I have not tried this, but let me know if that is it, downloading those isn't mentioned in the install instructions for this node-set.
#12

Thx for any help!

image image

workflow

[Bug]: SD 1.5 is not working.

What happened?

I got an error when I tried to use SD 1.5.
image

Steps to reproduce the problem

I used the example workflow as a reference and ran it.
#47

What should have happened?

No errors should occur.

Commit where the problem happens

ComfyUI: 0ed72befe18e086ac160f1a55aa69b37c928ebb9
ComfyUI-layerdiffuse: 151f746

Sysinfo

OS : window 10
GPU : nvidia 3090ti

Console logs

Requested to load BaseModel
Loading 1 new model
  0%|                                                                                                                                                                                                                  | 0/20 [00:00<?, ?it/s]
!!! Exception during processing !!!
Traceback (most recent call last):
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\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:\Comfy\ComfyUI_windows_portable_2\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\nodes.py", line 1368, in sample
    def sample(self, model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=1.0):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\nodes.py", line 1338, in common_ksampler
    disable_pbar = not comfy.utils.PROGRESS_BAR_ENABLED
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 22, in informative_sample
    raise e
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample
    return original_sample(*args, **kwargs)  # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations.
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 248, in motion_sample
    return orig_comfy_sample(model, noise, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\sample.py", line 100, in sample
    samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI_smZNodes\smZNodes.py", line 1380, in KSampler_sample
    return _KSampler_sample(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\samplers.py", line 703, in sample
    return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI_smZNodes\smZNodes.py", line 1399, in sample
    return _sample(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\samplers.py", line 608, in sample
    samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\samplers.py", line 547, in sample
    samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\k_diffusion\sampling.py", line 137, in sample_euler
    denoised = model(x, sigma_hat * s_in, **extra_args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\samplers.py", line 285, in forward
    out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\samplers.py", line 272, in forward
    return self.apply_model(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI_smZNodes\smZNodes.py", line 1012, in apply_model
    out = super().apply_model(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\samplers.py", line 269, in apply_model
    out = sampling_function(self.inner_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\samplers.py", line 249, in sampling_function
    cond_pred, uncond_pred = calc_cond_uncond_batch(model, cond, uncond_, x, timestep, model_options)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\samplers.py", line 223, in calc_cond_uncond_batch
    output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\model_base.py", line 96, in apply_model
    model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 849, in forward
    h = forward_timestep_embed(module, h, emb, context, transformer_options, time_context=time_context, num_video_frames=num_video_frames, image_only_indicator=image_only_indicator)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 43, in forward_timestep_embed
    x = layer(x, context, transformer_options)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\ldm\modules\attention.py", line 632, in forward
    x = block(x, context=context[i], transformer_options=transformer_options)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\attention_sharing.py", line 253, in forward
    return func(self, x, context, transformer_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\ldm\modules\attention.py", line 459, in forward
    return checkpoint(self._forward, (x, context, transformer_options), self.parameters(), self.checkpoint)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\ldm\modules\diffusionmodules\util.py", line 191, in checkpoint
    return func(*inputs)
           ^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\ldm\modules\attention.py", line 519, in _forward
    n = self.attn1(n, context=context_attn1, value=value_attn1)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\attention_sharing.py", line 239, in forward
    x = optimized_attention(q, k, v, self.heads)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\comfy\ldm\modules\attention.py", line 326, in attention_xformers
    out = xformers.ops.memory_efficient_attention(q, k, v, attn_bias=mask)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\xformers\ops\fmha\__init__.py", line 223, in memory_efficient_attention
    return _memory_efficient_attention(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\xformers\ops\fmha\__init__.py", line 321, in _memory_efficient_attention
    return _memory_efficient_attention_forward(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\xformers\ops\fmha\__init__.py", line 341, in _memory_efficient_attention_forward
    out, *_ = op.apply(inp, needs_gradient=False)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\xformers\ops\fmha\flash.py", line 458, in apply
    out, softmax_lse, rng_state = cls.OPERATOR(
                                  ^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\torch\_ops.py", line 755, in __call__
    return self._op(*args, **(kwargs or {}))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Comfy\ComfyUI_windows_portable_2\python_embeded\Lib\site-packages\xformers\ops\fmha\flash.py", line 106, in _flash_fwd
    ) = _C_flashattention.fwd(
        ^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: invalid configuration argument
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.


Prompt executed in 1.27 seconds

Workflow json file

workflow (40).json

Blending given BG

Snipaste_2024-03-06_15-04-34
I want the robot to sit on the couch in the picture and the result is this
Um, the bot is running fine - -

Help! I don't know what's going on. Help, SOS

Error occurred when executing KSamplerAdvanced:

'UNetModel' object has no attribute 'default_image_only_indicator'

File "E:\ComfyUI-aki\ComfyUI-aki-v1\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "E:\ComfyUI-aki\ComfyUI-aki-v1\nodes.py", line 1402, in sample
return common_ksampler(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise, disable_noise=disable_noise, start_step=start_at_step, last_step=end_at_step, force_full_denoise=force_full_denoise)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\nodes.py", line 1338, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "E:\ComfyUI-aki\ComfyUI-aki-v1\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample
return original_sample(*args, **kwargs) # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations.
File "E:\ComfyUI-aki\ComfyUI-aki-v1\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 248, in motion_sample
return orig_comfy_sample(model, noise, *args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\sample.py", line 100, in sample
samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\custom_nodes\ComfyUI_smZNodes_init_.py", line 130, in KSampler_sample
return KSampler_sample(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\samplers.py", line 703, in sample
return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\custom_nodes\ComfyUI_smZNodes_init
.py", line 149, in sample
return _sample(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\samplers.py", line 608, in sample
samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\samplers.py", line 547, in sample
samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\python\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\k_diffusion\sampling.py", line 137, in sample_euler
denoised = model(x, sigma_hat * s_in, **extra_args)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\python\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\python\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\samplers.py", line 285, in forward
out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, model_options=model_options, seed=seed)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\python\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self.call_impl(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\python\lib\site-packages\torch\nn\modules\module.py", line 1520, in call_impl
return forward_call(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\samplers.py", line 272, in forward
return self.apply_model(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\custom_nodes\ComfyUI_smZNodes\smZNodes.py", line 1012, in apply_model
out = super().apply_model(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\samplers.py", line 269, in apply_model
out = sampling_function(self.inner_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\samplers.py", line 249, in sampling_function
cond_pred, uncond_pred = calc_cond_uncond_batch(model, cond, uncond
, x, timestep, model_options)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\samplers.py", line 223, in calc_cond_uncond_batch
output = model.apply_model(input_x, timestep
, **c).chunk(batch_chunks)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\comfy\model_base.py", line 95, in apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
File "E:\ComfyUI-aki\ComfyUI-aki-v1\python\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\python\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\custom_nodes\FreeU_Advanced\nodes.py", line 159, in __temp__forward
image_only_indicator = kwargs.get("image_only_indicator", self.default_image_only_indicator)
File "E:\ComfyUI-aki\ComfyUI-aki-v1\python\lib\site-packages\torch\nn\modules\module.py", line 1688, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
错误截图

Can't really tell which json is for which workflow

What happened?

Your screenshots are private, so we can't see the high resolution version of those. That means they are not readable. When we click on the hyperlink to see the workflows, their names are not clear enough as to be sufficient for us to know which corresponds to the workflow we're looking for.

Steps to reproduce the problem

Use incognito mode and try to to this in your browser

What should have happened?

I should have received one million dollars automatically

Commit where the problem happens

ComfyUI:
ComfyUI-layerdiffuse:

Sysinfo

RTX 6900

Console logs

herdthsdgsdf

Workflow json file

dghfjsfghsdfgh

Additional information

No response

Error occurred when executing LayeredDiffusionDecode

OS WIN10
python main.py --directml --lowvram
ComfyUI caddef8 2024-03-04 22:03:59
ComfyUI-layerdiffusion 7c6f137

Error occurred when executing LayeredDiffusionDecode:

tuple index out of range

File "G:\AI\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "G:\AI\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "G:\AI\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "G:\AI\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\layered_diffusion.py", line 120, in decode
pixel_with_alpha = self.vae_transparent_decoder.decode_pixel(pixel, latent)
File "E:\ProgramData\Anaconda3\envs\AIGC\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "G:\AI\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 300, in decode_pixel
assert y.shape[1] == 4

[Bug]: SD1.5 test ’Generate FG ‘s Flow,Error, 'BaseModel' object has no attribute 'diffusion_model.input_blocks.1.1.transformer_blocks.0.attn1'

What happened?

test layer_diffusion_fg_example_rgba.json ,
Error:
'BaseModel' object has no attribute 'diffusion_model.input_blocks.1.1.transformer_blocks.0.attn1'

Steps to reproduce the problem

1.inport example\ layer_diffusion_fg_example_rgba.json ,
2.choose RealisticVisionV51VAE model,choose config SD15, Decoder choose SD15, go.
3.Error

What should have happened?

it should be Generate FG

Commit where the problem happens

ComfyUI:
commit 00425563c07171f478e7809d3b89cc3df770ebbd
Date: Fri Mar 1 14:24:41 2024 -0500

ComfyUI-layerdiffuse:
commit 151f746 (HEAD -> main, origin/main, origin/HEAD)
Author: Chenlei Hu [email protected]
Date: Sat Mar 9 16:16:31 2024 -0500

Sysinfo

Win

Console logs

Error occurred when executing KSampler:

'BaseModel' object has no attribute 'diffusion_model.input_blocks.1.1.transformer_blocks.0.attn1'

File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1368, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1338, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample
return original_sample(*args, **kwargs) # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 248, in motion_sample
return orig_comfy_sample(model, noise, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\comfy\sample.py", line 93, in sample
real_model, positive_copy, negative_copy, noise_mask, models = prepare_sampling(model, noise.shape, positive, negative, noise_mask)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\comfy\sample.py", line 86, in prepare_sampling
comfy.model_management.load_models_gpu([model] + models, model.memory_required([noise_shape[0] * 2] + list(noise_shape[1:])) + inference_memory)
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 434, in load_models_gpu
cur_loaded_model = loaded_model.model_load(lowvram_model_memory)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 301, in model_load
raise e
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\comfy\model_management.py", line 297, in model_load
self.real_model = self.model.patch_model(device_to=patch_model_to) #TODO: do something with loras and offloading to CPU
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\ComfyUI\comfy\model_patcher.py", line 179, in patch_model
old = getattr(self.model, k)
^^^^^^^^^^^^^^^^^^^^^^
File "E:\AI\ComfyUI\ComfyUI-webui\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1695, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")

Workflow json file

Errrrrror

Additional information

No response

A bug in the process of exporting layerdiffusion

File "/xxx/ComfyUI/custom_nodes/ComfyUI-layerdiffusion/lib_layerdiffusion/utils.py", line 97, in
file_name: str | None = None,
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Cannot import /xxx/ComfyUI/custom_nodes/ComfyUI-layerdiffusion module for custom nodes: unsupported operand type(s) for |: 'type' and 'NoneType'

Import times for custom nodes:
0.0 seconds (IMPORT FAILED): /xxx/ComfyUI/custom_nodes/ComfyUI-layerdiffusion

Layer Diffuse Decode,The mask does not meet the expectations of the VAE Encode (for Inpainting) node

This should be a minor issue.
An error occurs when using the Layer Diffuse Decode node to output a mask to the VAE Encode (for Inpainting) node.

Error occurred when executing VAEEncodeForInpaint:

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

File "/mnt/workspace/ComfyUI/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/mnt/workspace/ComfyUI/execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/mnt/workspace/ComfyUI/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/mnt/workspace/ComfyUI/nodes.py", line 364, in encode
pixels[:,:,:,i] *= m

PixPin_2024-03-06_04-25-41

If download the mask image generated by the Layer Diffuse Decode node, upload it, and convert it into a mask, you can use the mask normally.

PixPin_2024-03-06_04-28-45

KeyError: 'sigmas' when on KSampler with SD1.5

When running the attached (or more elaborate) SD1.5 workflow using the Layer Diffuse Apply node, the KSampler stage errors out with the following output. When swapping models & relevant fields to SDXL this error does not occur.

Please let me know what you can advise. Thank you!
workflow (15)

!!! Exception during processing !!!
Traceback (most recent call last):
  File "C:\ai\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\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:\ai\ComfyUI\custom_nodes\ComfyUI-0246\utils.py", line 381, in new_func
    res_value = old_func(*final_args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\nodes.py", line 1368, in sample
    return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\nodes.py", line 1338, in common_ksampler
    samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample
    return original_sample(*args, **kwargs)  # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations.
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\sample.py", line 100, in sample
    samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\samplers.py", line 703, in sample
    return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\samplers.py", line 608, in sample
    samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\samplers.py", line 547, in sample
    samples = self.sampler_function(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **self.extra_options)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\k_diffusion\sampling.py", line 137, in sample_euler
    denoised = model(x, sigma_hat * s_in, **extra_args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\samplers.py", line 285, in forward
    out = self.inner_model(x, sigma, cond=cond, uncond=uncond, cond_scale=cond_scale, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\samplers.py", line 272, in forward
    return self.apply_model(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\samplers.py", line 269, in apply_model
    out = sampling_function(self.inner_model, x, timestep, uncond, cond, cond_scale, model_options=model_options, seed=seed)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\custom_nodes\comfyui-art-venture\modules\fooocus\patch.py", line 270, in sampling_function_patched
    cond, uncond = calc_cond_uncond_batch(model, cond, uncond, x, timestep, model_options)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\custom_nodes\comfyui-art-venture\modules\fooocus\patch.py", line 241, in calc_cond_uncond_batch
    output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\model_base.py", line 96, in apply_model
    model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\custom_nodes\comfyui-art-venture\modules\fooocus\patch.py", line 296, in unet_forward_patched
    h = forward_timestep_embed(module, h, emb, context, transformer_options)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\ldm\modules\diffusionmodules\openaimodel.py", line 43, in forward_timestep_embed
    x = layer(x, context, transformer_options)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\ldm\modules\attention.py", line 632, in forward
    x = block(x, context=context[i], transformer_options=transformer_options)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\attention_sharing.py", line 253, in forward
    return func(self, x, context, transformer_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\ldm\modules\attention.py", line 459, in forward
    return checkpoint(self._forward, (x, context, transformer_options), self.parameters(), self.checkpoint)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\ldm\modules\diffusionmodules\util.py", line 191, in checkpoint
    return func(*inputs)
           ^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\comfy\ldm\modules\attention.py", line 519, in _forward
    n = self.attn1(n, context=context_attn1, value=value_attn1)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vector\.conda\envs\comfyui\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\ai\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\attention_sharing.py", line 192, in forward
    transformer_options["sigmas"],
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'sigmas'

Prompt executed in 0.16 seconds

RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 1 but got size 4 for tensor number 1 in the list.

What happened?

When I want to generate 4 images with their 4 people without a background, an error appears and it only generates the people in the image, but it does not generate the people without a background.

Steps to reproduce the problem

.

What should have happened?

.

Commit where the problem happens

ComfyUI:
ComfyUI-layerdiffuse:

Sysinfo

.

Console logs

.

Workflow json file

.

Additional information

No response

Mac crash

Docode node always crash

💻 Mac M2

export PYTORCH_ENABLE_MPS_FALLBACK=1
--force-fp16
❌ just python main.py

CleanShot 2024-03-03 at 14 44 43@2x

Install through ComfyUI Manager Menu did not work

Hello and thanks for making this into a ComfyUI node!

I just tried to install using the ComfyUI Manager Menu -> Install Custom Nodes. I restarted as prompted.
But the new nodes are not available.

I'm on Windows 11
ComfyUI: 202136f7fa
Manager: V2.8.3

EDIT: I just update all of comfy but it didn't make any difference. Now,
ComfyUI: 2046a38b9b
Manager: V2.9

Cheers!
And thank you for your work!

Error when loading your example.. How can I fix?

Error occurred when executing LayeredDiffusionDecode:

UNetMidBlock2D.init() got an unexpected keyword argument 'attn_groups'

File "D:\ComfyUI_BETA\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_BETA\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_BETA\ComfyUI\custom_nodes\ComfyUI-0246\utils.py", line 381, in new_func
res_value = old_func(*final_args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_BETA\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_BETA\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\layered_diffusion.py", line 62, in decode
self.vae_transparent_decoder = TransparentVAEDecoder(
^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_BETA\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 242, in init
model = UNet1024(in_channels=3, out_channels=4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_BETA\python_embeded\Lib\site-packages\diffusers\configuration_utils.py", line 636, in inner_init
init(self, *args, **init_kwargs)
File "D:\ComfyUI_BETA\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 131, in init
self.mid_block = UNetMidBlock2D(
^^^^^^^^^^^^^^^

SD15 models supported

LayerDiffuse SD15 brings 4 new models:

Generate FG

Use the apply node the same way as before.
sd15_fg

Generate FG + Blended given BG

Need batch size = 2N.
sd15_cond_joint_bg

Generate BG + Blended given FG

Need batch size = 2N.
sd15_cond_joint_fg

Generate BG + FG + Blended together

Need batch size = 3N.
sd15_joint

Notes:

  • Dropdown options in previous nodes are updated. You will need to re-select the config for your previous workflows
  • Unlike forge impl, which does cond concat for fg/bg/blended, in ComfyUI impl, the cond passed to layer diffusion node directly overwrites the global cond.
  • LayerDiffuseDecode (Split) is added to decode RGBA every N images. It serves the purpose to only decode FG images in a batch.

It seems that the layered diffusion node cannot be installed. I don’t know why???

Dingtalk_20240306121427

hello, I git clone it in the right folder(See picture above),
and performed this operation "Run pip install -r requirements.txt to install python dependencies. You might experience version conflict on diffusers if you have other extensions that depends on other versions of diffusers. In this case, it is recommended to setup separate Python venvs."

however, I still can't find the layer diffuision nodes in my comfyui, why????? what's wrong?????
waiting for your reply, thank you!

Dingtalk_20240306121913

[Bug]: Error occurred when executing LayeredDiffusionDecodeRGBA

What happened?

The layer_diffusion_diff_fg workflow you provided is missing the step to generate a transparent image in the last step, I tried to add the LayeredDiffusionDecodeRGBA node by myself but it shows a runtime error, I don't know the reason for that.

[Bug]: Error occurred when executing LayeredDiffusionDecodeRGBA: Sizes of tensors must match except in dimension 1. Expected size 40 but got size 39 for tensor number 1 in the list.
PixPin_2024-03-06_14-26-28

Steps to reproduce the problem

/

What should have happened?

/

Commit where the problem happens

ComfyUI:
ComfyUI-layerdiffuse:

Sysinfo

Error occurred when executing LayeredDiffusionDecodeRGBA:

Sizes of tensors must match except in dimension 1. Expected size 40 but got size 39 for tensor number 1 in the list.

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, 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 75, 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-layerdiffusion\layered_diffusion.py", line 160, in decode
image, mask = super().decode(samples, images, sub_batch_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\layered_diffusion.py", line 136, in decode
self.vae_transparent_decoder.decode_pixel(
File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 302, in decode_pixel
y = self.estimate_augmented(pixel, latent)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 278, in estimate_augmented
eps = self.estimate_single_pass(feed_pixel, feed_latent).clip(0, 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 249, in estimate_single_pass
y = self.model(pixel, latent)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 212, in forward
sample = upsample_block(sample, res_samples, emb)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\models\unet_2d_blocks.py", line 2181, in forward
hidden_states = torch.cat([hidden_states, res_hidden_states], dim=1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Console logs

/

Workflow json file

fg.json

Additional information

No response

M1 Running this node reported an error, please help to solve it, thank you very much!

/AppleInternal/Library/BuildRoots/2acced82-df86-11ed-9b95-428477786501/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSNDArray/Kernels/MPSNDArraySort.mm:283: failed assertion `(null)" Axis = 4. This class only supports axis = 0, 1, 2, 3
'
Abort trap: 6
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown

[Bug]: can't inference the image file.

What happened?

I use the workflow which list below, I can't inference the image file.

https://github.com/huchenlei/ComfyUI-layerdiffuse/blob/main/examples/layer_diffusion_cond_fg_all.json

Steps to reproduce the problem

  1. run the workflow

What should have happened?

can't run properly

Commit where the problem happens

ComfyUI: 55f37ba
ComfyUI-layerdiffuse: c70b0eb

Sysinfo

Windows 11

NVIDIA RTX 3090

Console logs

Error occurred when executing KSampler:

Sizes of tensors must match except in dimension 1. Expected size 128 but got size 102 for tensor number 1 in the list.

Workflow json file

{
"last_node_id": 56,
"last_link_id": 104,
"nodes": [
{
"id": 37,
"type": "LayeredDiffusionDiffApply",
"pos": [
457,
-37
],
"size": {
"0": 342.5999755859375,
"1": 162
},
"flags": {},
"order": 9,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 55,
"slot_index": 0
},
{
"name": "cond",
"type": "CONDITIONING",
"link": 56,
"slot_index": 1
},
{
"name": "uncond",
"type": "CONDITIONING",
"link": 57,
"slot_index": 2
},
{
"name": "blended_latent",
"type": "LATENT",
"link": 98
},
{
"name": "latent",
"type": "LATENT",
"link": 97
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
62
],
"shape": 3,
"slot_index": 0
},
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
63
],
"shape": 3,
"slot_index": 1
},
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
64
],
"shape": 3,
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "LayeredDiffusionDiffApply"
},
"widgets_values": [
"Background",
1
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 14,
"type": "VAEDecode",
"pos": [
1286,
187
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 12,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 21
},
{
"name": "vae",
"type": "VAE",
"link": 22,
"slot_index": 1
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
65
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 40,
"type": "LayeredDiffusionDecodeRGBA",
"pos": [
1533,
189
],
"size": {
"0": 243.60000610351562,
"1": 46.03548812866211
},
"flags": {},
"order": 13,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 67
},
{
"name": "images",
"type": "IMAGE",
"link": 65
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
66
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "LayeredDiffusionDecodeRGBA"
},
"color": "#232",
"bgcolor": "#353"
},
{
"id": 47,
"type": "VAEDecode",
"pos": [
1360,
900
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 8,
"mode": 0,
"inputs": [
{
"name": "samples",
"type": "LATENT",
"link": 74
},
{
"name": "vae",
"type": "VAE",
"link": 104,
"slot_index": 1
}
],
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
96
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEDecode"
}
},
{
"id": 49,
"type": "VAEEncode",
"pos": [
280,
690
],
"size": {
"0": 210,
"1": 46
},
"flags": {},
"order": 5,
"mode": 0,
"inputs": [
{
"name": "pixels",
"type": "IMAGE",
"link": 77
},
{
"name": "vae",
"type": "VAE",
"link": 102,
"slot_index": 1
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
89,
97
],
"shape": 3,
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "VAEEncode"
}
},
{
"id": 56,
"type": "PreviewImage",
"pos": [
1800,
900
],
"size": {
"0": 611.2340087890625,
"1": 633.9354858398438
},
"flags": {},
"order": 10,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 96
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 20,
"type": "PreviewImage",
"pos": [
1797,
192
],
"size": {
"0": 611.2340087890625,
"1": 633.9354858398438
},
"flags": {},
"order": 14,
"mode": 0,
"inputs": [
{
"name": "images",
"type": "IMAGE",
"link": 66
}
],
"properties": {
"Node name for S&R": "PreviewImage"
}
},
{
"id": 6,
"type": "CLIPTextEncode",
"pos": [
415,
186
],
"size": {
"0": 422.84503173828125,
"1": 164.31304931640625
},
"flags": {},
"order": 3,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 3
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
56,
99
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"an old man sitting, high quality\n\n"
]
},
{
"id": 7,
"type": "CLIPTextEncode",
"pos": [
413,
389
],
"size": {
"0": 425.27801513671875,
"1": 180.6060791015625
},
"flags": {},
"order": 4,
"mode": 0,
"inputs": [
{
"name": "clip",
"type": "CLIP",
"link": 5
}
],
"outputs": [
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
57,
100
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "CLIPTextEncode"
},
"widgets_values": [
"text, watermark"
]
},
{
"id": 55,
"type": "LayeredDiffusionCondApply",
"pos": [
530,
680
],
"size": {
"0": 315,
"1": 142
},
"flags": {},
"order": 6,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 103,
"slot_index": 0
},
{
"name": "cond",
"type": "CONDITIONING",
"link": 99
},
{
"name": "uncond",
"type": "CONDITIONING",
"link": 100
},
{
"name": "latent",
"type": "LATENT",
"link": 89,
"slot_index": 3
}
],
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
93
],
"shape": 3,
"slot_index": 0
},
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
94
],
"shape": 3,
"slot_index": 1
},
{
"name": "CONDITIONING",
"type": "CONDITIONING",
"links": [
95
],
"shape": 3,
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "LayeredDiffusionCondApply"
},
"widgets_values": [
"Background",
1
],
"color": "#232",
"bgcolor": "#353"
},
{
"id": 42,
"type": "KSampler",
"pos": [
990,
850
],
"size": {
"0": 315,
"1": 262
},
"flags": {},
"order": 7,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 93
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 94
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 95
},
{
"name": "latent_image",
"type": "LATENT",
"link": 71
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
74,
98
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
769206633835074,
"randomize",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 3,
"type": "KSampler",
"pos": [
913,
182
],
"size": {
"0": 315,
"1": 262
},
"flags": {},
"order": 11,
"mode": 0,
"inputs": [
{
"name": "model",
"type": "MODEL",
"link": 62
},
{
"name": "positive",
"type": "CONDITIONING",
"link": 63
},
{
"name": "negative",
"type": "CONDITIONING",
"link": 64
},
{
"name": "latent_image",
"type": "LATENT",
"link": 101,
"slot_index": 3
}
],
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
21,
67
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "KSampler"
},
"widgets_values": [
6397152695928,
"randomize",
20,
8,
"euler",
"normal",
1
]
},
{
"id": 4,
"type": "CheckpointLoaderSimple",
"pos": [
-54,
488
],
"size": {
"0": 315,
"1": 98
},
"flags": {},
"order": 0,
"mode": 0,
"outputs": [
{
"name": "MODEL",
"type": "MODEL",
"links": [
55,
103
],
"slot_index": 0
},
{
"name": "CLIP",
"type": "CLIP",
"links": [
3,
5
],
"slot_index": 1
},
{
"name": "VAE",
"type": "VAE",
"links": [
22,
102,
104
],
"slot_index": 2
}
],
"properties": {
"Node name for S&R": "CheckpointLoaderSimple"
},
"widgets_values": [
"juggernautXL_v8Rundiffusion.safetensors"
]
},
{
"id": 50,
"type": "LoadImage",
"pos": [
-59,
686
],
"size": {
"0": 315,
"1": 314
},
"flags": {},
"order": 1,
"mode": 0,
"outputs": [
{
"name": "IMAGE",
"type": "IMAGE",
"links": [
77
],
"shape": 3,
"slot_index": 0
},
{
"name": "MASK",
"type": "MASK",
"links": null,
"shape": 3
}
],
"properties": {
"Node name for S&R": "LoadImage"
},
"widgets_values": [
"chair.png",
"image"
]
},
{
"id": 44,
"type": "EmptyLatentImage",
"pos": [
524,
944
],
"size": {
"0": 315,
"1": 106
},
"flags": {},
"order": 2,
"mode": 0,
"outputs": [
{
"name": "LATENT",
"type": "LATENT",
"links": [
71,
101
],
"slot_index": 0
}
],
"properties": {
"Node name for S&R": "EmptyLatentImage"
},
"widgets_values": [
1024,
1024,
1
]
}
],
"links": [
[
3,
4,
1,
6,
0,
"CLIP"
],
[
5,
4,
1,
7,
0,
"CLIP"
],
[
21,
3,
0,
14,
0,
"LATENT"
],
[
22,
4,
2,
14,
1,
"VAE"
],
[
55,
4,
0,
37,
0,
"MODEL"
],
[
56,
6,
0,
37,
1,
"CONDITIONING"
],
[
57,
7,
0,
37,
2,
"CONDITIONING"
],
[
62,
37,
0,
3,
0,
"MODEL"
],
[
63,
37,
1,
3,
1,
"CONDITIONING"
],
[
64,
37,
2,
3,
2,
"CONDITIONING"
],
[
65,
14,
0,
40,
1,
"IMAGE"
],
[
66,
40,
0,
20,
0,
"IMAGE"
],
[
67,
3,
0,
40,
0,
"LATENT"
],
[
71,
44,
0,
42,
3,
"LATENT"
],
[
74,
42,
0,
47,
0,
"LATENT"
],
[
77,
50,
0,
49,
0,
"IMAGE"
],
[
89,
49,
0,
55,
3,
"LATENT"
],
[
93,
55,
0,
42,
0,
"MODEL"
],
[
94,
55,
1,
42,
1,
"CONDITIONING"
],
[
95,
55,
2,
42,
2,
"CONDITIONING"
],
[
96,
47,
0,
56,
0,
"IMAGE"
],
[
97,
49,
0,
37,
4,
"LATENT"
],
[
98,
42,
0,
37,
3,
"LATENT"
],
[
99,
6,
0,
55,
1,
"CONDITIONING"
],
[
100,
7,
0,
55,
2,
"CONDITIONING"
],
[
101,
44,
0,
3,
3,
"LATENT"
],
[
102,
4,
2,
49,
1,
"VAE"
],
[
103,
4,
0,
55,
0,
"MODEL"
],
[
104,
4,
2,
47,
1,
"VAE"
]
],
"groups": [],
"config": {},
"extra": {},
"version": 0.4
}

Additional information

No response

The images as inputs and dimensions only work with 1024x1024?

What happened?

When I want to change to 512x512 or any multiple of 64, it doesn't work

Steps to reproduce the problem

.

What should have happened?

.

Commit where the problem happens

ComfyUI:
ComfyUI-layerdiffuse:

Sysinfo

.

Console logs

.

Workflow json file

.

Additional information

No response

[Bug]: error executing Layer Diffuse Encode

What happened?

The node simply doesn´t work, my workflow is quite simple (vide images), anyone? thanks.
Captura de tela 2024-03-08 004514
Untitled

Steps to reproduce the problem

  1. Execute the provided workflow.

What should have happened?

Layer Diffuse Encode should produce an image and a mask.

Commit where the problem happens

ComfyUI: I don´t know.
ComfyUI-layerdiffuse: I don´t know.

Sysinfo

RTX 3060, WINDOWS 11

Console logs

Requested to load SDXL
Loading 1 new model
100%|██████████████████████████████████████████████████████████████████████████████████| 12/12 [00:25<00:00,  2.12s/it]
Requested to load SDXL
Loading 1 new model
100%|████████████████████████████████████████████████████████████████████████████████████| 8/8 [00:18<00:00,  2.26s/it]
Requested to load AutoencoderKL
Loading 1 new model
2024-03-08 01:00:16,298 - root - ERROR - !!! Exception during processing !!!
2024-03-08 01:00:16,530 - root - ERROR - Traceback (most recent call last):
  File "D:\AI_STUFF\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI_STUFF\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI_STUFF\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_ezXY\autoCastPatch.py", line 299, in map_node_over_list
    return _map_node_over_list(obj, input_data_all, func, allow_interrupt)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI_STUFF\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI_STUFF\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\layered_diffusion.py", line 109, in decode
    FUNCTION = "decode"

  File "D:\AI_STUFF\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 242, in __init__
    model.load_state_dict(sd, strict=True)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI_STUFF\ComfyUI_windows_portable\python_embeded\Lib\site-packages\diffusers\configuration_utils.py", line 636, in inner_init
    init(self, *args, **init_kwargs)
  File "D:\AI_STUFF\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 131, in __init__
    in_channels=block_out_channels[-1],
                 ^^^^^^^^^^^^^^^^^^^^^^
TypeError: UNetMidBlock2D.__init__() got an unexpected keyword argument 'attn_groups'

Prompt executed in 67.34 seconds
2024-03-08 01:00:16,771 - asyncio - ERROR - Task exception was never retrieved
future: <Task finished name='Task-1329' coro=<RequestHandler.start() done, defined at D:\AI_STUFF\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\web_protocol.py:481> exception=AssertionError()>
Traceback (most recent call last):
  File "D:\AI_STUFF\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\web_protocol.py", line 524, in start
    request = self._request_factory(message, payload, self, writer, handler)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\AI_STUFF\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\web_app.py", line 485, in _make_request
    return _cls(
           ^^^^^
  File "D:\AI_STUFF\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\web_request.py", line 825, in __init__
    super().__init__(*args, **kwargs)
  File "D:\AI_STUFF\ComfyUI_windows_portable\python_embeded\Lib\site-packages\aiohttp\web_request.py", line 195, in __init__
    assert transport is not None
           ^^^^^^^^^^^^^^^^^^^^^
AssertionError

Workflow json file

LAYER_DIFF_WORKFLOW (1).json

Additional information

No response

Error occurred when executing LayeredDiffusionApply

What happened?

屏幕截图 2024-03-13 092829
ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\layered_diffusion.py", line 417, in apply_layered_diffusion
assert get_model_sd_version(model) == ld_model.sd_version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

Steps to reproduce the problem

  1. start the ComfyUI, use the example workflow, can get the ERROR

What should have happened?

have no idea

Commit where the problem happens

ComfyUI:
ComfyUI-layerdiffuse:

Sysinfo

windows:rtx4080

Console logs

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
  File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\layered_diffusion.py", line 421, in apply_layered_diffusion
    return ld_model.apply_layered_diffusion(model, weight)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-layerdiffuse\layered_diffusion.py", line 326, in apply_layered_diffusion
    layer_lora_state_dict = load_layer_model_state_dict(model_path)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\comfy\utils.py", line 13, in load_torch_file
    sd = safetensors.torch.load_file(ckpt, device=device.type)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\safetensors\torch.py", line 308, in load_file
    with safe_open(filename, framework="pt", device=device) as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
safetensors_rust.SafetensorError: Error while deserializing header: MetadataIncompleteBuffer

Prompt executed in 4.21 seconds

Workflow json file

layer_diffusion_fg_example.json

Additional information

No response

[Bug]: SD 1.5 does not work when used with AnimateDiff.

What happened?

SD 1.5 does not work when used with AnimateDiff. SDXL works well.
workflow (46)
workflow (47)

SDXL result

005639__00001.mp4

Steps to reproduce the problem

Add a layer diffuse apply node(sd 1.5) to the animatediff workflow.

What should have happened?

There should be no errors.

Commit where the problem happens

ComfyUI: 2a813c3b09292c9aeab622ddf65d77e5d8171d0d
ComfyUI-layerdiffuse: 151f746

Sysinfo

OS : win 10
gpu : nvidia 3090ti

Console logs

Error occurred when executing KSampler:

An xformers bug was encountered in AnimateDiff - this is unexpected, report this to Kosinkadink/ComfyUI-AnimateDiff-Evolved repo as an issue, and a workaround for now is to run ComfyUI with the --disable-xformers argument.

File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\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:\Comfy\ComfyUI_windows_portable_2\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\nodes.py", line 1369, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\nodes.py", line 1339, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 22, in informative_sample
raise e
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample
return original_sample(*args, **kwargs) # This code helps interpret error messages that occur within exceptions but does not have any impact on other operations.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\sampling.py", line 346, in motion_sample
latents = wrap_function_to_inject_xformers_bug_info(orig_comfy_sample)(model, noise, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Comfy\ComfyUI_windows_portable_2\ComfyUI\custom_nodes\ComfyUI-AnimateDiff-Evolved\animatediff\utils_model.py", line 363, in wrapped_function
raise RuntimeError(f"An xformers bug was encountered in AnimateDiff - this is unexpected, \

Workflow json file

workflow (41).json

Additional information

No response

Import failed

This is the message on the console.

Traceback (most recent call last):
File "C:\Users\yamat\Desktop\ComfyUI\nodes.py", line 1887, 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:\Users\yamat\Desktop\ComfyUI\custom_nodes\ComfyUI-layerdiffusion_init
.py", line 1, in
from .layered_diffusion import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
File "C:\Users\yamat\Desktop\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\layered_diffusion.py", line 13, in
from .lib_layerdiffusion.utils import (
File "C:\Users\yamat\Desktop\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\utils.py", line 3, in
import cv2
ModuleNotFoundError: No module named 'cv2'

Cannot import C:\Users\yamat\Desktop\ComfyUI\custom_nodes\ComfyUI-layerdiffusion module for custom nodes: No module named 'cv2'

Loading: ComfyUI-Manager (V2.8.3)

ComfyUI Revision: 2036 [1abf8374] | Released on '2024-03-02'

Import times for custom nodes:
0.0 seconds (IMPORT FAILED): C:\Users\yamat\Desktop\ComfyUI\custom_nodes\ComfyUI-layerdiffusion
0.0 seconds: C:\Users\yamat\Desktop\ComfyUI\custom_nodes\efficiency-nodes-comfyui
0.2 seconds: C:\Users\yamat\Desktop\ComfyUI\custom_nodes\ComfyUI-Manager

Does this work with IPAdapter node?

image

See what I have above:

I tried to put the encoder node before and after the IPAdapters, It seems to have heavy impact on the image rendering. I also tried Attention Injection as well, it got worse.. what did I do wrong? Thanks!

About the generated image quality

Whether providing FG to generate BG or providing BG to generate FG, the provided part in the result has much worse quality than the original, and the generated part in the result also has degraded quality than generating alone. Is this the expected behavior?

Layer Diffusion Decode - unexpected keyword argument 'attn_groups'

ERROR:root:Traceback (most recent call last):
File "D:\comfyui_new\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui_new\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui_new\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui_new\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\layered_diffusion.py", line 112, in decode
self.vae_transparent_decoder = TransparentVAEDecoder(
^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui_new\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 242, in init
model = UNet1024(in_channels=3, out_channels=4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\comfyui_new\python_embeded\Lib\site-packages\diffusers\configuration_utils.py", line 636, in inner_init
init(self, *args, **init_kwargs)
File "D:\comfyui_new\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\lib_layerdiffusion\models.py", line 131, in init
self.mid_block = UNetMidBlock2D(
^^^^^^^^^^^^^^^
TypeError: UNetMidBlock2D.init() got an unexpected keyword argument 'attn_groups'

ComfyUI-startup

Total VRAM 8192 MB, total RAM 32653 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3070 : cudaMallocAsync
VAE dtype: torch.bfloat16
Using pytorch cross attention
ComfyUI Revision: 2046 [a38b9b3a] | Released on '2024-03-04'

"Layer Diffuse Apply" Node is working as expected.

[Bug]: The Issue of y.shape[1] == 4 and Directml, a lack of torch.median() and the solution.

What happened?

Everyone on Directml will fail to use this node encountering the tuple error.

Steps to reproduce the problem

Be me.
Be everyone using DirectML.
???
Don't profit. Ever.

What should have happened?

Alpha Translucentiation

Commit where the problem happens

ComfyUI:
ComfyUI-layerdiffuse:

Sysinfo

AMD, DirectML, Pain Incarnate.

Console logs

-

Workflow json file

Additional information

I had posted about this on forge's layerdiffuse and totally forgot, my bad. There I detail the exact cause of the problem and the workaround: layerdiffusion/sd-forge-layerdiffuse#10 (comment)

tl;dr: on line 300 of lib_layerdiffusion\modesl.py , median = torch.median(result, dim=0).values FAILS. DirectML doesn't know torch.median() . The solution is to cast the previous line .to("cpu") and the next line back .to(self.load_device)

So, lines 299, 300, 301 look like this:
result = torch.stack(result, dim=0).to("cpu")
median = torch.median(result, dim=0).values
return median.to(self.load_device)

[Bug]: When the resolution is not 1024x1024, an error message is displayed.

What happened?

When the input image resolution is not 1024x1024 at node layerDiffusionDiffApply, an error message is displayed.
image
, use nodes to change the resolution by upscalelatent,the first error pass,but comming nex one,node layerDiffuseDecode report
image
The resolution that reported an error is 1366x768.
I checked to make sure the resolutions match, but only 1024x1024 resolution works fine.

Steps to reproduce the problem

/

What should have happened?

/

Commit where the problem happens

ComfyUI:
ComfyUI-layerdiffuse:

Sysinfo

Error occurred when executing LayeredDiffusionDiffApply:

Sizes of tensors must match except in dimension 1. Expected size 170 but got size 171 for tensor number 1 in the list.

File "H:\diffusion\lcm\ComfyUI\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)

File "H:\diffusion\lcm\ComfyUI\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H:\diffusion\lcm\ComfyUI\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "H:\diffusion\lcm\ComfyUI\ComfyUI\custom_nodes\ComfyUI-layerdiffusion\layered_diffusion.py", line 392, in apply_layered_diffusion
torch.cat([latent["samples"], blended_latent["samples"]], dim=1)
image

Console logs

/

Workflow json file

/

Additional information

No response

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.