LucianoCirino/efficiency-nodes-comfyui

Error occurred when executing KSampler Adv. (Efficient): 'ModuleList' object has no attribute '1'

Closed this issue · 3 comments

Error occurred when executing KSampler Adv. (Efficient):

'ModuleList' object has no attribute '1'

  File "/home/polarisfx/ComfyUI/execution.py", line 153, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "/home/polarisfx/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 "/home/polarisfx/ComfyUI/execution.py", line 76, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "/home/polarisfx/ComfyUI/custom_nodes/efficiency-nodes-comfyui/efficiency_nodes.py", line 2173, in sample_adv
    return super().sample(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative,
  File "/home/polarisfx/ComfyUI/custom_nodes/efficiency-nodes-comfyui/efficiency_nodes.py", line 700, in sample
    samples, images, gifs, preview = process_latent_image(model, seed, steps, cfg, sampler_name, scheduler,
  File "/home/polarisfx/ComfyUI/custom_nodes/efficiency-nodes-comfyui/efficiency_nodes.py", line 537, in process_latent_image
    samples = KSamplerAdvanced().sample(model, add_noise, seed, steps, cfg, sampler_name, scheduler,
  File "/home/polarisfx/ComfyUI/nodes.py", line 1271, in sample
    return common_ksampler(model, noise_seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise, disable_noise=disable_noise, start_step=start_at_step, last_step=end_at_step, force_full_denoise=force_full_denoise)
  File "/home/polarisfx/ComfyUI/nodes.py", line 1207, in common_ksampler
    samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
  File "/home/polarisfx/ComfyUI/custom_nodes/ComfyUI-Impact-Pack/modules/impact/sample_error_enhancer.py", line 9, in informative_sample
    return original_sample(*args, **kwargs)
  File "/home/polarisfx/ComfyUI/comfy/sample.py", line 100, in sample
    samples = sampler.sample(noise, positive_copy, negative_copy, 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, disable_pbar=disable_pbar, seed=seed)
  File "/home/polarisfx/ComfyUI/comfy/samplers.py", line 728, in sample
    return sample(self.model, noise, positive, negative, cfg, self.device, sampler(), sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
  File "/home/polarisfx/ComfyUI/comfy/samplers.py", line 619, in sample
    pre_run_control(model_wrap, negative + positive)
  File "/home/polarisfx/ComfyUI/comfy/samplers.py", line 447, in pre_run_control
    x['control'].pre_run(model.inner_model.inner_model, percent_to_timestep_function)
  File "/home/polarisfx/ComfyUI/comfy/controlnet.py", line 269, in pre_run
    comfy.utils.set_attr(self.control_model, k, self.control_weights[k].to(dtype).to(comfy.model_management.get_torch_device()))
  File "/home/polarisfx/ComfyUI/comfy/utils.py", line 259, in set_attr
    obj = getattr(obj, name)
  File "/home/polarisfx/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1695, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")

SDXL works fine, but everytime I try to use this with 1.5 I get this error.

Turns out this was a Python configuration issue, not an Efficiency issue. Resolved.

hi bro, i am getting the same issue can tell me the process to fix this? if possible tell me the steps. it will be really helpfull to me.

When I first "solved" it, I solved another node error. The problem with all these nodes is they're all under active development and a clone at the wrong time will send you down hours of debugging your whole setup.

This error, Atleast for me was caused by using an sdxl control-net with a 1.5 model. I stupidly downloaded from HF and the filenames were very similar so I didn't realize my error until I found a comment by Ferniclestix on Reddit about someone else doing the same thing and getting the same error.