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

Input type (struct c10::Half) and bias type (float) should be the same #2

Open
alexbofa opened this issue Feb 6, 2024 · 6 comments

Comments

@alexbofa
Copy link

alexbofa commented Feb 6, 2024

Hello, it gives an error, I can't figure out what the problem is

Error occurred when executing CCSR_Upscale:

Input type (struct c10::Half) and bias type (float) should be the same

File "Z:\ComfyUI\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-CCSR\nodes.py", line 120, in process
samples = sampler.sample_with_mixdiff_ccsr(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-CCSR\model\q_sampler.py", line 718, in sample_with_mixdiff_ccsr
"c_latent": [self.model.apply_condition_encoder(tile_cond_img)],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\ComfyUI\custom_nodes\ComfyUI-CCSR\model\ccsr_stage2.py", line 320, in apply_condition_encoder
c_latent_meanvar = self.cond_encoder(control * 2 - 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\nn\modules\container.py", line 217, in forward
input = module(input)
^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\ComfyUI\comfy\ldm\modules\diffusionmodules\model.py", line 520, in forward
h = self.conv_in(x)
^^^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\ComfyUI\comfy\ops.py", line 42, in forward
return super().forward(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\nn\modules\conv.py", line 460, in forward
return self._conv_forward(input, self.weight, self.bias)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Z:\ComfyUI\python_embeded\Lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@Chryseus
Copy link

Chryseus commented Feb 9, 2024

I'm having the exact same problem, tried everything I could think of to fix it.
Edit: Never mind it fixed itself, try restart it if you're having problems.

@unexpectedly
Copy link

Having the same issue. Tried restart & reinstall - still the same error:

Error occurred when executing CCSR_Upscale:
Input type (c10::Half) and bias type (float) should be the same

@RigzTD
Copy link

RigzTD commented Mar 2, 2024

Yep same here, tried to also reinstall and restart, but its not fixing it.

Error occurred when executing CCSR_Upscale:
Input type (struct c10::Half) and bias type (float) should be the same

@pmajor74
Copy link

I'm using the CCSR node in the AP Workflow 8.0

I am also having the same issue. To reproduce, I've created an image and have enabled are:

  • Enable Image Generator (I'm making the 3 clowns image)
  • Enable Refiner (for SDXL)
  • Enable Upscaler

When the flow makes its way over to the "Upscaler" group, it dies on the CCSR_Update with the error I pasted below this message.

  • I am using the CCSR_Model_Select to select the "real-world_ccsr.ckpt" and have the following settings:
  • resize method: lanczos
  • scale by: 2.0
  • steps: 3
  • t_max: 0.67
  • t_min: 0.33
  • sampling method: ccsr_tiled_vae_gaussian_weights
  • tile_size: 512
  • tile_stride: 256
  • vae_tile_size_encode: 1024
  • vae_tile_size_decode: 1024
  • color_fix_type: wavelet
  • keep model loaded: false
  • seed: 2
  • contol_after_generate: fixed

I'm a programmer as well, so am digging a bit deeper, but am half hoping someone else sees some of this info and it helps create a solution quicker.

=================== error output ==================
Using gaussian weights
timesteps used in spaced sampler:
[0, 53, 105, 158, 210, 263, 315, 368, 421, 473, 526, 578, 631, 684, 736, 789, 841, 894, 946, 999]
Process tile with location (0 64) (0 64): 0%| | 0/527 [00:00<?, ?it/s]
ERROR:root:!!! Exception during processing !!!| | 0/527 [00:00<?, ?it/s]
ERROR:root:Traceback (most recent call last):
File "G:_APWorkFlow_ComfyUI\ComfyUI\execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "G:_APWorkFlow_ComfyUI\ComfyUI\execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "G:_APWorkFlow_ComfyUI\ComfyUI\execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "G:_APWorkFlow_ComfyUI\ComfyUI\custom_nodes\ComfyUI-CCSR\nodes.py", line 130, in process
samples = sampler.sample_with_tile_ccsr(
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "G:_APWorkFlow_ComfyUI\ComfyUI\custom_nodes\ComfyUI-CCSR\model\q_sampler.py", line 562, in sample_with_tile_ccsr
"c_latent": [self.model.apply_condition_encoder(tile_cond_img)],
File "G:_APWorkFlow_ComfyUI\ComfyUI\custom_nodes\ComfyUI-CCSR\model\ccsr_stage2.py", line 320, in apply_condition_encoder
c_latent_meanvar = self.cond_encoder(control * 2 - 1)
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\nn\modules\container.py", line 217, in forward
input = module(input)
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "G:_APWorkFlow_ComfyUI\ComfyUI\comfy\ldm\modules\diffusionmodules\model.py", line 520, in forward
h = self.conv_in(x)
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "G:_APWorkFlow_ComfyUI\ComfyUI\comfy\ops.py", line 60, in forward
return super().forward(*args, **kwargs)
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\nn\modules\conv.py", line 460, in forward
return self._conv_forward(input, self.weight, self.bias)
File "G:_APWorkFlow_ComfyUI\ComfyUI\venv\lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Input type (struct c10::Half) and bias type (float) should be the same

Prompt executed in 52.22 seconds
Spaced Sampler: 0%| | 0/20 [00:00<?, ?it/s]

@Limbicnation
Copy link

Please try restarting your ComfyUI to resolve the issue.

@qianjun2659
Copy link

An error occurred when using real-world_ccsr-fp16.safetensors with the message "Input type (struct c10::Half) and bias type (float) should be the same." However, there is no issue when using real-world_ccsr-fp32.safetensors. The environment is an M1 Mac with macOS

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

7 participants