comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
57.91k stars 6.14k forks source link

I have a problem with loras trained in ComfyUI #5239

Closed ABSOMA021085 closed 1 month ago

ABSOMA021085 commented 1 month ago

Your question

I have been having problems for some time with loras that I train in FluxGym, as well as loras that I train in Tensor Art, specifically it marks something as if it did not recognize the type of lora, the same happens with the loras that I download from Civitai and tensor Art, I would like to know what I am doing wrong or what I can do to make the loras work, if I am doing the training wrong, I hope you can help me because I have months with this problem and I can not make progress,

Logs

# ComfyUI Error Report
## Error Details
- **Node Type:** CheckpointLoaderSimple
- **Exception Type:** RuntimeError
- **Exception Message:** ERROR: Could not detect model type of: D:\ComfyUI_windows_portable\ComfyUI\models\checkpoints\1b9819f1-1035-49cc-bbbc-6293e99b0e8a.TA_trained.safetensors
## Stack Trace

  File "D:\ComfyUI_windows_portable\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 "D:\ComfyUI_windows_portable\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 "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)

  File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 540, in load_checkpoint
    out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "D:\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 563, in load_checkpoint_guess_config
    raise RuntimeError("ERROR: Could not detect model type of: {}".format(ckpt_path))

System Information

Logs

2024-10-13 15:28:45,472 - root - INFO - Total VRAM 24575 MB, total RAM 65461 MB
2024-10-13 15:28:45,472 - root - INFO - pytorch version: 2.4.1+cu124
2024-10-13 15:28:45,477 - root - INFO - Set vram state to: NORMAL_VRAM
2024-10-13 15:28:45,477 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync
2024-10-13 15:28:46,315 - root - INFO - Using pytorch cross attention
2024-10-13 15:28:47,848 - root - INFO - [Prompt Server] web root: D:\ComfyUI_windows_portable\ComfyUI\web
2024-10-13 15:28:49,190 - root - INFO - Total VRAM 24575 MB, total RAM 65461 MB
2024-10-13 15:28:49,190 - root - INFO - pytorch version: 2.4.1+cu124
2024-10-13 15:28:49,190 - root - INFO - Set vram state to: NORMAL_VRAM
2024-10-13 15:28:49,195 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync
2024-10-13 15:28:49,783 - root - INFO - 
Import times for custom nodes:
2024-10-13 15:28:49,783 - root - INFO -    0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\websocket_image_save.py
2024-10-13 15:28:49,788 - root - INFO -    0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\cg-use-everywhere
2024-10-13 15:28:49,788 - root - INFO -    0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_UltimateSDUpscale
2024-10-13 15:28:49,788 - root - INFO -    0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\rgthree-comfy
2024-10-13 15:28:49,788 - root - INFO -    0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI_essentials
2024-10-13 15:28:49,788 - root - INFO -    0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui_controlnet_aux
2024-10-13 15:28:49,788 - root - INFO -    0.0 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-KJNodes
2024-10-13 15:28:49,788 - root - INFO -    0.1 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Impact-Pack
2024-10-13 15:28:49,788 - root - INFO -    0.2 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-eesahesNodes
2024-10-13 15:28:49,788 - root - INFO -    0.5 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Manager
2024-10-13 15:28:49,788 - root - INFO -    0.6 seconds: D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-AdvancedLivePortrait
2024-10-13 15:28:49,788 - root - INFO - 
2024-10-13 15:28:49,798 - root - INFO - Starting server

2024-10-13 15:28:49,798 - root - INFO - To see the GUI go to: http://127.0.0.1:8188
2024-10-13 15:30:51,747 - root - INFO - got prompt
2024-10-13 15:30:51,762 - root - ERROR - !!! Exception during processing !!! ERROR: Could not detect model type of: D:\ComfyUI_windows_portable\ComfyUI\models\checkpoints\ElyseAly20.safetensors
2024-10-13 15:30:51,767 - root - ERROR - Traceback (most recent call last):
  File "D:\ComfyUI_windows_portable\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 "D:\ComfyUI_windows_portable\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 "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 540, in load_checkpoint
    out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 563, in load_checkpoint_guess_config
    raise RuntimeError("ERROR: Could not detect model type of: {}".format(ckpt_path))
RuntimeError: ERROR: Could not detect model type of: D:\ComfyUI_windows_portable\ComfyUI\models\checkpoints\ElyseAly20.safetensors

2024-10-13 15:30:51,767 - root - INFO - Prompt executed in 0.02 seconds
2024-10-13 15:33:22,112 - root - INFO - got prompt
2024-10-13 15:33:22,132 - root - ERROR - !!! Exception during processing !!! ERROR: Could not detect model type of: D:\ComfyUI_windows_portable\ComfyUI\models\checkpoints\1b9819f1-1035-49cc-bbbc-6293e99b0e8a.TA_trained.safetensors
2024-10-13 15:33:22,132 - root - ERROR - Traceback (most recent call last):
  File "D:\ComfyUI_windows_portable\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 "D:\ComfyUI_windows_portable\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 "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 540, in load_checkpoint
    out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ComfyUI_windows_portable\ComfyUI\comfy\sd.py", line 563, in load_checkpoint_guess_config
    raise RuntimeError("ERROR: Could not detect model type of: {}".format(ckpt_path))
RuntimeError: ERROR: Could not detect model type of: D:\ComfyUI_windows_portable\ComfyUI\models\checkpoints\1b9819f1-1035-49cc-bbbc-6293e99b0e8a.TA_trained.safetensors

2024-10-13 15:33:22,132 - root - INFO - Prompt executed in 0.02 seconds

Attached Workflow

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

{"last_node_id":9,"last_link_id":9,"nodes":[{"id":7,"type":"CLIPTextEncode","pos":{"0":413,"1":389},"size":{"0":425.27801513671875,"1":180.6060791015625},"flags":{},"order":3,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":5}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["text, watermark"]},{"id":5,"type":"EmptyLatentImage","pos":{"0":473,"1":609},"size":{"0":315,"1":106},"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[2],"slot_index":0}],"properties":{"Node name for S&R":"EmptyLatentImage"},"widgets_values":[512,512,1]},{"id":3,"type":"KSampler","pos":{"0":863,"1":186},"size":{"0":315,"1":262},"flags":{},"order":4,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":1},{"name":"positive","type":"CONDITIONING","link":4},{"name":"negative","type":"CONDITIONING","link":6},{"name":"latent_image","type":"LATENT","link":2}],"outputs":[{"name":"LATENT","type":"LATENT","links":[7],"slot_index":0}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[99274626696299,"randomize",20,8,"euler","normal",1]},{"id":8,"type":"VAEDecode","pos":{"0":1209,"1":188},"size":{"0":210,"1":46},"flags":{},"order":5,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":7},{"name":"vae","type":"VAE","link":8}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[9],"slot_index":0}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":9,"type":"SaveImage","pos":{"0":1451,"1":189},"size":{"0":210,"1":58},"flags":{},"order":6,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":9}],"outputs":[],"properties":{},"widgets_values":["ComfyUI"]},{"id":6,"type":"CLIPTextEncode","pos":{"0":415,"1":186},"size":{"0":422.84503173828125,"1":164.31304931640625},"flags":{},"order":2,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":3}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[4],"slot_index":0}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["3lyse4ly, picture, selfie, Elyse Aly"]},{"id":4,"type":"CheckpointLoaderSimple","pos":{"0":26,"1":474},"size":{"0":315,"1":98},"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[1],"slot_index":0},{"name":"CLIP","type":"CLIP","links":[3,5],"slot_index":1},{"name":"VAE","type":"VAE","links":[8],"slot_index":2}],"properties":{"Node name for S&R":"CheckpointLoaderSimple"},"widgets_values":["1b9819f1-1035-49cc-bbbc-6293e99b0e8a.TA_trained.safetensors"]}],"links":[[1,4,0,3,0,"MODEL"],[2,5,0,3,3,"LATENT"],[3,4,1,6,0,"CLIP"],[4,6,0,3,1,"CONDITIONING"],[5,4,1,7,0,"CLIP"],[6,7,0,3,2,"CONDITIONING"],[7,3,0,8,0,"LATENT"],[8,4,2,8,1,"VAE"],[9,8,0,9,0,"IMAGE"]],"groups":[],"config":{},"extra":{"ds":{"scale":1,"offset":[350,145]}},"version":0.4}

Additional Context

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



### Other

![Screenshot 2024-10-13 at 15-38-26 ComfyUI](https://github.com/user-attachments/assets/cacd2e14-0d29-4603-918d-43b6567e8042)
comfyanonymous commented 1 month ago

If it's a lora you need to put it in the models/lora directory and then use the Load Lora node to load it.

ABSOMA021085 commented 1 month ago

If it's a lora you need to put it in the models/lora directory and then use the Load Lora node to load it, mark this if I put it in the lora folder, normally I put the models in checkpoints and there they have worked for me, but the ones I download I have tried in lora and stable diffusion and I have not been able to solve the problem. Screenshot 2024-10-13 at 18-52-10 ComfyUI

ltdrdata commented 1 month ago

If it's a lora you need to put it in the models/lora directory and then use the Load Lora node to load it, mark this if I put it in the lora folder, normally I put the models in checkpoints and there they have worked for me, but the ones I download I have tried in lora and stable diffusion and I have not been able to solve the problem. Screenshot 2024-10-13 at 18-52-10 ComfyUI

  1. This issue occurs when you try to run by selecting a file that doesn't exist.
  2. If the file already exists, refresh your browser and reselect the file.

And you should not load a lora model using the Checkpoint Loader.

ABSOMA021085 commented 1 month ago

If it's a lora you need to put it in the models/lora directory and then use the Load Lora node to load it.

If it's a lora you need to put it in the models/lora directory and then use the Load Lora node to load it, mark this if I put it in the lora folder, normally I put the models in checkpoints and there they have worked for me, but the ones I download I have tried in lora and stable diffusion and I have not been able to solve the problem. Screenshot 2024-10-13 at 18-52-10 ComfyUI

1. This issue occurs when you try to run by selecting a file that doesn't exist.

2. If the file already exists, refresh your browser and reselect the file.

And you should not load a lora model using the Checkpoint Loader.

Thanks bro I was able to solve it with this, thank you so much.