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

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

Open
dhp666 opened this issue Jan 7, 2025 · 0 comments

Comments

@dhp666
Copy link

dhp666 commented Jan 7, 2025

ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in call
return await self.app(scope, receive, send)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/fastapi/applications.py", line 1106, in call
await super().call(scope, receive, send)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in call
raise exc
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in call
await self.app(scope, receive, _send)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/gradio/route_utils.py", line 724, in call
await self.app(scope, receive, send)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call
raise e
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call
await self.app(scope, receive, send)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/fastapi/routing.py", line 274, in app
raw_response = await run_endpoint_function(
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/opt/SD/modules/api/api.py", line 489, in text2imgapi
processed = process_images(p)
File "/opt/SD/modules/processing.py", line 842, in process_images
res = process_images_inner(p)
File "/opt/SD/modules/processing.py", line 962, in process_images_inner
p.setup_conds()
File "/opt/SD/modules/processing.py", line 1601, in setup_conds
super().setup_conds()
File "/opt/SD/modules/processing.py", line 503, in setup_conds
self.uc = self.get_conds_with_caching(prompt_parser.get_learned_conditioning, negative_prompts, total_steps, [self.cached_uc], self.extra_network_data)
File "/opt/SD/modules/processing.py", line 474, in get_conds_with_caching
cache[1] = function(shared.sd_model, required_prompts, steps, hires_steps, shared.opts.use_old_scheduling)
File "/opt/SD/modules/prompt_parser.py", line 189, in get_learned_conditioning
conds = model.get_learned_conditioning(texts)
File "/root/miniconda3/envs/forge/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "/opt/SD/backend/diffusion_engine/sd35.py", line 111, in get_learned_conditioning
cond_lg = torch.cat([cond_l, cond_g], dim=-1)
RuntimeError: Sizes of tensors must match except in dimension 2. Expected size 154 but got size 77 for tensor number 1 in the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant