pythongosssss / ComfyUI-Custom-Scripts

Enhancements & experiments for ComfyUI, mostly focusing on UI features
MIT License
1.37k stars 104 forks source link

Improve image loader validation to only consider model file #264

Open Lawrr opened 1 month ago

Lawrr commented 1 month ago

Fixes #259.

The value of lora_name and ckpt_name is a dict containing the location of both the model and preview image, e.g: {"content": "path/to/model", "image": "path/to/image"} so the default validation is checking that not only the model exists, but the image exists as well. A change in the path of the image (e.g. going from jpg->png or having it deleted) should not affect the validation, but currently does.

Tested this fix by:

  1. Selecting a model in the loader
  2. Renaming the image file
  3. Confirming running the prompt no longer raises a validation error