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

Get Sigma is broken after recent update #25

Open Davikar opened 3 months ago

Davikar commented 3 months ago

The Get Sigma node is broken since one of the recent updates to ComfyUI (along with many other extensions): https://github.com/comfyanonymous/ComfyUI/commit/57753c964affd18d2b87d2a47fe6b375bca39004

Error occurred when executing BNK_GetSigma:

'BaseModel' object has no attribute 'get_model_object'

File "C:\AI\ComfyUI\ComfyUI\execution.py", line 151, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\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\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\ComfyUI\custom_nodes\ComfyUI_Noise\nodes.py", line 142, in calc_sigma
sampler = comfy.samplers.KSampler(real_model, steps=steps, device=device, sampler=sampler_name, scheduler=scheduler, denoise=1.0, model_options=model.model_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\ComfyUI\comfy\samplers.py", line 705, in __init__
self.set_steps(steps, denoise)
File "C:\AI\ComfyUI\ComfyUI\comfy\samplers.py", line 726, in set_steps
self.sigmas = self.calculate_sigmas(steps).to(self.device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\ComfyUI\comfy\samplers.py", line 717, in calculate_sigmas
sigmas = calculate_sigmas(self.model.get_model_object("model_sampling"), self.scheduler, steps)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\AI\ComfyUI\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1688, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")

(There may be other nodes affected, but this is the one is the first I noticed.)

Blakeem commented 3 months ago

I have a pull request, that should fix this specific error. https://github.com/BlenderNeko/ComfyUI_Noise/pull/29