kijai / ComfyUI-SUPIR

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

ERROR: "upsample_nearest2d_out_frame" not implemented for 'BFloat16' #73

Closed Rayray927 closed 8 months ago

Rayray927 commented 8 months ago
ERROR:root:Traceback (most recent call last):
  File "D:\Blender_ComfyUI\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "D:\Blender_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 "D:\Blender_ComfyUI\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\ComfyUI-SUPIR\nodes.py", line 165, in process
    samples = self.model.batchify_sample(resized_image[i].unsqueeze(0), captions_list, num_steps=steps, restoration_scale=restoration_scale, s_churn=s_churn,
  File "D:\Blender_ComfyUI\python_embeded\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\ComfyUI-SUPIR\SUPIR\models\SUPIR_model.py", line 127, in batchify_sample
    x_stage1 = self.decode_first_stage(_z)
  File "D:\Blender_ComfyUI\python_embeded\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\ComfyUI-SUPIR\SUPIR\models\SUPIR_model.py", line 77, in decode_first_stage
    out = self.first_stage_model.decode(z)
  File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\models\autoencoder.py", line 318, in decode
    dec = self.decoder(z, **decoder_kwargs)
  File "D:\Blender_ComfyUI\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\ComfyUI-SUPIR\SUPIR\utils\tilevae.py", line 703, in __call__
    return self.vae_tile_forward(x)
  File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\ComfyUI-SUPIR\SUPIR\utils\tilevae.py", line 586, in wrapper
    ret = fn(*args, **kwargs)
  File "D:\Blender_ComfyUI\python_embeded\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\ComfyUI-SUPIR\SUPIR\utils\tilevae.py", line 936, in vae_tile_forward
    tile = task[1](tile)
  File "D:\Blender_ComfyUI\python_embeded\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "D:\Blender_ComfyUI\ComfyUI\custom_nodes\ComfyUI-SUPIR\sgm\modules\diffusionmodules\model.py", line 72, in forward
    x = torch.nn.functional.interpolate(x, scale_factor=2.0, mode="nearest")
  File "D:\Blender_ComfyUI\python_embeded\lib\site-packages\torch\nn\functional.py", line 3931, in interpolate
    return torch._C._nn.upsample_nearest2d(input, output_size, scale_factors)
RuntimeError: "upsample_nearest2d_out_frame" not implemented for 'BFloat16'

i don't know how to fix it.

kijai commented 8 months ago

What GPU and pytorch version are you running? I think bf16 interpolation functions need 2.1 at least. Alternatively you can just manually choose the dtype of fp16 instead.

Rayray927 commented 8 months ago

What GPU and pytorch version are you running? I think bf16 interpolation functions need 2.1 at least. Alternatively you can just manually choose the dtype of fp16 instead.

it worked! i upgrade my pytorch and xformers to the latest.

kijai commented 8 months ago

Good to know, thanks for the report!