muerrilla / stable-diffusion-NPW

Negative Prompt Weight: Extension for Stable Diffusion Web UI
The Unlicense
111 stars 10 forks source link

RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 2 but got size 1 for tensor number 1 in the list. #11

Closed rrroddri closed 3 months ago

rrroddri commented 3 months ago

Hey, hope you're doing good, thank you for your extension.

I'm getting this error when I use a batch size of 2 or more with ControlNet enabled, without it, works fine. Also with a batch size of 1, NPW and ControlNet work together without problems.

** Error executing callback cfg_denoiser_callback for G:\stable-diffusion-webui\extensions\stable-diffusion-NPW\scripts\npw.py Traceback (most recent call last): File "G:\stable-diffusion-webui\modules\script_callbacks.py", line 333, in cfg_denoiser_callback c.callback(params) File "G:\stable-diffusion-webui\extensions\stable-diffusion-NPW\scripts\npw.py", line 107, in denoiser_callback params.text_uncond['crossattn'] = concat_and_lerp(empty_cross, cross, self.weight) File "G:\stable-diffusion-webui\extensions\stable-diffusion-NPW\scripts\npw.py", line 93, in concat_and_lerp empty_concat = torch.cat([tensor[:, :1, :], empty_concat], dim=1) RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 2 but got size 1 for tensor number 1 in the list.

A1111 Webui version: v1.9.3 ControlNet version: v1.1.449

muerrilla commented 3 months ago

Thanks for reporting the bug, and sorry for the late response. It's fixed now. Please update.

rrroddri commented 3 months ago

Thank you, its working now :)