ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

KSampler The size of tensor a (48) must match the size of tensor b (16) at non-singleton dimension 1

Open ABIA2024 opened this issue 4 months ago • 5 comments

Custom Node Testing

Expected Behavior

LOG 👍 2025-08-13T11:01:42.524341 - Prompt executed in 0.07 seconds 2025-08-13T11:01:42.861888 - Exception in callback _ProactorBasePipeTransport._call_connection_lost(None) handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)> Traceback (most recent call last): File "C:\pinokio\bin\miniconda\lib\asyncio\events.py", line 80, in _run self._context.run(self._callback, *self._args) File "C:\pinokio\bin\miniconda\lib\asyncio\proactor_events.py", line 165, in _call_connection_lost self._sock.shutdown(socket.SHUT_RDWR) ConnectionResetError: [WinError 10054] Une connexion existante a dû être fermée par l’hôte distant 2025-08-13T11:06:03.239183 - got prompt 2025-08-13T11:06:06.781652 - loaded completely 13554.172344970702 10835.4765625 True 2025-08-13T11:06:08.227621 - Restoring initial comfy attention2025-08-13T11:06:08.227621 - 2025-08-13T11:06:08.228620 - Restoring initial comfy attention2025-08-13T11:06:08.228620 - 2025-08-13T11:06:08.235611 - !!! Exception during processing !!! The size of tensor a (48) must match the size of tensor b (16) at non-singleton dimension 1 2025-08-13T11:06:08.236621 - Traceback (most recent call last): File "C:\pinokio\api\comfy.git\app\execution.py", line 496, in execute output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) File "C:\pinokio\api\comfy.git\app\execution.py", line 315, in get_output_data return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs) File "C:\pinokio\api\comfy.git\app\execution.py", line 289, in _async_map_node_over_list await process_inputs(input_dict, i) File "C:\pinokio\api\comfy.git\app\execution.py", line 277, in process_inputs result = f(**inputs) File "C:\pinokio\api\comfy.git\app\nodes.py", line 1521, in sample return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise) File "C:\pinokio\api\comfy.git\app\nodes.py", line 1488, in common_ksampler samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, File "C:\pinokio\api\comfy.git\app\comfy\sample.py", line 45, in sample samples = sampler.sample(noise, positive, negative, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed) File "C:\pinokio\api\comfy.git\app\comfy\samplers.py", line 1143, in sample return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed) File "C:\pinokio\api\comfy.git\app\comfy\samplers.py", line 1033, in sample return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "C:\pinokio\api\comfy.git\app\comfy\samplers.py", line 1018, in sample output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "C:\pinokio\api\comfy.git\app\comfy\patcher_extension.py", line 111, in execute return self.original(*args, **kwargs) File "C:\pinokio\api\comfy.git\app\comfy\samplers.py", line 986, in outer_sample output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed) File "C:\pinokio\api\comfy.git\app\comfy\samplers.py", line 956, in inner_sample latent_image = self.inner_model.process_latent_in(latent_image) File "C:\pinokio\api\comfy.git\app\comfy\model_base.py", line 305, in process_latent_in return self.latent_format.process_in(latent) File "C:\pinokio\api\comfy.git\app\comfy\latent_formats.py", line 453, in process_in return (latent - latents_mean) * self.scale_factor / latents_std RuntimeError: The size of tensor a (48) must match the size of tensor b (16) at non-singleton dimension 1

2025-08-13T11:06:08.238612 - Prompt executed in 4.99 seconds

## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

Workflow too large. Please manually upload the workflow from local file system.


## Additional Context
(Please add any additional context or steps to reproduce the error here)


### Actual Behavior

How to fix this problem, only with changes into the workflow (i have not enough known to use the soft solution)

### Steps to Reproduce

in the platform comfyui

### Debug Logs

```powershell
LOG 👍 2025-08-13T11:01:42.524341 - Prompt executed in 0.07 seconds
2025-08-13T11:01:42.861888 - Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
  File "C:\pinokio\bin\miniconda\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\pinokio\bin\miniconda\lib\asyncio\proactor_events.py", line 165, in _call_connection_lost
    self._sock.shutdown(socket.SHUT_RDWR)
ConnectionResetError: [WinError 10054] Une connexion existante a dû être fermée par l’hôte distant
2025-08-13T11:06:03.239183 - got prompt
2025-08-13T11:06:06.781652 - loaded completely 13554.172344970702 10835.4765625 True
2025-08-13T11:06:08.227621 - Restoring initial comfy attention2025-08-13T11:06:08.227621 - 
2025-08-13T11:06:08.228620 - Restoring initial comfy attention2025-08-13T11:06:08.228620 - 
2025-08-13T11:06:08.235611 - !!! Exception during processing !!! The size of tensor a (48) must match the size of tensor b (16) at non-singleton dimension 1
2025-08-13T11:06:08.236621 - Traceback (most recent call last):
  File "C:\pinokio\api\comfy.git\app\execution.py", line 496, in execute
    output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
  File "C:\pinokio\api\comfy.git\app\execution.py", line 315, in get_output_data
    return_values = await _async_map_node_over_list(prompt_id, unique_id, obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, hidden_inputs=hidden_inputs)
  File "C:\pinokio\api\comfy.git\app\execution.py", line 289, in _async_map_node_over_list
    await process_inputs(input_dict, i)
  File "C:\pinokio\api\comfy.git\app\execution.py", line 277, in process_inputs
    result = f(**inputs)
  File "C:\pinokio\api\comfy.git\app\nodes.py", line 1521, in sample
    return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
  File "C:\pinokio\api\comfy.git\app\nodes.py", line 1488, in common_ksampler
    samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
  File "C:\pinokio\api\comfy.git\app\comfy\sample.py", line 45, in sample
    samples = sampler.sample(noise, positive, negative, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
  File "C:\pinokio\api\comfy.git\app\comfy\samplers.py", line 1143, in sample
    return sample(self.model, noise, positive, negative, cfg, self.device, sampler, sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
  File "C:\pinokio\api\comfy.git\app\comfy\samplers.py", line 1033, in sample
    return cfg_guider.sample(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
  File "C:\pinokio\api\comfy.git\app\comfy\samplers.py", line 1018, in sample
    output = executor.execute(noise, latent_image, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
  File "C:\pinokio\api\comfy.git\app\comfy\patcher_extension.py", line 111, in execute
    return self.original(*args, **kwargs)
  File "C:\pinokio\api\comfy.git\app\comfy\samplers.py", line 986, in outer_sample
    output = self.inner_sample(noise, latent_image, device, sampler, sigmas, denoise_mask, callback, disable_pbar, seed)
  File "C:\pinokio\api\comfy.git\app\comfy\samplers.py", line 956, in inner_sample
    latent_image = self.inner_model.process_latent_in(latent_image)
  File "C:\pinokio\api\comfy.git\app\comfy\model_base.py", line 305, in process_latent_in
    return self.latent_format.process_in(latent)
  File "C:\pinokio\api\comfy.git\app\comfy\latent_formats.py", line 453, in process_in
    return (latent - latents_mean) * self.scale_factor / latents_std
RuntimeError: The size of tensor a (48) must match the size of tensor b (16) at non-singleton dimension 1

2025-08-13T11:06:08.238612 - Prompt executed in 4.99 seconds


## Attached Workflow
Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

Workflow too large. Please manually upload the workflow from local file system.


## Additional Context
(Please add any additional context or steps to reproduce the error here)

Other

No response

ABIA2024 avatar Aug 13 '25 09:08 ABIA2024