AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
141.86k stars 26.8k forks source link

[Bug]: TypeError: hijacked_get_learned_conditioning() takes 3 positional arguments but 5 were given #12902

Closed f-rank closed 1 year ago

f-rank commented 1 year ago

Is there an existing issue for this?

What happened?

Updated to 1.6, hitting Generate throws in console. Unchecked extensions but it kept happening.

Steps to reproduce the problem

  1. Start webui
  2. Hit Generate

What should have happened?

a generation

Sysinfo

sysinfo-2023-08-31-12-38.txt

What browsers do you use to access the UI ?

Microsoft Edge

Console logs

(automatic) d:\WORK\conda_envs\automatic\stable-diffusion-webui>call webui.bat
venv "d:\WORK\conda_envs\automatic\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:29:51) [MSC v.1929 64 bit (AMD64)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Launching Web UI with arguments: --xformers --opt-channelslast --vae-path D:\WORK\conda_envs\automatic\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.pt --gfpgan-model D:WORKconda_envsautomaticstable-diffusion-webuimodelsGFPGANGFPGANv1.4.pth
Loading weights [8a02392904] from D:\WORK\conda_envs\automatic\stable-diffusion-webui\models\Stable-diffusion\PHOTO_____\Clarity\clarity_2.safetensors
Creating model from config: D:\WORK\conda_envs\automatic\stable-diffusion-webui\configs\v1-inference.yaml
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 11.2s (prepare environment: 2.1s, import torch: 3.4s, import gradio: 1.4s, setup paths: 0.8s, initialize shared: 0.2s, other imports: 0.6s, setup codeformer: 0.1s, list SD models: 0.2s, load scripts: 1.3s, create ui: 0.5s, gradio launch: 0.6s).
Loading VAE weights from commandline argument: D:\WORK\conda_envs\automatic\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.pt
Applying attention optimization: xformers... done.
Model loaded in 8.1s (load weights from disk: 0.7s, create model: 0.5s, apply weights to model: 1.3s, apply channels_last: 1.0s, load VAE: 0.2s, load textual inversion embeddings: 3.2s, calculate empty prompt: 1.1s).
*** Error completing request
*** Arguments: ('task(7y357lacljgpu0a)', '', '', [], 20, 'Euler a', 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x000001EA31AB8B50>, 0, False, '', 0.8, -1, False, -1, 0, 0, 0, '', False, None, '', 'outputs', 1, 0, 0.25, False, False, 'positive', 'comma', 0, False, False, '', 'Illustration', 'svg', True, True, False, 0.5, True, 16, True, 16, False, 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "D:\WORK\conda_envs\automatic\stable-diffusion-webui\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "D:\WORK\conda_envs\automatic\stable-diffusion-webui\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "D:\WORK\conda_envs\automatic\stable-diffusion-webui\modules\txt2img.py", line 55, in txt2img
        processed = processing.process_images(p)
      File "D:\WORK\conda_envs\automatic\stable-diffusion-webui\modules\processing.py", line 732, in process_images
        res = process_images_inner(p)
      File "D:\WORK\conda_envs\automatic\stable-diffusion-webui\modules\processing.py", line 856, in process_images_inner
        p.setup_conds()
      File "D:\WORK\conda_envs\automatic\stable-diffusion-webui\modules\processing.py", line 1309, in setup_conds
        super().setup_conds()
      File "D:\WORK\conda_envs\automatic\stable-diffusion-webui\modules\processing.py", line 469, in setup_conds
        self.uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, total_steps, [self.cached_uc], self.extra_network_data)
      File "D:\WORK\conda_envs\automatic\stable-diffusion-webui\modules\processing.py", line 455, in get_conds_with_caching
        cache[1] = function(shared.sd_model, required_prompts, steps, hires_steps, shared.opts.use_old_scheduling)
    TypeError: hijacked_get_learned_conditioning() takes 3 positional arguments but 5 were given

---

Additional information

No response

V4nK15h commented 1 year ago

Exact same problem for me, after updating today. Was working fine 12 hours ago. I update on launch so the error has been introduced in the last 12 hours.

First I disabled all Extentions but that solved nothing. Then deleted Venv folder and that also solved nothing. Same error occurs no matter what. Can't generate an image in Txt2Img, or Img2Img without seeing this 'TypeError: hijacked_get_learned_conditioning() takes 3 positional arguments but 5 were given' error.

Seems like a recent update has broken something.

Console Output: Error completing request Arguments: ('task(44zocwmaka87agd)', 'dog', '', [], 20, 'Euler a', 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x000002016E14D1E0>, 0, False, '', 0.8, -1, False, -1, 0, 0, 0, '', False, False, 'positive', 'comma', 0, False, False, '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {} Traceback (most recent call last): File "D:\Data\StableDiffusion15\stable-diffusion-webui\modules\call_queue.py", line 57, in f res = list(func(*args, *kwargs)) File "D:\Data\StableDiffusion15\stable-diffusion-webui\modules\call_queue.py", line 36, in f res = func(args, **kwargs) File "D:\Data\StableDiffusion15\stable-diffusion-webui\modules\txt2img.py", line 55, in txt2img processed = processing.process_images(p) File "D:\Data\StableDiffusion15\stable-diffusion-webui\modules\processing.py", line 732, in process_images res = process_images_inner(p) File "D:\Data\StableDiffusion15\stable-diffusion-webui\modules\processing.py", line 856, in process_images_inner p.setup_conds() File "D:\Data\StableDiffusion15\stable-diffusion-webui\modules\processing.py", line 1309, in setup_conds super().setup_conds() File "D:\Data\StableDiffusion15\stable-diffusion-webui\modules\processing.py", line 469, in setup_conds self.uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, total_steps, [self.cached_uc], self.extra_network_data) File "D:\Data\StableDiffusion15\stable-diffusion-webui\modules\processing.py", line 455, in get_conds_with_caching cache[1] = function(shared.sd_model, required_prompts, steps, hires_steps, shared.opts.use_old_scheduling) TypeError: hijacked_get_learned_conditioning() takes 3 positional arguments but 5 were given

catboxanon commented 1 year ago

Try removing the prompt_blending.py script from your scripts folder. That script is not part of the webui and hasn't been updated in quite a long time.

V4nK15h commented 1 year ago

Thanks for the fast response. That solved it. Thank you so much.