Skip to content

Upscaling with models is broken #328

@benedikt90

Description

@benedikt90

Comfy: ComfyUI@3dfdddcc91
Comflowy@0.2.3-alpha
pytorch version: 2.5.1
Setup: M4 Pro Macbook

Error:

view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

  File "/Users/$USER/comflowy/ComfyUI/execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
  File "/Users/$USER/comflowy/ComfyUI/execution.py", line 198, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)
  File "/Users/$USER/comflowy/ComfyUI/execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "/Users/$USER/comflowy/ComfyUI/execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
  File "/Users/$USER/comflowy/ComfyUI/comfy_extras/nodes_upscale_model.py", line 70, in upscale
    s = comfy.utils.tiled_scale(in_img, lambda a: upscale_model(a), tile_x=tile, tile_y=tile, overlap=overlap, upscale_amount=upscale_model.scale, pbar=pbar)
  File "/Users/$USER/comflowy/ComfyUI/comfy/utils.py", line 821, in tiled_scale
    return tiled_scale_multidim(samples, function, (tile_y, tile_x), overlap, upscale_amount, out_channels, output_device, pbar)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "/Users/$USER/comflowy/ComfyUI/comfy/utils.py", line 795, in tiled_scale_multidim
    ps = function(s_in).to(output_device)
  File "/Users/$USER/comflowy/ComfyUI/comfy_extras/nodes_upscale_model.py", line 70, in <lambda>
    s = comfy.utils.tiled_scale(in_img, lambda a: upscale_model(a), tile_x=tile, tile_y=tile, overlap=overlap, upscale_amount=upscale_model.scale, pbar=pbar)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/spandrel/__helpers/model_descriptor.py", line 472, in __call__
    output = self._call_fn(self.model, image)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/spandrel/__helpers/model_descriptor.py", line 439, in <lambda>
    self._call_fn = call_fn or (lambda model, image: model(image))
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/spandrel/architectures/ESRGAN/__arch/RRDB.py", line 143, in forward
    return self.model(x)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/nn/modules/container.py", line 250, in forward
    input = module(input)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 554, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/Users/$USER/miniconda3/envs/comflowy/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 549, in _conv_forward
    return F.conv2d(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions