hako-mikan / sd-webui-regional-prompter

set prompt to divided region
GNU Affero General Public License v3.0
1.58k stars 133 forks source link

IndexError: list index out of range #347

Open trapaaa99 opened 3 weeks ago

trapaaa99 commented 3 weeks ago

Hello! Today I encountered such an error using a regional prompter: IndexError: list index out of range As soon as I turn it off - everything works, I turn it on - the same Index Rrror. It appeared suddenly, before that everything worked, I generated 1 image at the given prompt, then at the same prompt it began to give this error. Model: Pony Diffusion XL GPU: 4060 Laptop Regional Prompter: Matrix, rows, 1,1

Yes, i reinstall the plugin, same didn't work. Yes, i reinstall the stable diffusion, same didn't work. I hope for timely help, thank you

image

Total mistake: Traceback (most recent call last): File "E:\STUFF\Stabble Diffusion\modules\call_queue.py", line 74, in f res = list(func(*args, kwargs)) File "E:\STUFF\Stabble Diffusion\modules\call_queue.py", line 53, in f res = func(*args, *kwargs) File "E:\STUFF\Stabble Diffusion\modules\call_queue.py", line 37, in f res = func(args, kwargs) File "E:\STUFF\Stabble Diffusion\modules\txt2img.py", line 109, in txt2img processed = processing.process_images(p) File "E:\STUFF\Stabble Diffusion\modules\processing.py", line 847, in process_images res = process_images_inner(p) File "E:\STUFF\Stabble Diffusion\modules\processing.py", line 988, 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:\STUFF\Stabble Diffusion\modules\processing.py", line 1346, in sample samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x)) File "E:\STUFF\Stabble Diffusion\modules\sd_samplers_kdiffusion.py", line 230, in sample samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, extra_params_kwargs)) File "E:\STUFF\Stabble Diffusion\modules\sd_samplers_common.py", line 272, in launch_sampling return func() File "E:\STUFF\Stabble Diffusion\modules\sd_samplers_kdiffusion.py", line 230, in samples = self.launch_sampling(steps, lambda: self.func(self.model_wrap_cfg, x, extra_args=self.sampler_extra_args, disable=False, callback=self.callback_state, extra_params_kwargs)) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, kwargs) File "E:\STUFF\Stabble Diffusion\repositories\k-diffusion\k_diffusion\sampling.py", line 145, in sample_euler_ancestral denoised = model(x, sigmas[i] * s_in, *extra_args) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(*args, kwargs) File "E:\STUFF\Stabble Diffusion\modules\sd_samplers_cfg_denoiser.py", line 268, in forward x_out[a:b] = self.inner_model(x_in[a:b], sigma_in[a:b], cond=make_condition_dict(c_crossattn, image_cond_in[a:b])) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(args, kwargs) File "E:\STUFF\Stabble Diffusion\repositories\k-diffusion\k_diffusion\external.py", line 112, in forward eps = self.get_eps(input * c_in, self.sigma_to_t(sigma), kwargs) File "E:\STUFF\Stabble Diffusion\repositories\k-diffusion\k_diffusion\external.py", line 138, in get_eps return self.inner_model.apply_model(*args, *kwargs) File "E:\STUFF\Stabble Diffusion\modules\sd_models_xl.py", line 43, in apply_model return self.model(x, t, cond) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(*args, kwargs) File "E:\STUFF\Stabble Diffusion\modules\sd_hijack_utils.py", line 22, in setattr(resolved_obj, func_path[-1], lambda *args, *kwargs: self(args, kwargs)) File "E:\STUFF\Stabble Diffusion\modules\sd_hijack_utils.py", line 34, in call return self.__sub_func(self.__orig_func, args, kwargs) File "E:\STUFF\Stabble Diffusion\modules\sd_hijack_unet.py", line 50, in apply_model result = orig_func(self, x_noisy.to(devices.dtype_unet), t.to(devices.dtype_unet), cond, kwargs) File "E:\STUFF\Stabble Diffusion\repositories\generative-models\sgm\modules\diffusionmodules\wrappers.py", line 28, in forward return self.diffusion_model( File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(*args, *kwargs) File "E:\STUFF\Stabble Diffusion\modules\sd_unet.py", line 91, in UNetModel_forward return original_forward(self, x, timesteps, context, args, kwargs) File "E:\STUFF\Stabble Diffusion\repositories\generative-models\sgm\modules\diffusionmodules\openaimodel.py", line 993, in forward h = module(h, emb, context) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(*args, *kwargs) File "E:\STUFF\Stabble Diffusion\repositories\generative-models\sgm\modules\diffusionmodules\openaimodel.py", line 100, in forward x = layer(x, context) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(*args, kwargs) File "E:\STUFF\Stabble Diffusion\repositories\generative-models\sgm\modules\attention.py", line 627, in forward x = block(x, context=context[i]) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(args, kwargs) File "E:\STUFF\Stabble Diffusion\repositories\generative-models\sgm\modules\attention.py", line 459, in forward return checkpoint( File "E:\STUFF\Stabble Diffusion\repositories\generative-models\sgm\modules\diffusionmodules\util.py", line 167, in checkpoint return func(inputs) File "E:\STUFF\Stabble Diffusion\repositories\generative-models\sgm\modules\attention.py", line 478, in _forward self.attn2( File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, *kwargs) File "E:\STUFF\Stabble Diffusion\venv\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(args, *kwargs) File "E:\STUFF\Stabble Diffusion\extensions\sd-webui-regional-prompter\scripts\attention.py", line 417, in forward ox = matsepcalc(x, contexts, mask, self.pn, 1) File "E:\STUFF\Stabble Diffusion\extensions\sd-webui-regional-prompter\scripts\attention.py", line 185, in matsepcalc context = contexts[:,tll[i][0] TOKENSCON:tll[i][1] * TOKENSCON,:] IndexError: list index out of range

LotusXue commented 6 days ago

active Use common negative prompt

trapaaa99 commented 2 days ago

active Use common negative prompt

I did so, the error really disappeared. But the results look a little strange, the background is blurry, deformed bodies, and the picture quality also leaves much to be desired (when generating in columns mode, this is not the case, the generation is quite normal). If you turn off the regional prompt, the images are very similar, and it's hard for me to know if it works at all.

Prompt I used: score_9, score_8_up,score_7_up, source_anime, indoors, standing, cowboy shot, 2girls, seductive smile, from above, hoodie, jeans, looking at viewer, stand behind each other,

BREAK raiden shogun, white hoodie, standing behind, large woman, size difference, full body view, BREAK yae miko, black hoodie, waving, standing at the bottom, small kid,

Options: image

And the results were not very good: 00085-1376001934-score_9, score_8_up,score_7_up, source_anime, indoors, standing, cowboy shot, 2girls, seductive smile, from above, hoodie, jeans 00087-1376001936-score_9, score_8_up,score_7_up, source_anime, indoors, standing, cowboy shot, 2girls, seductive smile, from above, hoodie, jeans 00086-1376001935-score_9, score_8_up,score_7_up, source_anime, indoors, standing, cowboy shot, 2girls, seductive smile, from above, hoodie, jeans

I'm not sure if the regional prompter works in rows mode. If you have any suggestions on how to check this - let me know, and I will also be happy to listen to any of your ideas that can also help me solve my problem, since I have exhausted my ideas, thank you.