chflame163 / ComfyUI_LayerStyle

A set of nodes for ComfyUI that can composite layer and mask to achieve Photoshop like functionality.
MIT License
1.31k stars 74 forks source link

florence2 load error #320

Open Hjingmo opened 2 weeks ago

Hjingmo commented 2 weeks ago

dzNodes: LayerStyle -> Error loading model large-PromptGen-v1.5: The checkpoint you are trying to load has model type florence2 but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.

dzNodes: LayerStyle -> Attempting to load tokenizer instead of processor...

dzNodes: LayerStyle -> Error loading model or tokenizer: The checkpoint you are trying to load has model type florence2 but Transformers does not recognize this architecture. This could be because of an issue with the checkpoint, or because your version of Transformers is out of date.

!!! Exception during processing !!! cannot access local variable 'model' where it is not associated with a value Traceback (most recent call last): File "/data/myai/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 "/data/myai/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 "/data/myai/ComfyUI/execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "/data/myai/ComfyUI/execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/myai/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/florence2_ultra.py", line 402, in load self.model, self.processor = load_model(version) ^^^^^^^^^^^^^^^^^^^ File "/data/myai/ComfyUI/custom_nodes/ComfyUI_LayerStyle/py/florence2_ultra.py", line 63, in load_model return (model.to(device), processor) ^^^^^ UnboundLocalError: cannot access local variable 'model' where it is not associated with a value

chflame163 commented 2 weeks ago

Check the transformers dependency package version. If it is lower than 4.43.3, upgrade it.

camoody1 commented 2 weeks ago

I get this same error when trying to use the "large-PromptGen-v1.5" model from Miaoshouai. I have the most recent version of Transformers and the model DOES work when I use it in Miaoshouai's own custom node.

chflame163 commented 2 weeks ago

MiaoshouAI updated their PromptGen-v1.5 model and updated the loading code, I have just fixed this.