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

[Bug]: SDXL checkpoint + heres fix + Tiled VAE = cause error #12611

Closed
1 task done
rltgjqmcpgjadyd opened this issue Aug 16, 2023 · 11 comments
Closed
1 task done

[Bug]: SDXL checkpoint + heres fix + Tiled VAE = cause error #12611

rltgjqmcpgjadyd opened this issue Aug 16, 2023 · 11 comments
Labels
not-an-issue This issue is not with the repo itself.

Comments

@rltgjqmcpgjadyd
Copy link

rltgjqmcpgjadyd commented Aug 16, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

use SDXL checkpoint image generation + hires fix + Tiled VAE = cause error

don't use hires fix, won't get an error

here`s console log

*** Error completing request
*** Arguments: ('task(be0aqmmkqebptjb)', '(masterpiece:1.2), distinct, highres, highest quality, super detail, finely detailed, 1girl, nsfw, (huge breasts, wide hips, narrow waist:0.8), erotic, solo, perfect anatomy, (sweat:1.2), (sweatdrop:1.2), Bored, Expressionless, From Below, Looking At Viewer, Assertive Pose, Pagoda, Poncho, Culottes, 1Girl, Mature female, Adult, Long Hair, Braid, Colored Hair Tips, Dark Blue Hair, Aqua Hair', 'paintings, sketches, streets (worst quality, low quality, normal quality:1.5), lowres, bad arm, bad foot, blurry, text, logo, ((monochrome)), ((grayscale)), strabismus', [], 42, 'DPM++ 2M SDE Karras', 1, 1, 8.5, 1536, 1024, True, 0.3, 2, 'R-ESRGAN 4x+ Anime6B', 10, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x000001C4C6BD0510>, 0, False, '', 0.8, 3749638195, False, -1, 0, 0, 0, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, 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, True, 1024, 128, True, True, True, False, False, False, False, 'positive', 'comma', 0, False, False, '', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "J:\SDWebUI\modules\call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
                   ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\txt2img.py", line 55, in txt2img
        processed = processing.process_images(p)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 725, in process_images
        res = process_images_inner(p)
              ^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 860, 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 "J:\SDWebUI\modules\processing.py", line 1151, in sample
        return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 1212, in sample_hr_pass
        samples = images_tensor_to_samples(decoded_samples, approximation_indexes.get(opts.sd_vae_encode_method))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\sd_samplers_common.py", line 102, in images_tensor_to_samples
        x_latent = model.get_first_stage_encoding(model.encode_first_stage(image))
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\diffusion.py", line 127, in encode_first_stage
        z = self.first_stage_model.encode(x)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\autoencoder.py", line 321, in encode
        return super().encode(x).sample()
               ^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\autoencoder.py", line 309, in encode
        moments = self.quant_conv(h)
                  ^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
        return forward_call(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\extensions-builtin\Lora\networks.py", line 441, in network_Conv2d_forward
        return originals.Conv2d_forward(self, input)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 460, in forward
        return self._conv_forward(input, self.weight, self.bias)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
        return F.conv2d(input, weight, bias, self.stride,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Input type (float) and bias type (struct c10::Half) should be the same


Steps to reproduce the problem

  1. set SDXL checkpoint
  2. set hires fix
  3. use Tiled VAE (to make it work, can reduce the tile size to)
  4. generate got error

What should have happened?

It should work fine

Version or Commit where the problem happens

541ef92

What Python version are you running on ?

Python 3.11.x (above, no supported yet)

What platforms do you use to access the UI ?

Windows

What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

Cross attention optimization

Automatic

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

--skip-python-version-check --xformers --xformers-flash-attention

List of extensions

inactive except for Tiled VAE

Console logs

*** Error completing request
*** Arguments: ('task(be0aqmmkqebptjb)', '(masterpiece:1.2), distinct, highres, highest quality, super detail, finely detailed, 1girl, nsfw, (huge breasts, wide hips, narrow waist:0.8), erotic, solo, perfect anatomy, (sweat:1.2), (sweatdrop:1.2), Bored, Expressionless, From Below, Looking At Viewer, Assertive Pose, Pagoda, Poncho, Culottes, 1Girl, Mature female, Adult, Long Hair, Braid, Colored Hair Tips, Dark Blue Hair, Aqua Hair', 'paintings, sketches, streets (worst quality, low quality, normal quality:1.5), lowres, bad arm, bad foot, blurry, text, logo, ((monochrome)), ((grayscale)), strabismus', [], 42, 'DPM++ 2M SDE Karras', 1, 1, 8.5, 1536, 1024, True, 0.3, 2, 'R-ESRGAN 4x+ Anime6B', 10, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x000001C4C6BD0510>, 0, False, '', 0.8, 3749638195, False, -1, 0, 0, 0, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, 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, True, 1024, 128, True, True, True, False, False, False, False, 'positive', 'comma', 0, False, False, '', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "J:\SDWebUI\modules\call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
                   ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\txt2img.py", line 55, in txt2img
        processed = processing.process_images(p)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 725, in process_images
        res = process_images_inner(p)
              ^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 860, 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 "J:\SDWebUI\modules\processing.py", line 1151, in sample
        return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 1212, in sample_hr_pass
        samples = images_tensor_to_samples(decoded_samples, approximation_indexes.get(opts.sd_vae_encode_method))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\sd_samplers_common.py", line 102, in images_tensor_to_samples
        x_latent = model.get_first_stage_encoding(model.encode_first_stage(image))
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\diffusion.py", line 127, in encode_first_stage
        z = self.first_stage_model.encode(x)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\autoencoder.py", line 321, in encode
        return super().encode(x).sample()
               ^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\autoencoder.py", line 309, in encode
        moments = self.quant_conv(h)
                  ^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
        return forward_call(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\extensions-builtin\Lora\networks.py", line 441, in network_Conv2d_forward
        return originals.Conv2d_forward(self, input)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 460, in forward
        return self._conv_forward(input, self.weight, self.bias)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
        return F.conv2d(input, weight, bias, self.stride,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Input type (float) and bias type (struct c10::Half) should be the same

---

Additional information

SD 1.5 is work fine (hires fix + Tiled VAE)

@rltgjqmcpgjadyd rltgjqmcpgjadyd added the bug-report Report of a bug, yet to be confirmed label Aug 16, 2023
@catboxanon
Copy link
Collaborator

Traceback indicates something going wrong with the built-in LoRA extension. Are you using any, and if so which one(s)?

@rltgjqmcpgjadyd
Copy link
Author

rltgjqmcpgjadyd commented Aug 17, 2023

no I didn't use any lora

i tested again with built-in lora disabled i got same error

*** Error completing request
*** Arguments: ('task(nv68kh5xygck9pe)', '(masterpiece:1.2), distinct, highres, highest quality, super detail, finely detailed, 1girl, nsfw, (huge breasts, wide hips, narrow waist:0.8), erotic, solo, perfect anatomy, (sweat:1.2), (sweatdrop:1.2), Bored, Expressionless, From Below, Looking At Viewer, Assertive Pose, Pagoda, Poncho, Culottes, 1Girl, Mature female, Adult, Long Hair, Braid, Colored Hair Tips, Dark Blue Hair, Aqua Hair', 'paintings, sketches, streets (worst quality, low quality, normal quality:1.5), lowres, bad arm, bad foot, blurry, text, logo, ((monochrome)), ((grayscale)), strabismus', [], 42, 'DPM++ 3M SDE Karras', 1, 1, 8.5, 1536, 1024, True, 0.3, 2, '4x-AnimeSharp', 15, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', ['Clip skip: 1'], <gradio.routes.Request object at 0x000001FD241D1E10>, 0, False, '', 0.8, 3001313574, False, -1, 0, 0, 0, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, 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, True, 512, 64, True, True, True, False, False, False, False, 'positive', 'comma', 0, False, False, '', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "J:\SDWebUI\modules\call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
                   ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\txt2img.py", line 55, in txt2img
        processed = processing.process_images(p)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 725, in process_images
        res = process_images_inner(p)
              ^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 860, 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 "J:\SDWebUI\modules\processing.py", line 1151, in sample
        return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 1212, in sample_hr_pass
        samples = images_tensor_to_samples(decoded_samples, approximation_indexes.get(opts.sd_vae_encode_method))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\sd_samplers_common.py", line 102, in images_tensor_to_samples
        x_latent = model.get_first_stage_encoding(model.encode_first_stage(image))
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\diffusion.py", line 127, in encode_first_stage
        z = self.first_stage_model.encode(x)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\autoencoder.py", line 321, in encode
        return super().encode(x).sample()
               ^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\autoencoder.py", line 309, in encode
        moments = self.quant_conv(h)
                  ^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
        return forward_call(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 460, in forward
        return self._conv_forward(input, self.weight, self.bias)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
        return F.conv2d(input, weight, bias, self.stride,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Input type (float) and bias type (struct c10::Half) should be the same

---

@catboxanon
Copy link
Collaborator

I think I may have narrowed down the issue. If you can, could you checkout 085c903 and see if the problem still occurs? And if it does not, then checkout cc53db6 and see if it does occur.

@catboxanon
Copy link
Collaborator

Actually, the issue with that is that earlier commit didn't even support SDXL in hires fix I believe. So, that would basically mean this never worked.

@whmc76
Copy link

whmc76 commented Aug 18, 2023

i encounter this issue too, only highres.fix, no lora

Traceback (most recent call last):
  File "E:\sd-webui-aki-v4.2\modules\call_queue.py", line 58, in f
    res = list(func(*args, **kwargs))
  File "E:\sd-webui-aki-v4.2\modules\call_queue.py", line 37, in f
    res = func(*args, **kwargs)
  File "E:\sd-webui-aki-v4.2\modules\txt2img.py", line 62, in txt2img
    processed = processing.process_images(p)
  File "E:\sd-webui-aki-v4.2\modules\processing.py", line 677, in process_images
    res = process_images_inner(p)
  File "E:\sd-webui-aki-v4.2\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 "E:\sd-webui-aki-v4.2\modules\processing.py", line 794, 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 "E:\sd-webui-aki-v4.2\modules\processing.py", line 1109, in sample
    samples = self.sd_model.get_first_stage_encoding(self.sd_model.encode_first_stage(decoded_samples))
  File "E:\sd-webui-aki-v4.2\python\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "E:\sd-webui-aki-v4.2\repositories\generative-models\sgm\models\diffusion.py", line 127, in encode_first_stage
    z = self.first_stage_model.encode(x)
  File "E:\sd-webui-aki-v4.2\repositories\generative-models\sgm\models\autoencoder.py", line 321, in encode
    return super().encode(x).sample()
  File "E:\sd-webui-aki-v4.2\repositories\generative-models\sgm\models\autoencoder.py", line 308, in encode
    h = self.encoder(x)
  File "E:\sd-webui-aki-v4.2\python\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "E:\sd-webui-aki-v4.2\repositories\generative-models\sgm\modules\diffusionmodules\model.py", line 576, in forward
    hs = [self.conv_in(x)]
  File "E:\sd-webui-aki-v4.2\python\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "E:\sd-webui-aki-v4.2\extensions-builtin\Lora\networks.py", line 376, in network_Conv2d_forward
    return torch.nn.Conv2d_forward_before_network(self, input)
  File "E:\sd-webui-aki-v4.2\extensions\stable-diffusion-webui-composable-lora\composable_lora.py", line 154, in lora_Conv2d_forward
    return lora_forward(self, input, torch.nn.Conv2d_forward_before_lora(self, input))
  File "E:\sd-webui-aki-v4.2\extensions\a1111-sd-webui-lycoris\lycoris.py", line 753, in lyco_Conv2d_forward
    return torch.nn.Conv2d_forward_before_lyco(self, input)
  File "E:\sd-webui-aki-v4.2\python\lib\site-packages\torch\nn\modules\conv.py", line 463, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "E:\sd-webui-aki-v4.2\python\lib\site-packages\torch\nn\modules\conv.py", line 459, in _conv_forward
    return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Input type (float) and bias type (struct c10::Half) should be the same

提示:Python 运行时抛出了一个异常。请检查疑难解答页面。

@catboxanon catboxanon added bug Report of a confirmed bug and removed bug-report Report of a bug, yet to be confirmed labels Aug 18, 2023
@rltgjqmcpgjadyd
Copy link
Author

after 9d2299e

I get the same error

*** Error completing request
*** Arguments: ('task(u2cwebmnvixweis)', '(masterpiece:1.2), distinct, highres, highest quality, super detail, finely detailed, 1girl, nsfw, (huge breasts, wide hips, narrow waist:0.8), erotic, solo, perfect anatomy, (sweat:1.2), (sweatdrop:1.2), Bored, Expressionless, From Below, Looking At Viewer, Assertive Pose, Pagoda, Poncho, Culottes, 1Girl, Mature female, Adult, Long Hair, Braid, Colored Hair Tips, Dark Blue Hair, Aqua Hair', 'paintings, sketches, streets (worst quality, low quality, normal quality:1.5), lowres, bad arm, bad foot, blurry, text, logo, ((monochrome)), ((grayscale)), strabismus, unaestheticXLv1', [], 50, 'DPM++ 2M SDE Karras', 1, 1, 8.5, 1365, 1024, True, 0.5, 1.5, 'R-ESRGAN General WDN 4xV3', 10, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x0000024C08849650>, 0, False, '', 0.8, -1, False, -1, 0, 0, 0, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, 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, True, 512, 64, True, True, True, False, False, False, False, 'positive', 'comma', 0, False, False, '', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "J:\SDWebUI\modules\call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
                   ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\txt2img.py", line 55, in txt2img
        processed = processing.process_images(p)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 722, in process_images
        res = process_images_inner(p)
              ^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 857, 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 "J:\SDWebUI\modules\processing.py", line 1148, in sample
        return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 1212, in sample_hr_pass
        samples = images_tensor_to_samples(decoded_samples, approximation_indexes.get(opts.sd_vae_encode_method))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\sd_samplers_common.py", line 103, in images_tensor_to_samples
        x_latent = model.get_first_stage_encoding(model.encode_first_stage(image))
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\diffusion.py", line 127, in encode_first_stage
        z = self.first_stage_model.encode(x)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\autoencoder.py", line 321, in encode
        return super().encode(x).sample()
               ^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\autoencoder.py", line 309, in encode
        moments = self.quant_conv(h)
                  ^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
        return forward_call(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 460, in forward
        return self._conv_forward(input, self.weight, self.bias)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
        return F.conv2d(input, weight, bias, self.stride,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Input type (float) and bias type (struct c10::Half) should be the same

---

but i found something

increasing the tile size to prevent the encoder(Tiled VAE encoder) from working will not cause an error

the decoder works, but no errors are thrown

i think maybe it's a bug in the tiled vae and not a bug in the webui

@catboxanon
Copy link
Collaborator

increasing the tile size to prevent the encoder(Tiled VAE encoder) from working will not cause an error

Do you mean you essentially disabled the tiled VAE extension? If that's the case it does seem like something on the extension side rather than the webui.

@rltgjqmcpgjadyd
Copy link
Author

Tiled VAE have encoders and decoders, and you can intentionally disable them by resizing the tiles

like this

스크린샷 2023-08-20 044705

won't work if image is smaller than tile size

@catboxanon
Copy link
Collaborator

catboxanon commented Aug 19, 2023

I'm not sure if it will make a difference but you could try reverting #12630. If you get the same error after reverting that I think it's safe to say it's the extension causing this.

@rltgjqmcpgjadyd
Copy link
Author

rltgjqmcpgjadyd commented Aug 19, 2023

I reverted to commit 3d81fd7 and tested it out

I got the same error

[Tiled VAE]: input_size: torch.Size([1, 4, 170, 128]), tile_size: 64, padding: 11      | 50/60 [00:22<00:04,  2.46it/s]
[Tiled VAE]: split to 3x2 = 6 tiles. Optimal tile size 64x64, original tile size 64x64
[Tiled VAE]: Fast mode enabled, estimating group norm parameters on 48 x 64 image
[Tiled VAE]: Executing Decoder Task Queue: 100%|███████████████████████████████████| 738/738 [00:00<00:00, 2091.56it/s]
[Tiled VAE]: Done in 0.859s, max VRAM alloc 8825.610 MB
[Tiled VAE]: input_size: torch.Size([1, 3, 2047, 1536]), tile_size: 512, padding: 32
[Tiled VAE]: split to 4x3 = 12 tiles. Optimal tile size 512x512, original tile size 512x512
[Tiled VAE]: Fast mode enabled, estimating group norm parameters on 384 x 512 image
[Tiled VAE]: Executing Encoder Task Queue: 100%|█████████████████████████████████| 1092/1092 [00:00<00:00, 2629.09it/s]
[Tiled VAE]: Done in 1.345s, max VRAM alloc 8846.341 MB
*** Error completing request
*** Arguments: ('task(y1m7vvevjewmofm)', '(masterpiece:1.2), distinct, highres, highest quality, super detail, finely detailed, 1girl, nsfw, (huge breasts, wide hips, narrow waist:0.8), erotic, solo, perfect anatomy, (sweat:1.2), (sweatdrop:1.2), Bored, Expressionless, From Below, Looking At Viewer, Assertive Pose, Pagoda, Poncho, Culottes, 1Girl, Mature female, Adult, Long Hair, Braid, Colored Hair Tips, Dark Blue Hair, Aqua Hair', 'paintings, sketches, streets (worst quality, low quality, normal quality:1.5), lowres, bad arm, bad foot, blurry, text, logo, ((monochrome)), ((grayscale)), strabismus, unaestheticXLv1', [], 50, 'DPM++ 2M SDE Karras', 1, 1, 8.5, 1365, 1024, True, 0.3, 1.5, '4x-AnimeSharp', 10, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x000001D72D283710>, 0, False, '', 0.8, 3838027496, False, -1, 0, 0, 0, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, 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, True, 512, 64, True, True, True, False, False, False, False, 'positive', 'comma', 0, False, False, '', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "J:\SDWebUI\modules\call_queue.py", line 58, in f
        res = list(func(*args, **kwargs))
                   ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\call_queue.py", line 37, in f
        res = func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\txt2img.py", line 55, in txt2img
        processed = processing.process_images(p)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 722, in process_images
        res = process_images_inner(p)
              ^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 857, 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 "J:\SDWebUI\modules\processing.py", line 1148, in sample
        return self.sample_hr_pass(samples, decoded_samples, seeds, subseeds, subseed_strength, prompts)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\processing.py", line 1212, in sample_hr_pass
        samples = images_tensor_to_samples(decoded_samples, approximation_indexes.get(opts.sd_vae_encode_method))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\modules\sd_samplers_common.py", line 102, in images_tensor_to_samples
        x_latent = model.get_first_stage_encoding(model.encode_first_stage(image))
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\diffusion.py", line 127, in encode_first_stage
        z = self.first_stage_model.encode(x)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\autoencoder.py", line 321, in encode
        return super().encode(x).sample()
               ^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\repositories\generative-models\sgm\models\autoencoder.py", line 309, in encode
        moments = self.quant_conv(h)
                  ^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
        return self._call_impl(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
        return forward_call(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 460, in forward
        return self._conv_forward(input, self.weight, self.bias)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "J:\SDWebUI\venv\Lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
        return F.conv2d(input, weight, bias, self.stride,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: Input type (float) and bias type (struct c10::Half) should be the same

---

Tiled VAE encoder = error
Tiled VAE decoder = no error

extension is the cause of the error, maybe?

but I don't know why SD1.5 doesn't have the error

@catboxanon catboxanon added bug-report Report of a bug, yet to be confirmed and removed bug Report of a confirmed bug labels Aug 19, 2023
@catboxanon
Copy link
Collaborator

Yeah, seems like the extension then. I would open an issue upstream and see what happens.

@catboxanon catboxanon added not-an-issue This issue is not with the repo itself. and removed bug-report Report of a bug, yet to be confirmed labels Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-an-issue This issue is not with the repo itself.
Projects
None yet
Development

No branches or pull requests

3 participants