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

TypeError: DoubleStreamBlock.forward() got an unexpected keyword argument 'attn_mask' #160

Open
pendave opened this issue Dec 24, 2024 · 25 comments

Comments

@pendave
Copy link

pendave commented Dec 24, 2024

0%| | 0/20 [00:11<?, ?it/s]
!!! Exception during processing !!! DoubleStreamBlock.forward() got an unexpected keyword argument 'attn_mask'
Traceback (most recent call last):
File "E:\ComfyUI_Portable\ComfyUI\execution.py", line 328, in execute
output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, p
re_execute_cb=pre_execute_cb)
File "E:\ComfyUI_Portable\ComfyUI\execution.py", line 203, in get_output_data
return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=exec
ution_block_cb, pre_execute_cb=pre_execute_cb)
File "E:\ComfyUI_Portable\ComfyUI\execution.py", line 174, in map_node_over_list
process_inputs(input_dict, i)
File "E:\ComfyUI_Portable\ComfyUI\execution.py", line 163, in process_inputs
results.append(getattr(obj, func)(**inputs))
File "E:\ComfyUI_Portable\ComfyUI\nodes.py", line 1503, in sample
return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=d
enoise)
File "E:\ComfyUI_Portable\ComfyUI\nodes.py", line 1470, in common_ksampler
samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
File "E:\ComfyUI_Portable\ComfyUI\comfy\sample.py", line 43, in sample
samples = sampler.sample(noise, positive, negative, 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, disabl
e_pbar=disable_pbar, seed=seed)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 1013, in sample
return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_i
mage=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 911, in sample
return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 897, in sample
output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
File "E:\ComfyUI_Portable\ComfyUI\comfy\patcher_extension.py", line 110, in execute
return self.original(*args, **kwargs)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 866, in outer_sample
output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)

File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 850, in inner_sample
samples = executor.execute(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
File "E:\ComfyUI_Portable\ComfyUI\comfy\patcher_extension.py", line 110, in execute
return self.original(*args, **kwargs)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 707, 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_Portable\python_embeded\Lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "E:\ComfyUI_Portable\ComfyUI\comfy\k_diffusion\sampling.py", line 155, in sample_euler
denoised = model(x, sigma_hat * s_in, **extra_args)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 379, in call
out = self.inner_model(x, sigma, model_options=model_options, seed=seed)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 832, in call
return self.predict_noise(*args, **kwargs)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 835, in predict_noise
return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive",
None), self.cfg, model_options=model_options, seed=seed)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 359, in sampling_function
out = calc_cond_batch(model, conds, x, timestep, model_options)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 195, in calc_cond_batch
return executor.execute(model, conds, x_in, timestep, model_options)
File "E:\ComfyUI_Portable\ComfyUI\comfy\patcher_extension.py", line 110, in execute
return self.original(*args, **kwargs)
File "E:\ComfyUI_Portable\ComfyUI\comfy\samplers.py", line 308, in calc_cond_batch
output = model.apply_model(input_x, timestep
, **c).chunk(batch_chunks)
File "E:\ComfyUI_Portable\ComfyUI\comfy\model_base.py", line 129, in apply_model
return comfy.patcher_extension.WrapperExecutor.new_class_executor(
File "E:\ComfyUI_Portable\ComfyUI\comfy\patcher_extension.py", line 110, in execute
return self.original(*args, **kwargs)
File "E:\ComfyUI_Portable\ComfyUI\comfy\model_base.py", line 158, in _apply_model
model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options
, **extra_conds).float()
File "E:\ComfyUI_Portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_im
pl
return self._call_impl(*args, **kwargs)
File "E:\ComfyUI_Portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "E:\ComfyUI_Portable\ComfyUI\comfy\ldm\flux\model.py", line 204, in forward
out = self.forward_orig(img, img_ids, context, txt_ids, timestep, y, guidance, control, transformer_options, attn_ma
sk=kwargs.get("attention_mask", None))
File "E:\ComfyUI_Portable\ComfyUI\comfy\ldm\flux\model.py", line 143, in forward_orig
img, txt = block(img=img,
File "E:\ComfyUI_Portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_im
pl
return self._call_impl(*args, **kwargs)
File "E:\ComfyUI_Portable\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
TypeError: DoubleStreamBlock.forward() got an unexpected keyword argument 'attn_mask'

image

@craftogrammer
Copy link

craftogrammer commented Dec 24, 2024

I am also getting the same issue.

image

!!! Exception during processing !!! DoubleStreamBlock.forward() got an unexpected keyword argument 'attn_mask' Traceback (most recent call last): File "D:\ComfyUI\execution.py", line 328, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\execution.py", line 203, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\execution.py", line 174, in _map_node_over_list process_inputs(input_dict, i) File "D:\ComfyUI\execution.py", line 163, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy_extras\nodes_custom_sampler.py", line 633, in sample samples = guider.sample(noise.generate_noise(latent), latent_image, sampler, sigmas, denoise_mask=noise_mask, callback=callback, disable_pbar=disable_pbar, seed=noise.seed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\samplers.py", line 897, in sample output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\patcher_extension.py", line 110, in execute return self.original(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\samplers.py", line 866, in outer_sample output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\samplers.py", line 850, in inner_sample samples = executor.execute(self, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\patcher_extension.py", line 110, in execute return self.original(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\samplers.py", line 707, 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:\ComfyUI\venv\Lib\site-packages\torch\utils\_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\k_diffusion\sampling.py", line 1098, in sample_deis denoised = model(x_cur, t_cur * s_in, **extra_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\samplers.py", line 379, in __call__ out = self.inner_model(x, sigma, model_options=model_options, seed=seed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\samplers.py", line 832, in __call__ return self.predict_noise(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\samplers.py", line 835, in predict_noise return sampling_function(self.inner_model, x, timestep, self.conds.get("negative", None), self.conds.get("positive", None), self.cfg, model_options=model_options, seed=seed) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\samplers.py", line 359, in sampling_function out = calc_cond_batch(model, conds, x, timestep, model_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\samplers.py", line 195, in calc_cond_batch return executor.execute(model, conds, x_in, timestep, model_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\patcher_extension.py", line 110, in execute return self.original(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\samplers.py", line 308, in _calc_cond_batch output = model.apply_model(input_x, timestep_, **c).chunk(batch_chunks) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\model_base.py", line 130, in apply_model return comfy.patcher_extension.WrapperExecutor.new_class_executor( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\patcher_extension.py", line 110, in execute return self.original(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\model_base.py", line 159, in _apply_model model_output = self.diffusion_model(xc, t, context=context, control=control, transformer_options=transformer_options, **extra_conds).float() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\venv\Lib\site-packages\torch\_dynamo\eval_frame.py", line 576, in _fn return fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\comfy\ldm\flux\model.py", line 189, in forward def forward(self, x, timestep, context, y, guidance, control=None, transformer_options={}, **kwargs): File "D:\ComfyUI\comfy\ldm\flux\model.py", line 143, in forward_orig img, txt = block(img=img, ^^^^^^^^^^^^^^ File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ComfyUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1750, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: DoubleStreamBlock.forward() got an unexpected keyword argument 'attn_mask'

@rollingcookies
Copy link

Same problem! Recently updated Comfy, maybe it is connected with it?

@Moxie1776
Copy link

Following, same.

@h3clikejava
Copy link

same

1 similar comment
@vmasrani
Copy link

same

@africa1207
Copy link

same here

@dxdpxl
Copy link

dxdpxl commented Jan 1, 2025

exactly the same

@dxdpxl
Copy link

dxdpxl commented Jan 1, 2025

A reset to ComfyUI v.3.0.7 with "git checkout v0.3.7" inside the lower comfyui folder and we can continue using x-flux. Thanks to the guys who posted the solution in a ComfyUI-PuLID-Flux-Enhanced issue thread. Hope they will fix it soon!

@mayo-Z
Copy link

mayo-Z commented Jan 3, 2025

same

@adgbit
Copy link

adgbit commented Jan 3, 2025

@dxdpxl Thanks Man for Share

@amirabbbbas
Copy link

Here's the option in the comfyui for downgrading to 0.3.7 which solved the problem
image
image

@pendave
Copy link
Author

pendave commented Jan 6, 2025

Here's the option in the comfyui for downgrading to 0.3.7 which solved the problem image image

image
How could I let "Switch ComfyUI" displayed?

@dxdpxl
Copy link

dxdpxl commented Jan 6, 2025

How could I let "Switch ComfyUI" displayed?

I don't know about your question, maybe this future is only available in the latest version of comfyui...

but to get you to downgrade comyfui, do the following:
fully close comfyui and go into your lower comfyui folder "X:\ComfyUI\ComfyUI" (while X is the drive where you installed it), now left-click into the adressbar of the ComfyUI folder and write "cmd" and press enter (without quotation marks), in the following opened cmd window enter "git checkout v0.3.7" (again without quotation marks) and press enter, wait until its finished, voila comfyui is downgraded.

comfy

@pendave
Copy link
Author

pendave commented Jan 6, 2025

How could I let "Switch ComfyUI" displayed?

I don't know about your question, maybe this future is only available in the latest version of comfyui...

but to get you to downgrade comyfui, do the following: fully close comfyui and go into your lower comfyui folder (note lowercase letters), left-click into the adressbar of the comfyui folder and write "cmd" and press enter (without quotation marks), in the following opened cmd window enter "git checkout v0.3.7" (again without quotation marks) and press enter, wait until its finished, voila comfyui is downgraded.

image

Actually I updated ComfyUI version to the latest:

Loading: ComfyUI-Manager (V2.55.4)

ComfyUI Version: v0.3.10-35-g916d1e1 | Released on '2025-01-06'

But I can't find the lower comfyui folder, you can see that above.

@dxdpxl
Copy link

dxdpxl commented Jan 6, 2025

You are already in the right folder "E:\ComfyUI\ComfyUI"

Sorry for the confusion, mine is only lowercase, I don't know why, but I will correct my advice.

@pendave
Copy link
Author

pendave commented Jan 6, 2025

You are already in the right folder "E:\ComfyUI\ComfyUI"

Sorry for the confusion, mine is only lowercase, I don't know why, but I will correct my advice.

I always execute CMD that way. But

E:\ComfyUI_Portable\ComfyUI>git checkout v0.3.7
error: Your local changes to the following files would be overwritten by checkout:
folder_paths.py
Please commit your changes or stash them before you switch branches.
Aborting

E:\ComfyUI_Portable\ComfyUI>

Maybe I could download V0.3.7 from ComfyUI Release https://github.com/comfyanonymous/ComfyUI/releases and put it another path, then mklink and share the models etc. resources from the E:\ComfyUI_Portable one. Hope the coder fixes the bug in the future.

@dxdpxl
Copy link

dxdpxl commented Jan 6, 2025

I always execute CMD that way.

Sorry then i can't help, I don't know anything about this error. I attached a photo of what it should look like...

comfy1

@amirabbbbas
Copy link

Here's the option in the comfyui for downgrading to 0.3.7 which solved the problem image image

image How could I let "Switch ComfyUI" displayed?

First Update all and choose every update option that you see , restart and then the option will appear for you

@dxdpxl
Copy link

dxdpxl commented Jan 6, 2025

I always execute CMD that way.

Did you edited/changed anything inside the folder_paths.py?

Maybe try to delete (backup!) the problematic file...
Then cmd run git reset --hard and after that the checkout again

@Aloukik21
Copy link

any good solution yet?

@ryujongsu
Copy link

I did Update ComplyUI and it was solved.

@rollingcookies
Copy link

I did Update ComplyUI and it was solved.

What version/commit did you upgrade to?

image

@dxdpxl
Copy link

dxdpxl commented Jan 10, 2025

I did Update ComplyUI and it was solved.

No it's not solved! It happens with every version above 0.3.7! I update daily to test it.

Seems like this Git is dead and won't get any updates...

@adgbit
Copy link

adgbit commented Jan 10, 2025

Sorry so much I know this is GitHub no Twitter but....... Generally, it's virtually impossible to be productive with UncomfyUI. As an artist, I understand that programs like HoudiniFX, Maya, Nuke, and Flame are complex, but this UncomfyUI nightmare makes no sense. There are too many technical hurdles to overcome just to create a single image; something is always broken. Most artists rely on a tech-savvy person to set up the workflow. No matter what you do with cfgs, Denoise, IPAdapter, ControlNet, or how well you think you understand it, you'll spend countless hours and days trying to achieve anything. It's completely illogical.

@rollingcookies
Copy link

Sorry so much I know this is GitHub no Twitter but....... Generally, it's virtually impossible to be productive with UncomfyUI. As an artist, I understand that programs like HoudiniFX, Maya, Nuke, and Flame are complex, but this UncomfyUI nightmare makes no sense. There are too many technical hurdles to overcome just to create a single image; something is always broken. Most artists rely on a tech-savvy person to set up the workflow. No matter what you do with cfgs, Denoise, IPAdapter, ControlNet, or how well you think you understand it, you'll spend countless hours and days trying to achieve anything. It's completely illogical.

Another fighter has given up :')

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