civitai / civitai_comfy_nodes

Comfy Nodes that make utilizing resources from Civitas easy as copying and pasting
103 stars 18 forks source link

Exception Checking SHA256 on Existing File in Subfolder #7

Open zer0TF opened 1 year ago

zer0TF commented 1 year ago

When checking an existing file, if I specify the AIR as well as my local path to that file (using the Comfy dropdown picker), if the local path is in a subfolder, the node bombs out.

My "Additional Paths" XML looks like this:

a111:
    base_path: C:\Example\Path\To\stable-diffusion-webui
    checkpoints: models\Stable-diffusion\

My Comfy node looks like this:

ckpt_air: 122606@148259 ckpt_name: XL\DynaVisionXL-0.4.1.1.safetensors download_chunks: 4 download_path: Stable-diffusion\

And the exception is:

got prompt
!!! Exception during processing !!!
Traceback (most recent call last):
  File "\ComfyUI\execution.py", line 152, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "\ComfyUI\execution.py", line 82, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "\ComfyUI\execution.py", line 75, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "\ComfyUI\custom_nodes\comfy-nodes\civitai_checkpoint_loader.py", line 100, in load_checkpoint
    model_id, version_id, details = CivitAI_Model.sha256_lookup(ckpt_path)
  File "\ComfyUI\custom_nodes\comfy-nodes\CivitAI_Model.py", line 497, in sha256_lookup
    if CivitAI_Model.warning:
AttributeError: type object 'CivitAI_Model' has no attribute 'warning'

I have all of my existing checkpoints organized into subfolders, it would be really nice if I didn't have to re-download them. 😄

WASasquatch commented 1 year ago

Looks like (hopefully) the error is unrelated to the actual file location and seems related to a unset object attribute. Thanks for pointing it out. I will take a look ASAP.

WASasquatch commented 1 year ago

I think that should be fixed, and I apologize for the delay. I've added the warning default to the class attributes.