BlenderNeko / ComfyUI_Noise

6 nodes for ComfyUI that allows for more control and flexibility over noise to do e.g. variations or "un-sampling"
GNU General Public License v3.0
222 stars 19 forks source link

Resolve the 'SDXL' object has no attribute 'get_model_object' with BN… #29

Open Blakeem opened 3 months ago

Blakeem commented 3 months ago

I was getting the following error in ComfyUI.

Error occurred when executing BNK_GetSigma:

'SDXL' object has no attribute 'get_model_object'

File "E:\ComfyUI_windows_portable\ComfyUI\execution.py", line 151, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "E:\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 "E:\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 "E:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_Noise\nodes.py", line 143, in calc_sigma sigmas = sampler.sigmas File "E:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 705, in init self.set_steps(steps, denoise) File "E:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 726, in set_steps self.sigmas = self.calculate_sigmas(steps).to(self.device) File "E:\ComfyUI_windows_portable\ComfyUI\comfy\samplers.py", line 717, in calculate_sigmas sigmas = calculate_sigmas(self.model.get_model_object("model_sampling"), self.scheduler, steps) File "C:\Users\Blake\AppData\Roaming\Python\Python310\site-packages\torch\nn\modules\module.py", line 1695, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")

I found this solution for another node, and implemented it here. I don't think it needs to be backwards compatible?

https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved/pull/337/commits/93af7345219932cbf9789751579e1f52a7ba5957