lllyasviel / lllyasviel/ControlNet

Error completing request when using reference_only with MasaCtrl

Open
#466 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
34.1k
Forks
3k
PR merge metrics
No merged PRs in 30d

Description

environment
- [AUTOMATIC1111/stable-diffusion-webui Commit hash: 394ffa7b0a7fff3ec484bcd084e673a8b301ccc8](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
- [ControlNet v1.1](https://github.com/Mikubill/sd-webui-controlnet)
- [MasaCtrl](https://github.com/ashen-sensored/sd_webui_masactrl)
- Running on Ubuntu and python3.10.6
- [7th_layer_v3_C](https://huggingface.co/syaimu/7th_Layer/tree/main/7th_anime_v3)

I try to use reference_only preprocessor with MasaCtrl.
When I logging with MasaCtrl, no error occurred.
But when I recon, the error occurred.

Here is error log.
```
*** Error completing request
*** Arguments: ('task(p5b2nth0uy9u0fw)', 'masterpiece, best quality, simple background, face up ,blue hair, green eyes, 1 girl, smile', 'EasyNegativeV2', [], 20, 0, False, False, 1, 1, 7, 1436563493.0, -1.0, 0, 0, 0, False, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 0, '', '', [], 0, True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', , 1, 5.0, 10.0, 0.1, '19', False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False, False, False, '#000000', False, None, None, False, 50) {}
Traceback (most recent call last):
File "/home/shalin/stable-diffusion-webui/modules/call_queue.py", line 55, in f
res = list(func(*args, **kwargs))
File "/home/shalin/stable-diffusion-webui/modules/call_queue.py", line 35, in f
res = func(*args, **kwargs)
File "/home/shalin/stable-diffusion-webui/modules/txt2img.py", line 57, in txt2img
processed = processing.process_images(p)
File "/home/shalin/stable-diffusion-webui/modules/processing.py", line 620, in process_images
res = process_images_inner(p)
File "/home/shalin/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/batch_hijack.py", line 42, in processing_process_images_hijack
return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
File "/home/shalin/stable-diffusion-webui/modules/processing.py", line 739, in process_images_inner
samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
File "/home/shalin/stable-diffusion-webui/modules/processing.py", line 992, in sample
samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
File "/home/shalin/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 439, in sample
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
File "/home/shalin/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 278, in launch_sampling
return func()
File "/home/shalin/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 439, in
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
File "/home/shalin/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/shalin/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/sampling.py", line 145, in sample_euler_ancestral
denoised = model(x, sigmas[i] * s_in, **extra_args)
File "/home/shalin/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/shalin/stable-diffusion-webui/modules/sd_samplers_kdiffusion.py", line 158, in forward
x_out = self.inner_model(x_in, sigma_in, cond=make_condition_dict([cond_in], image_cond_in))
File "/home/shalin/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/shalin/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/external.py", line 112, in forward
eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), **kwargs)
File "/home/shalin/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/external.py", line 138, in get_eps
return self.inner_model.apply_model(*args, **kwargs)
File "/home/shalin/stable-diffusion-webui/modules/sd_hijack_utils.py", line 17, in
setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
File "/home/shalin/stable-diffusion-webui/modules/sd_hijack_utils.py", line 28, in __call__
return self.__orig_func(*args, **kwargs)
File "/home/shalin/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 858, in apply_model
x_recon = self.model(x_noisy, t, **cond)
File "/home/shalin/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/shalin/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py", line 1335, in forward
out = self.diffusion_model(x, t, context=cc)
File "/home/shalin/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/shalin/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/hook.py", line 661, in forward_webui
return forward(*args, **kwargs)
File "/home/shalin/stable-diffusion-webui/extensions/sd-webui-controlnet/scripts/hook.py", line 364, in forward
for param in outer.control_params:
File "/home/shalin/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1614, in __getattr__
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'UnetHook' object has no attribute 'control_params'

```

I don`t try other ControlNet model and preprocessor.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with ControlNet's reference_only preprocessor and MasaCtrl using the listed environment. Start at extensions/sd-webui-controlnet/scripts/hook.py around forward and the control_params access, then follow the traceback through the sampling path. Done means the same combination completes a request without the reported AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.