comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
52.15k stars 5.49k forks source link

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

Open pphoto808 opened 4 days ago

pphoto808 commented 4 days ago

Your question

Mac Studio M2 Ultra MacOS: 15.0

I recently "updated" Comfy using the installation guide from Comfy.Org to fix the issue of getting noise images. It actually fixed that issue but now I get this error when I attempt to upscale an images. All the time with SD Ultimate and dependent on the size of the images also with upscale using model or other upscale nodes.

Interestingly i have no problems using any upscale method while running Comfy in Pinokio. The only thing I can think of that's different is possibly the versions of Pytorch.

Any suggestion greatly appreciated!

Logs

# ComfyUI Error Report
## Error Details
- **Node Type:** UltimateSDUpscale
- **Exception Type:** RuntimeError
- **Exception Message:** view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
## Stack Trace

  File "/Volumes/Extreme_Pro/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 "/Volumes/Extreme_Pro/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 "/Volumes/Extreme_Pro/ComfyUI/execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)

  File "/Volumes/Extreme_Pro/ComfyUI/execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))

  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/nodes.py", line 151, in upscale
    processed = script.run(p=self.sdprocessing, _=None, tile_width=self.tile_width, tile_height=self.tile_height,

  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/repositories/ultimate_sd_upscale/scripts/ultimate-upscale.py", line 558, in run
    upscaler.upscale()

  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/usdu_patch.py", line 66, in new_upscale
    old_upscale(self)

  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/repositories/ultimate_sd_upscale/scripts/ultimate-upscale.py", line 83, in upscale
    self.image = self.upscaler.scaler.upscale(self.image, value, self.upscaler.data_path)

  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/modules/upscaler.py", line 23, in upscale
    shared.batch = [self._upscale(img, scale) for img in shared.batch]

  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/modules/upscaler.py", line 23, in <listcomp>
    shared.batch = [self._upscale(img, scale) for img in shared.batch]

  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/modules/upscaler.py", line 19, in _upscale
    (upscaled,) = image_upscale_node.upscale(shared.actual_upscaler, tensor)

  File "/Volumes/Extreme_Pro/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 "/Volumes/Extreme_Pro/ComfyUI/comfy/utils.py", line 776, in tiled_scale
    return tiled_scale_multidim(samples, function, (tile_y, tile_x), overlap, upscale_amount, out_channels, output_device, pbar)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)

  File "/Volumes/Extreme_Pro/ComfyUI/comfy/utils.py", line 750, in tiled_scale_multidim
    ps = function(s_in).to(output_device)

  File "/Volumes/Extreme_Pro/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 "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/spandrel/__helpers/model_descriptor.py", line 472, in __call__
    output = self._call_fn(self.model, image)

  File "/opt/miniconda3/envs/comfyenv/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 "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/spandrel/architectures/ESRGAN/__arch/RRDB.py", line 143, in forward
    return self.model(x)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/container.py", line 250, in forward
    input = module(input)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 554, in forward
    return self._conv_forward(input, self.weight, self.bias)

  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 549, in _conv_forward
    return F.conv2d(

System Information

Logs

2024-09-26 19:47:15,506 - root - INFO - Total VRAM 65536 MB, total RAM 65536 MB
2024-09-26 19:47:15,506 - root - INFO - pytorch version: 2.6.0.dev20240926
2024-09-26 19:47:15,506 - root - INFO - Set vram state to: SHARED
2024-09-26 19:47:15,506 - root - INFO - Device: mps
2024-09-26 19:47:16,231 - root - INFO - Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
2024-09-26 19:47:16,628 - root - INFO - [Prompt Server] web root: /Volumes/Extreme_Pro/ComfyUI/web
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path checkpoints /Volumes/Extreme_Pro/stable-diffusion-webui/models/Stable-diffusion
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path configs /Volumes/Extreme_Pro/stable-diffusion-webui/models/Stable-diffusion
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path vae /Volumes/Extreme_Pro/stable-diffusion-webui/models/VAE
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path loras /Volumes/Extreme_Pro/stable-diffusion-webui/models/Lora
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path loras /Volumes/Extreme_Pro/stable-diffusion-webui/models/LyCORIS
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path upscale_models /Volumes/Extreme_Pro/stable-diffusion-webui/models/ESRGAN
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path upscale_models /Volumes/Extreme_Pro/stable-diffusion-webui/models/RealESRGAN
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path upscale_models /Volumes/Extreme_Pro/stable-diffusion-webui/models/SwinIR
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path embeddings /Volumes/Extreme_Pro/stable-diffusion-webui/embeddings
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path hypernetworks /Volumes/Extreme_Pro/stable-diffusion-webui/models/hypernetworks
2024-09-26 19:47:16,629 - root - INFO - Adding extra search path controlnet /Volumes/Extreme_Pro/stable-diffusion-webui/models/ControlNet
2024-09-26 19:47:22,845 - root - INFO - 
Import times for custom nodes:
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-Crystools-save
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/SDXLAspectRatio.py
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/websocket_image_save.py
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_IPAdapter_plus
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/sdxl_prompt_styler
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/cg-use-everywhere
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUi_NNLatentUpscale
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-Logic
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/lora-info
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/comfy-image-saver
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-AutomaticCFG
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-post-processing-nodes
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/WAS_Extras
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_JPS-Nodes
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyMath
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-Custom-Scripts
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-QualityOfLifeSuit_Omar92
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_essentials
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/Derfuu_ComfyUI_ModdedNodes
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/efficiency-nodes-comfyui
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/rgthree-comfy
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/aegisflow_utility_nodes
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/comfyui-prompt-reader-node
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/comfyui_controlnet_aux
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_tinyterraNodes
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-Impact-Pack
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-IF_AI_tools
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-Anyline
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-Inspire-Pack
2024-09-26 19:47:22,845 - root - INFO -    0.0 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-Crystools
2024-09-26 19:47:22,845 - root - INFO -    0.1 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/comfyui-art-venture
2024-09-26 19:47:22,845 - root - INFO -    0.1 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/comfyui-propost
2024-09-26 19:47:22,845 - root - INFO -    0.1 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/comfyui_dagthomas
2024-09-26 19:47:22,845 - root - INFO -    0.1 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-Manager
2024-09-26 19:47:22,845 - root - INFO -    0.1 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-Easy-Use
2024-09-26 19:47:22,845 - root - INFO -    0.2 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/comfy_PoP
2024-09-26 19:47:22,846 - root - INFO -    0.3 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/comfyui_segment_anything
2024-09-26 19:47:22,846 - root - INFO -    0.4 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_Custom_Nodes_AlekPet
2024-09-26 19:47:22,846 - root - INFO -    0.5 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/comfyui-reactor-node
2024-09-26 19:47:22,846 - root - INFO -    0.6 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/was-node-suite-comfyui
2024-09-26 19:47:22,846 - root - INFO -    2.5 seconds: /Volumes/Extreme_Pro/ComfyUI/custom_nodes/DZ-FaceDetailer
2024-09-26 19:47:22,846 - root - INFO - 
2024-09-26 19:47:22,853 - root - INFO - Starting server

2024-09-26 19:47:22,853 - root - INFO - To see the GUI go to: http://127.0.0.1:8188
2024-09-26 19:47:29,851 - root - ERROR - [ERROR] An error occurred while retrieving information for the 'IF_ChatPrompt' node.
2024-09-26 19:47:29,851 - root - ERROR - Traceback (most recent call last):
  File "/Volumes/Extreme_Pro/ComfyUI/server.py", line 564, in get_object_info
    out[x] = node_info(x)
  File "/Volumes/Extreme_Pro/ComfyUI/server.py", line 531, in node_info
    info['input'] = obj_class.INPUT_TYPES()
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-IF_AI_tools/IFChatPromptNode.py", line 109, in INPUT_TYPES
    node = cls()
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-IF_AI_tools/IFChatPromptNode.py", line 53, in __init__
    self.agent_tools = self.load_agent_tools()
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI-IF_AI_tools/IFChatPromptNode.py", line 78, in load_agent_tools
    for filename in os.listdir(self.agents_dir):
FileNotFoundError: [Errno 2] No such file or directory: '/Volumes/Extreme_Pro/ComfyUI/input/IF_AI/presets/agents'

2024-09-26 19:47:32,667 - root - INFO - got prompt
2024-09-26 19:47:32,914 - root - INFO - model weight dtype torch.float16, manual cast: None
2024-09-26 19:47:32,915 - root - INFO - model_type EPS
2024-09-26 19:47:33,799 - root - INFO - Using split attention in VAE
2024-09-26 19:47:33,800 - root - INFO - Using split attention in VAE
2024-09-26 19:47:33,940 - root - INFO - Requested to load SDXLClipModel
2024-09-26 19:47:33,940 - root - INFO - Loading 1 new model
2024-09-26 19:47:33,946 - root - INFO - loaded completely 0.0 1560.802734375 True
2024-09-26 19:47:34,452 - root - INFO - Using split attention in VAE
2024-09-26 19:47:34,452 - root - INFO - Using split attention in VAE
2024-09-26 19:47:34,861 - root - WARNING - Warning torch.load doesn't support weights_only on this pytorch version, loading unsafely.
2024-09-26 19:47:35,078 - root - INFO - Requested to load SDXLClipModel
2024-09-26 19:47:35,079 - root - INFO - Loading 1 new model
2024-09-26 19:47:36,479 - root - INFO - loaded completely 0.0 1560.802734375 True
2024-09-26 19:47:37,497 - root - INFO - Requested to load SDXL
2024-09-26 19:47:37,497 - root - INFO - Loading 1 new model
2024-09-26 19:47:40,183 - root - INFO - loaded completely 0.0 4897.0483474731445 True
2024-09-26 19:48:25,188 - root - INFO - Requested to load AutoencoderKL
2024-09-26 19:48:25,188 - root - INFO - Loading 1 new model
2024-09-26 19:48:25,338 - root - INFO - loaded completely 0.0 319.11416244506836 True
2024-09-26 19:48:26,695 - root - ERROR - !!! Exception during processing !!! view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
2024-09-26 19:48:26,697 - root - ERROR - Traceback (most recent call last):
  File "/Volumes/Extreme_Pro/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 "/Volumes/Extreme_Pro/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 "/Volumes/Extreme_Pro/ComfyUI/execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "/Volumes/Extreme_Pro/ComfyUI/execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/nodes.py", line 151, in upscale
    processed = script.run(p=self.sdprocessing, _=None, tile_width=self.tile_width, tile_height=self.tile_height,
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/repositories/ultimate_sd_upscale/scripts/ultimate-upscale.py", line 558, in run
    upscaler.upscale()
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/usdu_patch.py", line 66, in new_upscale
    old_upscale(self)
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/repositories/ultimate_sd_upscale/scripts/ultimate-upscale.py", line 83, in upscale
    self.image = self.upscaler.scaler.upscale(self.image, value, self.upscaler.data_path)
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/modules/upscaler.py", line 23, in upscale
    shared.batch = [self._upscale(img, scale) for img in shared.batch]
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/modules/upscaler.py", line 23, in <listcomp>
    shared.batch = [self._upscale(img, scale) for img in shared.batch]
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/modules/upscaler.py", line 19, in _upscale
    (upscaled,) = image_upscale_node.upscale(shared.actual_upscaler, tensor)
  File "/Volumes/Extreme_Pro/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 "/Volumes/Extreme_Pro/ComfyUI/comfy/utils.py", line 776, in tiled_scale
    return tiled_scale_multidim(samples, function, (tile_y, tile_x), overlap, upscale_amount, out_channels, output_device, pbar)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "/Volumes/Extreme_Pro/ComfyUI/comfy/utils.py", line 750, in tiled_scale_multidim
    ps = function(s_in).to(output_device)
  File "/Volumes/Extreme_Pro/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 "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/spandrel/__helpers/model_descriptor.py", line 472, in __call__
    output = self._call_fn(self.model, image)
  File "/opt/miniconda3/envs/comfyenv/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 "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/spandrel/architectures/ESRGAN/__arch/RRDB.py", line 143, in forward
    return self.model(x)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/container.py", line 250, in forward
    input = module(input)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 554, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 549, in _conv_forward
    return F.conv2d(
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

2024-09-26 19:48:26,697 - root - INFO - Prompt executed in 54.02 seconds
2024-09-26 19:48:45,925 - root - INFO - got prompt
2024-09-26 19:49:31,667 - root - ERROR - !!! Exception during processing !!! view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
2024-09-26 19:49:31,667 - root - ERROR - Traceback (most recent call last):
  File "/Volumes/Extreme_Pro/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 "/Volumes/Extreme_Pro/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 "/Volumes/Extreme_Pro/ComfyUI/execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "/Volumes/Extreme_Pro/ComfyUI/execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/nodes.py", line 151, in upscale
    processed = script.run(p=self.sdprocessing, _=None, tile_width=self.tile_width, tile_height=self.tile_height,
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/repositories/ultimate_sd_upscale/scripts/ultimate-upscale.py", line 558, in run
    upscaler.upscale()
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/usdu_patch.py", line 66, in new_upscale
    old_upscale(self)
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/repositories/ultimate_sd_upscale/scripts/ultimate-upscale.py", line 83, in upscale
    self.image = self.upscaler.scaler.upscale(self.image, value, self.upscaler.data_path)
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/modules/upscaler.py", line 23, in upscale
    shared.batch = [self._upscale(img, scale) for img in shared.batch]
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/modules/upscaler.py", line 23, in <listcomp>
    shared.batch = [self._upscale(img, scale) for img in shared.batch]
  File "/Volumes/Extreme_Pro/ComfyUI/custom_nodes/ComfyUI_UltimateSDUpscale/modules/upscaler.py", line 19, in _upscale
    (upscaled,) = image_upscale_node.upscale(shared.actual_upscaler, tensor)
  File "/Volumes/Extreme_Pro/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 "/Volumes/Extreme_Pro/ComfyUI/comfy/utils.py", line 776, in tiled_scale
    return tiled_scale_multidim(samples, function, (tile_y, tile_x), overlap, upscale_amount, out_channels, output_device, pbar)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "/Volumes/Extreme_Pro/ComfyUI/comfy/utils.py", line 750, in tiled_scale_multidim
    ps = function(s_in).to(output_device)
  File "/Volumes/Extreme_Pro/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 "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/spandrel/__helpers/model_descriptor.py", line 472, in __call__
    output = self._call_fn(self.model, image)
  File "/opt/miniconda3/envs/comfyenv/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 "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/spandrel/architectures/ESRGAN/__arch/RRDB.py", line 143, in forward
    return self.model(x)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/container.py", line 250, in forward
    input = module(input)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 554, in forward
    return self._conv_forward(input, self.weight, self.bias)
  File "/opt/miniconda3/envs/comfyenv/lib/python3.10/site-packages/torch/nn/modules/conv.py", line 549, in _conv_forward
    return F.conv2d(
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

2024-09-26 19:49:31,668 - root - INFO - Prompt executed in 45.72 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_
ltdrdata commented 4 days ago

It is not clear whether this issue is related to UltimateSDUpscaleor the model upscale. Try using the Upscale Image (using Model) directly with the same upscale model used in UltimateSDUpscale, instead of using UltimateSDUpscale. If the issue can be reproduced, leave a simplified workflow and log here. If it cannot be reproduced, inquire about the issue in the UltimateSDUpscale repository.

pphoto808 commented 4 days ago

It is not clear whether this issue is related to UltimateSDUpscaleor the model upscale. Try using the Upscale Image (using Model) directly with the same upscale model used in UltimateSDUpscale, instead of using UltimateSDUpscale. If the issue can be reproduced, leave a simplified workflow and log here. If it cannot be reproduced, inquire about the issue in the UltimateSDUpscale repository.

upscale_test.json

Didn't reproduce the error with upscale using model. The work around for now is using the upscale by node at 0.50 and then UltimateSDUpscale at 3x. It appears to be something with the size of the image it's having an issue with. As if the image being passed is too large. I'll ask in the USDUspcale.

Thanks

Adreitz commented 2 days ago

@ltdrdata I just experienced this same issue trying to do an i2i with Flux on MPS. It failed at the Upscale Image (using Model) node using 4xUltraSharp. The input image was 1024x1024. The strange thing is that this was a modification of a t2i upscaling workflow, and I routinely did 1st stage 1MP generations (since this is Flux) with no issues. But somehow loading the image from a file caused it to fail.

I put a regular Upscale Image node in between and found that an input any higher than 512x512 failed to pass through the upscale with model node. I think this issue should be reopened. i2i flux upscale.json input image