MaraScott / ComfyUI_MaraScott_Nodes

A set of community node including a universal bus and a large Upscaler/Refiner
https://www.marascott.ai/
Other
115 stars 15 forks source link

Failed to load transformers #162

Closed alenknight closed 2 weeks ago

alenknight commented 2 weeks ago

getting this error when running.... any experience with this?

MaraScottMcBoatyUpscalerRefiner_v5
Failed to import transformers.models.conditional_detr.configuration_conditional_detr because of the following error (look up to see its traceback):
cannot import name 'verify_backbone_config_arguments' from 'transformers.utils.backbone_utils' (C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\utils\backbone_utils.py)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\auto\auto_factory.py", line 750, in <listcomp>
    self._extra_content = {}
        ^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\auto\auto_factory.py", line 746, in _load_attr_from_module
    self._config_mapping = config_mapping
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\auto\auto_factory.py", line 690, in getattribute_from_module
    return None
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\utils\import_utils.py", line 1380, in __getattr__
    """

  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\utils\import_utils.py", line 1392, in _get_module
    {0} requires the ftfy library but it was not found in your environment. Checkout the instructions on the
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Failed to import transformers.models.conditional_detr.configuration_conditional_detr because of the following error (look up to see its traceback):
cannot import name 'verify_backbone_config_arguments' from 'transformers.utils.backbone_utils' (C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\utils\backbone_utils.py)

2024-11-08 11:26:16,517 - root - INFO - Prompt executed in 22.00 seconds
2024-11-08 11:26:39,922 - root - INFO - got prompt
2024-11-08 11:26:39,955 - root - WARNING - Warning torch.load doesn't support weights_only on this pytorch version, loading unsafely.
2024-11-08 11:26:47,406 - root - ERROR - !!! Exception during processing !!! Failed to import transformers.models.conditional_detr.configuration_conditional_detr because of the following error (look up to see its traceback):
cannot import name 'verify_backbone_config_arguments' from 'transformers.utils.backbone_utils' (C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\utils\backbone_utils.py)
2024-11-08 11:26:47,408 - root - ERROR - Traceback (most recent call last):
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\utils\import_utils.py", line 1390, in _get_module
    # docstyle-ignore

  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\conditional_detr\configuration_conditional_detr.py", line 25, in <module>
    from ...utils.backbone_utils import verify_backbone_config_arguments
ImportError: cannot import name 'verify_backbone_config_arguments' from 'transformers.utils.backbone_utils' (C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\utils\backbone_utils.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\AI\Comfyui\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 "C:\AI\Comfyui\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 "C:\AI\Comfyui\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "C:\AI\Comfyui\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\ComfyUI\custom_nodes\ComfyUI_MaraScott_Nodes\py\nodes\UpscalerRefiner\McBoaty_v5.py", line 927, in fn
    upscaler_result = McBoaty_Upscaler_v5.fn(**kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\ComfyUI\custom_nodes\ComfyUI_MaraScott_Nodes\py\nodes\UpscalerRefiner\McBoaty_v5.py", line 143, in fn
    self.PARAMS.grid_specs, self.OUTPUTS.grid_images, self.OUTPUTS.grid_prompts = self.upscale(self.OUTPUTS.image, "Upscaling")
                                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\ComfyUI\custom_nodes\ComfyUI_MaraScott_Nodes\py\nodes\UpscalerRefiner\McBoaty_v5.py", line 289, in upscale
    llm = MS_Llm(self.LLM.vision_model, self.LLM.model)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\ComfyUI\custom_nodes\ComfyUI_MaraScott_Nodes\py\inc\lib\llm.py", line 141, in __init__
    self.vision_llm = MS_Llm_Nlpconnect()
                      ^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\ComfyUI\custom_nodes\ComfyUI_MaraScott_Nodes\py\inc\lib\llm.py", line 92, in __init__
    self.model = VisionEncoderDecoderModel.from_pretrained(self.name)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\vision_encoder_decoder\modeling_vision_encoder_decoder.py", line 359, in from_pretrained
    # This is only for copying some specific attributes of this particular model.
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\modeling_utils.py", line 3375, in from_pretrained
    ignored when using `from_tf` or `from_flax`.
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\vision_encoder_decoder\modeling_vision_encoder_decoder.py", line 193, in __init__
    super().__init__(config)
                  ^^^^^^^^^^^
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\auto\auto_factory.py", line 415, in from_config
    f"`{self.__class__.__name__}.from_config(config)` methods."
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\auto\auto_factory.py", line 749, in keys
    self._model_mapping._model_mapping = self
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\auto\auto_factory.py", line 750, in <listcomp>
    self._extra_content = {}
        ^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\auto\auto_factory.py", line 746, in _load_attr_from_module
    self._config_mapping = config_mapping
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\models\auto\auto_factory.py", line 690, in getattribute_from_module
    return None
  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\utils\import_utils.py", line 1380, in __getattr__
    """

  File "C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\utils\import_utils.py", line 1392, in _get_module
    {0} requires the ftfy library but it was not found in your environment. Checkout the instructions on the
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Failed to import transformers.models.conditional_detr.configuration_conditional_detr because of the following error (look up to see its traceback):
cannot import name 'verify_backbone_config_arguments' from 'transformers.utils.backbone_utils' (C:\AI\Comfyui\python_embeded\Lib\site-packages\transformers\utils\backbone_utils.py)

2024-11-08 11:26:47,411 - root - INFO - Prompt executed in 7.47 seconds

Attached Workflow

Please make sure that workflow does not contain any sensitive information such as API keys or passwords.

{"last_node_id":115,"last_link_id":223,"nodes":[{"id":55,"type":"UNETLoader","pos":{"0":-180,"1":200},"size":{"0":310,"1":80},"flags":{"collapsed":false},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[197],"slot_index":0,"shape":3,"label":"MODEL"}],"properties":{"Node name for S&R":"UNETLoader"},"widgets_values":["flux_dev_fp8_scaled_diffusion_model.safetensors","fp8_e4m3fn"]},{"id":6,"type":"EmptyLatentImage","pos":{"0":665,"1":-145},"size":{"0":320,"1":110},"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[177],"slot_index":0,"shape":3,"label":"LATENT"}],"properties":{"Node name for S&R":"EmptyLatentImage"},"widgets_values":[1024,1024,1]},{"id":7,"type":"VAEDecode","pos":{"0":1028,"1":-107},"size":{"0":210,"1":50},"flags":{},"order":11,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":6,"slot_index":0,"label":"samples"},{"name":"vae","type":"VAE","link":7,"label":"vae"}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[202],"slot_index":0,"shape":3,"label":"IMAGE"}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":21,"type":"PreviewImage","pos":{"0":1380,"1":-100},"size":{"0":460,"1":620},"flags":{},"order":13,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":208,"slot_index":0,"label":"images"}],"outputs":[],"title":"t2i output","properties":{"Node name for S&R":"PreviewImage"},"widgets_values":[]},{"id":3,"type":"XlabsSampler","pos":{"0":680,"1":60},"size":{"0":340,"1":280},"flags":{},"order":10,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":199,"slot_index":0,"label":"model"},{"name":"conditioning","type":"CONDITIONING","link":18,"label":"conditioning"},{"name":"neg_conditioning","type":"CONDITIONING","link":26,"label":"neg_conditioning"},{"name":"latent_image","type":"LATENT","link":177,"label":"latent_image","shape":7},{"name":"controlnet_condition","type":"ControlNetCondition","link":null,"label":"controlnet_condition","shape":7}],"outputs":[{"name":"latent","type":"LATENT","links":[6],"shape":3,"label":"latent"}],"properties":{"Node name for S&R":"XlabsSampler"},"widgets_values":[1254078849854,"fixed",8,1,2,0,1]},{"id":108,"type":"VRAM_Debug","pos":{"0":1240,"1":-420},"size":{"0":320,"1":190},"flags":{},"order":12,"mode":0,"inputs":[{"name":"any_input","type":"*","link":null,"shape":7},{"name":"image_pass","type":"IMAGE","link":202,"shape":7},{"name":"model_pass","type":"MODEL","link":null,"shape":7}],"outputs":[{"name":"any_output","type":"*","links":null},{"name":"image_pass","type":"IMAGE","links":[208,209],"slot_index":1},{"name":"model_pass","type":"MODEL","links":[],"slot_index":2},{"name":"5,244,229,798   freemem_before","type":"INT","links":null,"slot_index":3},{"name":"5,267,036,326      freemem_after","type":"INT","links":null,"slot_index":4}],"properties":{"Node name for S&R":"VRAM_Debug"},"widgets_values":[true,true,true]},{"id":5,"type":"CLIPTextEncodeFlux","pos":{"0":202,"1":-146},"size":{"0":400,"1":330},"flags":{},"order":8,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":200,"slot_index":0,"label":"clip"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[18],"slot_index":0,"shape":3,"label":"CONDITIONING"}],"properties":{"Node name for S&R":"CLIPTextEncodeFlux"},"widgets_values":["porrait of a A futuristic Asian cyborg stripper with porcelain prosthetic limbs, 8trang style, intricately painted in the style of fine blue-and-white china. Her limbs are delicately crafted from porcelain, with cracks and details resembling antique pottery, connected by metallic and computer parts. Glowing blue lights pulse from the joints, where sleek mechanical connectors bridge the gaps between her delicate porcelain sections. Her body has an elegant, refined, yet robotic look, juxtaposing vintage porcelain aesthetics with high-tech cybernetic elements. Neon lights cast a soft, modern glow on her, and she stands in a futuristic nightclub setting.","8trang style, A futuristic Asian cyborg stripper with porcelain prosthetic limbs, intricately painted in the style of fine blue-and-white china. Her limbs are delicately crafted from porcelain, with cracks and details resembling antique pottery, connected by metallic and computer parts. Glowing blue lights pulse from the joints, where sleek mechanical connectors bridge the gaps between her delicate porcelain sections. Her body has an elegant, refined, yet robotic look, juxtaposing vintage porcelain aesthetics with high-tech cybernetic elements. Neon lights cast a soft, modern glow on her, and she stands in a futuristic nightclub setting.",3.5]},{"id":19,"type":"CLIPTextEncodeFlux","pos":{"0":200,"1":290},"size":{"0":390,"1":350},"flags":{},"order":9,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":201,"slot_index":0,"label":"clip"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[26],"slot_index":0,"shape":3,"label":"CONDITIONING"}],"properties":{"Node name for S&R":"CLIPTextEncodeFlux"},"widgets_values":["","",3.5]},{"id":8,"type":"VAELoader","pos":{"0":-180,"1":-70},"size":{"0":320,"1":60},"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"VAE","type":"VAE","links":[7],"slot_index":0,"shape":3,"label":"VAE"}],"properties":{"Node name for S&R":"VAELoader"},"widgets_values":["Flux_Dev_VAE.safetensors"]},{"id":4,"type":"DualCLIPLoader","pos":{"0":-180,"1":40},"size":{"0":320,"1":110},"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"CLIP","type":"CLIP","links":[198],"slot_index":0,"shape":3,"label":"CLIP"}],"properties":{"Node name for S&R":"DualCLIPLoader"},"widgets_values":["clip_l.safetensors","t5xxl_fp16.safetensors","flux"]},{"id":107,"type":"Power Lora Loader (rgthree)","pos":{"0":-190,"1":340},"size":{"0":340,"1":170},"flags":{},"order":5,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":197,"dir":3},{"name":"clip","type":"CLIP","link":198,"dir":3}],"outputs":[{"name":"MODEL","type":"MODEL","links":[199],"slot_index":0,"shape":3,"dir":4},{"name":"CLIP","type":"CLIP","links":[200,201],"slot_index":1,"shape":3,"dir":4}],"properties":{"Show Strengths":"Single Strength"},"widgets_values":[null,{"type":"PowerLoraLoaderHeaderWidget"},{"on":true,"lora":"Flux_turbo_Alpha.safetensors","strength":1,"strengthTwo":null},{"on":true,"lora":"Art Style\\BatTrangCeramics_by_Lam_f3.safetensors","strength":1,"strengthTwo":null},null,""]},{"id":112,"type":"PreviewImage","pos":{"0":2630.667236328125,"1":-445.4289855957031},"size":{"0":210,"1":30},"flags":{},"order":15,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":216}],"outputs":[],"properties":{"Node name for S&R":"PreviewImage"}},{"id":113,"type":"CheckpointLoaderSimple","pos":{"0":1540,"1":-530},"size":{"0":320,"1":100},"flags":{},"order":4,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[217],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[218,220,221],"slot_index":1},{"name":"VAE","type":"VAE","links":[219],"slot_index":2}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["Realistc\\juggernautXL_juggXIByRundiffusion.safetensors"]},{"id":115,"type":"CLIPTextEncode","pos":{"0":1450,"1":-710},"size":{"0":400,"1":200},"flags":{},"order":7,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":221}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[222],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":[""]},{"id":114,"type":"CLIPTextEncode","pos":{"0":1990,"1":-700},"size":{"0":400,"1":200},"flags":{},"order":6,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":220}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[223],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":[""]},{"id":110,"type":"MaraScottMcBoatyUpscalerRefiner_v5","pos":{"0":2000,"1":-440},"size":{"0":480,"1":800},"flags":{},"order":14,"mode":0,"inputs":[{"name":"image","type":"IMAGE","link":209},{"name":"model","type":"MODEL","link":217},{"name":"clip","type":"CLIP","link":218},{"name":"vae","type":"VAE","link":219},{"name":"positive","type":"CONDITIONING","link":222},{"name":"negative","type":"CONDITIONING","link":223}],"outputs":[{"name":"McBoaty Pipe","type":"MC_BOATY_PIPE","links":null},{"name":"McPrompty Pipe","type":"MC_PROMPTY_PIPE_IN","links":null},{"name":"image","type":"IMAGE","links":[216],"slot_index":2},{"name":"image (orignal)","type":"IMAGE","links":null},{"name":"tiles","type":"IMAGE","links":null},{"name":"prompts","type":"STRING","links":null},{"name":"info","type":"STRING","links":null}],"properties":{"Node name for S&R":"MaraScottMcBoatyUpscalerRefiner_v5"},"widgets_values":[788498421867836,"fixed","4x-UltraSharp.pth","bicubic",512,64,true,512,"none",false,"microsoft/Florence-2-large","llama3-70b-8192",true,1,"BasicScheduler","SDXL","euler","normal",10,2.5,0.27,"None",0.6,0.6,0.4,0,1]}],"links":[[6,3,0,7,0,"LATENT"],[7,8,0,7,1,"VAE"],[18,5,0,3,1,"CONDITIONING"],[26,19,0,3,2,"CONDITIONING"],[177,6,0,3,3,"LATENT"],[197,55,0,107,0,"MODEL"],[198,4,0,107,1,"CLIP"],[199,107,0,3,0,"MODEL"],[200,107,1,5,0,"CLIP"],[201,107,1,19,0,"CLIP"],[202,7,0,108,1,"IMAGE"],[208,108,1,21,0,"IMAGE"],[209,108,1,110,0,"IMAGE"],[216,110,2,112,0,"IMAGE"],[217,113,0,110,1,"MODEL"],[218,113,1,110,2,"CLIP"],[219,113,2,110,3,"VAE"],[220,113,1,114,0,"CLIP"],[221,113,1,115,0,"CLIP"],[222,115,0,110,4,"CONDITIONING"],[223,114,0,110,5,"CONDITIONING"]],"groups":[{"title":"Load Model","bounding":[-210,-190,371,700],"color":"#3f789e","font_size":24,"flags":{}}],"config":{},"extra":{"ds":{"scale":0.876922695000008,"offset":[-1225.920538416374,574.6447650238821]}},"version":0.4}

Additional Context

(Please add any additional context or steps to reproduce the error here)

MaraScott commented 2 weeks ago

Hi, This error seems to be related to your installation of transformers.

you might need to check your version for transformers and install ftfy which is not part of my node.

I close the issue, as this should not be related to the node, feel free to reopen otherwise

alenknight commented 2 weeks ago

understood... thanks. I'll look at transformers... but what version is needed? I'm running 4.46.2

MaraScott commented 2 weeks ago

I don't know, it depends on your settings.

Maybe a full reinstall of comfyui with a conda env would make it easier to fix the issue