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

comfy.sample has no attribute 'broadcast_cond' #25

Open
TaeoG opened this issue Oct 25, 2023 · 7 comments
Open

comfy.sample has no attribute 'broadcast_cond' #25

TaeoG opened this issue Oct 25, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@TaeoG
Copy link

TaeoG commented Oct 25, 2023

given what I've read in some of your closed issues, it looks like comfyui may have changed something in the backend on their newest version? Using your tiled ksampler directly, or through efficiency nodes or impact pack, all throw this error

Error occurred when executing BNK_TiledKSampler:

module 'comfy.sample' has no attribute 'broadcast_cond'

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, 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 76, 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_TiledKSampler\nodes.py", line 315, in sample
return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 180, in sample_common
positive_copy = comfy.sample.broadcast_cond(positive, shape[0], device)
@EricRollei
Copy link

I think I'm having the same error and this is after the latest ComfyUI update:
Comfyanonymous wrote, "That function isn't needed anymore" whatever that means.

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
File "A:\Comfy_Aug\ComfyUI[execution.py](http://execution.py/)", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "A:\Comfy_Aug\ComfyUI[execution.py](http://execution.py/)", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "A:\Comfy_Aug\ComfyUI[execution.py](http://execution.py/)", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "A:\Comfy_Aug\ComfyUI\custom_nodes\ComfyUI_TiledKSampler[nodes.py](http://nodes.py/)", line 346, in sample
return sample_common(model, add_noise, noise_seed, tile_width, tile_height, tiling_strategy, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, start_at_step, end_at_step, return_with_leftover_noise, denoise=1.0, preview= preview == 'enable')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "A:\Comfy_Aug\ComfyUI\custom_nodes\ComfyUI_TiledKSampler[nodes.py](http://nodes.py/)", line 180, in sample_common
positive_copy = comfy.sample.broadcast_cond(positive, shape[0], device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'comfy.sample' has no attribute 'broadcast_cond'

@BlenderNeko BlenderNeko self-assigned this Oct 25, 2023
@BlenderNeko BlenderNeko added the bug Something isn't working label Oct 25, 2023
@BlenderNeko
Copy link
Owner

It should now work again and be compatible with at least control nets and T2I, I will need to double check other features, but only have time somewhere next week so leaving this issue open for now.

@michaelLochlann
Copy link

not "broadcast_cond" but "convert_cond", however, I am assuming it's a related issue so posting it here too.
Does it on my file as well as the example file on this here git without changing anything. I just installed it fresh today, have never used it before.

Error occurred when executing BNK_TiledKSampler:

module 'comfy.sample' has no attribute 'convert_cond'

File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 81, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 74, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 312, in sample
return sample_common(model, 'enable', seed, tile_width, tile_height, tiling_strategy, steps_total, cfg, sampler_name, scheduler, positive, negative, latent_image, steps_total-steps, steps_total, 'disable', denoise=1.0, preview=True)
File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_TiledKSampler\nodes.py", line 120, in sample_common
positive_copy = comfy.sample.convert_cond(positive)

@BlenderNeko
Copy link
Owner

@michaelLochlann make sure your comfyui is up to date

@ghost
Copy link

ghost commented Oct 31, 2023

Still an issue after uptaded Comfyui and python dependencies. I also updated all custom nodes.

@michaelLochlann
Copy link

michaelLochlann commented Oct 31, 2023

The last change to the comfyui sample module was "Refactor to make it easier to add custom conds to models." So that probably broke it.

The weird thing is convert_cond is still on the sample.py file if you search the Comfyui github.

convert_cond found here:
https://github.com/comfyanonymous/ComfyUI/blob/c837a173fab41b7132a72ab01b256b714bd6adb2/comfy/sample.py#L44

@BlenderNeko
Copy link
Owner

@michaelLochlann convert_cond is the name of the new function you're now supposed to call, it is broadcast_cond that got refactored out by it (which is no longer in the file, hence the errors). If it complains about broadcast_cond, you're probably running outdated custom nodes, if it complains about convert_cond you're probably running on an outdated commit of comfyui. If it doesn't complain you're either running outdated everything or updated everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants