viperyl / ComfyUI-RGT

6 stars 2 forks source link

invalid load key, 'v' #1

Closed blepping closed 3 months ago

blepping commented 3 months ago

i gave it a try but unfortunately unpickling the model always seems to fail. tested with PyTorch 2.3.0 as well as 2.4.0 nightly, 2x, 3x, 4x models and also RGT-S and it doesn't seem to matter what you choose:

2024-06-02 03:25:44.730 | DEBUG    | ComfyUI-RGT.node:load_model:34 - image: torch.Size([1, 768, 768, 3])
2024-06-02 03:25:44.869 | DEBUG    | ComfyUI-RGT.model:load_model:867 - checkpoints path:/path/ComfyUI/models/RGT/RGT/RGT_x4.pth
!!! Exception during processing!!! invalid load key, 'v'.
Traceback (most recent call last):
  File "/path/ComfyUI/execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/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 "/path/ComfyUI/execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/ComfyUI/custom_nodes/ComfyUI-RGT/node.py", line 38, in load_model
    self.model = RGTModel(
                 ^^^^^^^^^
  File "/path/ComfyUI/custom_nodes/ComfyUI-RGT/model.py", line 829, in __init__
    self.load_model(name, upscale, device, model_path)
  File "/path/ComfyUI/custom_nodes/ComfyUI-RGT/model.py", line 868, in load_model
    checkpoints = torch.load(model_path)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/otherpath/comfy/.venv/lib/python3.12/site-packages/torch/serialization.py", line 1040, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/otherpath/comfy/.venv/lib/python3.12/site-packages/torch/serialization.py", line 1262, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_pickle.UnpicklingError: invalid load key, 'v'.

Prompt executed in 5.95 seconds
viperyl commented 3 months ago

Hi, please check the model sha256sum, for example, if you are using RGT with x4 scale, the used model is RGT_x4.pth, and it is sha256sum result is 8335d4d314cf778df0fba0b1a57d757dcbc80267afd08ab45647a9997a45133c, please guarantee the model file not damaged.

in you case, try the following command in you terminal: sha256sum /path/ComfyUI/models/RGT/RGT/RGT_x4.pth

viperyl commented 3 months ago

I tested this on a brand new environment, here is my comfyui temrinal post of example worklfow

To see the GUI go to: http://127.0.0.1:8388
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
FETCH DATA from: /root/code/ComfyUI/custom_nodes/ComfyUI-Manager/extension-node-map.json
got prompt
[rgthree] Using rgthree's optimized recursive execution.
[rgthree] First run patching recursive_output_delete_if_changed and recursive_will_execute.
[rgthree] Note: If execution seems broken due to forward ComfyUI changes, you can disable the optimization from rgthree settings in ComfyUI.
2024-06-03 09:57:40.301 | DEBUG    | ComfyUI-RGT.node:load_model:34 - image: torch.Size([1, 1440, 1080, 3])
2024-06-03 09:57:40.672 | DEBUG    | ComfyUI-RGT.model:load_model:867 - checkpoints path:/root/code/ComfyUI/models/RGT/RGT/RGT_x2.pth
2024-06-03 09:57:41.090 | DEBUG    | ComfyUI-RGT.model:__call__:878 - image: torch.Size([1, 3, 1440, 1080])
2024-06-03 09:58:21.374 | DEBUG    | ComfyUI-RGT.node:load_model:54 - output: torch.Size([1, 2880, 2160, 3])
Prompt executed in 41.83 seconds
blepping commented 3 months ago

i'm actually dumb and somehow only managed to fetch the LFS objects but not check them out. sorry for wasting your time!

it seems like ComfyUI just natively supports RGT currently though:

image

that probably changed when it switched to using spandrel