IndigoDosSantos / stable-cascade-one-click-installer

Easy setup for generating beautiful images with Stable Cascade.
GNU Affero General Public License v3.0
70 stars 8 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. #26

Closed deadpipe closed 6 months ago

deadpipe commented 6 months ago

Hi

I am trying to generate an image but i receive the following error in the terminal :

Loading pipeline components...: 100%|███████████████████████████████████████████| 6/6 [01:02<00:00, 10.35s/it] 0%| | 0/20 [00:00<?, ?it/s] 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:07<00:00, 2.65it/s] Loading pipeline components...: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:23<00:00, 4.75s/it] 0%| | 0/10 [00:00<?, ?it/s] Traceback (most recent call last): File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\gradio\queueing.py", line 501, in call_prediction output = await route_utils.call_process_api( File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\gradio\route_utils.py", line 253, in call_process_api output = await app.get_blocks().process_api( File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\gradio\blocks.py", line 1695, in process_api result = await self.call_function( File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\gradio\blocks.py", line 1235, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\gradio\utils.py", line 692, in wrapper response = f(args, kwargs) File "S:\AI Softwares\Cascade\EtienneDosSantos\run.py", line 81, in generate_images decoder_output = decoder( File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, *kwargs) File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\diffusers\pipelines\stable_cascade\pipeline_stable_cascade.py", line 429, in call predicted_latents = self.decoder( File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl return self._call_impl(args, kwargs) File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl return forward_call(*args, kwargs) File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\diffusers\models\unets\unet_stable_cascade.py", line 604, in forward level_outputs = self._down_encode(x, timestep_ratio_embed, clip) File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\diffusers\models\unets\unet_stable_cascade.py", line 496, in _down_encode x = block(x, clip) File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl return self._call_impl(*args, *kwargs) File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl return forward_call(args, kwargs) File "C:\Users\Abzu\AppData\Roaming\Python\Python310\site-packages\diffusers\models\unets\unet_stable_cascade.py", line 109, in forward kv = torch.cat([norm_x.view(batch_size, channel, -1).transpose(1, 2), kv], 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.

I am using Windows 10 Python 3.10.6 CUDA 11.8 RTX 3090 24GB RTX 3060 12GB 32GB System RAM

IndigoDosSantos commented 6 months ago

To help troubleshoot, please provide the version of the diffusers library installed in your virtual environment. Here's how to find it, in case you don't know:

1. Activate Your Virtual Environment:

2. Check the diffusers Version:

IndigoDosSantos commented 6 months ago

I've committed changes to the main branch that I believe address this issue. Would you mind reinstalling the application to see if the fix works for you?

deadpipe commented 6 months ago

Yes it works now. Thankyou!