kijai / ComfyUI-SUPIR

SUPIR upscaling wrapper for ComfyUI
Other
1.59k stars 88 forks source link

v2 nodes - "Expected all tensors to be on the same device" #66

Closed cdb-boop closed 8 months ago

cdb-boop commented 8 months ago

failed-tensor-device-workflow

** Platform: Windows
** Python version: 3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:24:38) [MSC v.1916 64 bit (AMD64)]

...

Total VRAM 12288 MB, total RAM 65292 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 3060 : cudaMallocAsync
VAE dtype: torch.bfloat16
Using pytorch cross attention

...

Torch version: 2.1.2+cu121

...

Diffusion using bf16
making attention of type 'vanilla-xformers' with 512 in_channels
building MemoryEfficientAttnBlock with 512 in_channels...
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla-xformers' with 512 in_channels
building MemoryEfficientAttnBlock with 512 in_channels...
Attempting to load SUPIR model: [C:\ComfyUI\models\checkpoints\supir\SUPIR-v0Q-001.ckpt]
Loaded state_dict from [C:\ComfyUI\models\checkpoints\supir\SUPIR-v0Q-001.ckpt]
Attempting to load SDXL model: [C:\ComfyUI\models\Stable-diffusion\xl\juggernautXL_v9Rundiffusionphoto2.safetensors]
Loaded state_dict from [C:\ComfyUI\models\Stable-diffusion\xl\juggernautXL_v9Rundiffusionphoto2.safetensors]
Loading first clip model from SDXL checkpoint
Loading second clip model from SDXL checkpoint
torch.Size([24, 512, 512, 3])
len(tiles):  24
Encoder using bf16
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
[Tiled VAE]: the input size is tiny and unnecessary to tile.
captions:  [[''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], [''], ['']]
sampler_config:  {'target': '.sgm.modules.diffusionmodules.sampling.RestoreEDMSampler', 'params': {'num_steps': 45, 'restore_cfg': -1.0, 's_churn': 5, 's_noise': 1.003, 'discretization_config': {'target': '.sgm.modules.diffusionmodules.discretizer.LegacyDDPMDiscretization'}, 'guider_config': {'target': '.sgm.modules.diffusionmodules.guiders.LinearCFG', 'params': {'scale': 4.0, 'scale_min': 4.0}}}}
!!! Exception during processing !!!
Traceback (most recent call last):
  File "C:\ComfyUI\execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "C:\ComfyUI\execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "C:\ComfyUI\execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "C:\ComfyUI\custom_nodes\ComfyUI-SUPIR\nodes_v2.py", line 422, in sample
    _samples = self.sampler(denoiser, noised_z, cond=positive, uc=negative, x_center=latent.unsqueeze(0), control_scale=control_scale_end,
  File "C:\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules\diffusionmodules\sampling.py", line 430, in __call__
    x, s_in, sigmas, num_sigmas, cond, uc = self.prepare_sampling_loop(
  File "C:\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules\diffusionmodules\sampling.py", line 53, in prepare_sampling_loop
    x *= torch.sqrt(1.0 + sigmas[0] ** 2.0)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
cdb-boop commented 8 months ago

Related issue to issue #67.