BlenderNeko/ComfyUI_TiledKSampler

comfy.sample has no attribute 'broadcast_cond'

TaeoG opened this issue · 7 comments

TaeoG commented

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)

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'

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.

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)

@michaelLochlann make sure your comfyui is up to date

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

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

@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.