wcde / sd-webui-kohya-hiresfix

224 stars 9 forks source link

Using in img2img mode with ControlNet breaks WebUI #12

Open ThereforeGames opened 7 months ago

ThereforeGames commented 7 months ago

Hi,

Thank you for creating this awesome extension! It is a great alternative to normal hires fix.

However, when it is enabled with default settings in img2img inpainting mode along with a ControlNet model (it doesn't seem to matter which one), pressing "Generate" yields the following error:

      File "T:\code\python\automatic-stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\hook.py", line 744, in forward
        h = aligned_adding(h, total_controlnet_embedding.pop(), require_inpaint_hijack)
      File "T:\code\python\automatic-stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\hook.py", line 216, in aligned_adding
        zeros[:, :x.shape[1], ...] = x
    RuntimeError: The expanded size of the tensor (4) must match the existing size (8) at non-singleton dimension 3.  Target sizes: [1, 1280, 4, 4].  Tensor sizes: [1280, 8, 8]

Perhaps this needs to be fixed on CN's end. Either way, there ought to be some sort of sanity check; this error prevents all future image generations until the WebUI is completely restarted.

lebakerino commented 7 months ago

I have a similar error in txt2img with a large stream of similar errors and then the final tensor error and needing to restart.. with txt2img. I had no issues when the plugin first came out but for some reason the past week or so since I changed some of the settings in it, it gives errors every time I try to use it.. updated a1111, the extension and all my other extensions and no bueno still..

GastonSan79 commented 7 months ago

Same error here, enabling this extension causes the error " RuntimeError: The expanded size of the tensor (4512) must match the existing size (4608) at non-singleton dimension 1. Target sizes: [2, 4512, 320]. Tensor sizes: [1, 4608, 1]" to appear and renders the webUI unable to work at all until re-opened.

thiagojramos commented 7 months ago

I'm having the same error too. It doesn't matter if I'm using the master or dev version of automatic1111, it also gives an error.

Print

![2023-12-09 (3)](https://github.com/wcde/sd-webui-kohya-hiresfix/assets/45890502/3140bdd6-7f97-40f8-b9f1-faa46e07663b)