Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suddenly today my controlnet causes my sd webui to freeze after restarting my pc #1220

Closed
MalfreCryvertia opened this issue May 10, 2023 · 5 comments

Comments

@MalfreCryvertia
Copy link

MalfreCryvertia commented May 10, 2023

it is just as usual;

  1. enable controlnet,
  2. put image in,
  3. choose preprocessor
  4. choose model
  5. generate
  6. usually it starts then voila but nope, it does start but immediately stops after 2 seconds, then generate button becomes unfunctional
    if i try generate again, my webui actually freezes and i cannot do anything except restarting

today it suddenly becomes like this even though i changed nothing, no install, no uninstall, no updates on my computer

tried deleting controlnet, restart webui, install controlnet again, put my models in, restart webui, but nope, issue still persists
looked for this kind of issue on github and google search but nothing was similar
"sd webui / a1111 / controlnet + freeze / generate button not working"

would love some help as i use controlnet everyday A LOT haha

@TerrinX
Copy link

TerrinX commented May 10, 2023

me too

@lllyasviel
Copy link
Collaborator

what

@MalfreCryvertia MalfreCryvertia changed the title suddenly today i controlnet causes my sd webui to freeze suddenly today my controlnet causes my sd webui to freeze May 11, 2023
@MalfreCryvertia MalfreCryvertia changed the title suddenly today my controlnet causes my sd webui to freeze suddenly today my controlnet causes my sd webui to freeze, nothing changed May 11, 2023
@MalfreCryvertia MalfreCryvertia changed the title suddenly today my controlnet causes my sd webui to freeze, nothing changed suddenly today my controlnet causes my sd webui to freeze after restarting my pc May 11, 2023
@MalfreCryvertia
Copy link
Author

MalfreCryvertia commented May 11, 2023

what

exactly what i described, i went to work so i turned off my pc, then when im back, turned it on, suddenly it becomes like this

and there is no error code or explanation at all, it just.. stops and wont generate a thing

@huchenlei
Copy link
Collaborator

Here are some approaches you can try:

  • Trying to narrow down the cause. Do a fresh WebUI checkout, does it work? Only install controlnet extension (latest version), does it work?
  • Roll back to an older version of controlnet (You can do this by getting older version hashes through git log --oneline, and git checkout {version hash} to load specific version within extensions/sd-webui-controlnet directory.
  • Attach the console log so that we can have more context.
  • Sometimes WebUI freezes in the commandline. You just to need press Enter to unblock it.

@MalfreCryvertia
Copy link
Author

MalfreCryvertia commented May 12, 2023

maybe if this is relevant, i used these commands in my webui-user.bat at first before any problems pop up
set COMMANDLINE_ARGS=--no-half-vae --medvram --xformers --opt-sdp-attention
the problem suddenly happened on v1.1.160

here is what i did since last comment

  1. fresh installed new sd webui on a separate folder using a1111 sd webui, then use canny preprocessor and model,
    error exceptions in ASGI application then in webui the generate button appears again as if it was interrupted but commandline is showing the generation is still working and after i waited, the image is generated
    so it half works?

  2. trying lineart preprocessor and model, it downloaded some annotator netG.pth with a size of 208mb, then back to previous problem of it immediately stops and freezes my webui, so i restarted the commandline, problem still persists. Did this a few times and the controlnet version keeps changing as i install it using different ways. from inside a1111 extens load, copy github link to a1111 or download file from github and load locally. versions that appeared as i kept trying was v1.1.150, v1.1.160, and v1.1.500

when i try to use any controlnet
TypeError: Expected state_dict to be dict-like, got <class 'NoneType'>.

this error too when i try to generate without controlnet from this point on
RuntimeError: Input type (struct c10::Half) and bias type (float) should be the same

  1. found this thread RuntimeError: Input type (c10::Half) and bias type (float) should be the same Stability-AI/stablediffusion#155 but
    a. add/remove set ATTN_PRECISION=fp16 and --no-half-vae but same error, no changes,
    b. using --disable-safe-upickle doesnt work
    c. xformers was working as implied on 1. so i doubt this is the problem

0%| | 0/20 [00:02<?, ?it/s]
Error completing request
Arguments: ('task(5xgjtsgpn2adwro)', 'masterpiece, twin braids, blonde hair, colored eyelashes, 1girl, ', '', [], 20, 6, False, False, 2, 1, 7, -1.0, -1.0, 0, 0, 0, False, 640, 512, False, 0.6, 1.5, 'Latent', 13, 0, 0, [], 0, 0, 0, 0, 0, 0.25, False, False, 'MultiDiffusion', False, False, 1024, 1024, 48, 48, 24, 1, 'None', 1.5, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1.0, False, 24, 24, True, True, True, False, False, 7, 100, 'Constant', 0, 'Constant', 0, 4, <controlnet.py.UiControlNetUnit object at 0x000002554FDBF1C0>, <controlnet.py.UiControlNetUnit object at 0x0000025559F36140>, <controlnet.py.UiControlNetUnit object at 0x0000025559F37970>, <controlnet.py.UiControlNetUnit object at 0x0000025559F374C0>, 'NONE:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\nALL:1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\nINS:1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0\nIND:1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0\nINALL:1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0\nMIDD:1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0\nOUTD:1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0\nOUTS:1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1\nOUTALL:1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1\nALL0.5:0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5', False, 0, 'values', '0,0.25,0.5,0.75,1', 'Block ID', 'IN05-OUT05', 'none', '', '0.5,1', 'BASE,IN00,IN01,IN02,IN03,IN04,IN05,IN06,IN07,IN08,IN09,IN10,IN11,M00,OUT00,OUT01,OUT02,OUT03,OUT04,OUT05,OUT06,OUT07,OUT08,OUT09,OUT10,OUT11', 1.0, 'black', '20', False, 'ATTNDEEPON:IN05-OUT05:attn:1\n\nATTNDEEPOFF:IN05-OUT05:attn:0\n\nPROJDEEPOFF:IN05-OUT05:proj:0\n\nXYZ:::1', False, False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, 'Blur First V1', 0.25, 10, 10, 10, 10, 1, False, '', '', 0.5, 1, False, '', 5, 24, 12.5, 1000, '', 'DDIM', 0, 64, 64, '', 64, 7.5, 0.42, 'DDIM', 64, 64, 1, 0, 92, True, True, True, False, False, False, 'midas_v21_small', False, True, False, True, True, 'Create in UI', False, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', None, False, None, False, None, False, None, False, 50) {}
Traceback (most recent call last):
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\txt2img.py", line 56, in txt2img
processed = process_images(p)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\processing.py", line 515, in process_images
res = process_images_inner(p)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\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 "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\processing.py", line 669, in process_images_inner
samples_ddim = p.sample(conditioning=c, unconditional_conditioning=uc, seeds=seeds, subseeds=subseeds, subseed_strength=p.subseed_strength, prompts=prompts)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\processing.py", line 887, in sample
samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\sd_samplers_kdiffusion.py", line 377, in sample
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\sd_samplers_kdiffusion.py", line 251, in launch_sampling
return func()
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\sd_samplers_kdiffusion.py", line 377, in
samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args={
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\repositories\k-diffusion\k_diffusion\sampling.py", line 555, in sample_dpmpp_sde
callback({'x': x, 'i': i, 'sigma': sigmas[i], 'sigma_hat': sigmas[i], 'denoised': denoised})
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\sd_samplers_kdiffusion.py", line 237, in callback_state
sd_samplers_common.store_latent(latent)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\sd_samplers_common.py", line 58, in store_latent
shared.state.assign_current_image(sample_to_image(decoded))
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\sd_samplers_common.py", line 46, in sample_to_image
return single_sample_to_image(samples[index], approximation)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\sd_samplers_common.py", line 35, in single_sample_to_image
x_sample = sd_vae_approx.model()(sample.to(devices.device, devices.dtype).unsqueeze(0))[0].detach()
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\modules\sd_vae_approx.py", line 28, in forward
x = layer(x)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\extensions-builtin\Lora\lora.py", line 323, in lora_Conv2d_forward
return torch.nn.Conv2d_forward_before_lora(self, input)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\extensions\a1111-sd-webui-lycoris\lycoris.py", line 746, in lyco_Conv2d_forward
return torch.nn.Conv2d_forward_before_lyco(self, input)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\venv\lib\site-packages\torch\nn\modules\conv.py", line 463, in forward
return self._conv_forward(input, self.weight, self.bias)
File "F:\Downloads TUP\NAI\HDiffusion\SD Webui2\venv\lib\site-packages\torch\nn\modules\conv.py", line 459, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Input type (struct c10::Half) and bias type (float) should be the same

  1. removed controlnet again, add --disable-safe-unpickle, then restart commandline. This somehow got my normal generate to work again but it kinda slows down my speed a bit by 10%,
    then reinstall controlnet, this time i got it to work somehow? v1.1.150, installed by copying github link to a1111
    i guess the key was having --disable-safe-unpickle before and after installing controlnet on recent a1111 webui

thanks for the time, attention and help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants