Comfy-Org / Comfy-Org/ComfyUI

[Feature Request] Use hashes instead simple names of models when you import images from A1111

Open
#2,784 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

I have my models splitted by folders, so I have character loras, style loras, realistic checkpoints, anime checkpoints
When I drop an image from A1111 to comfy, I expect it will set names of needed models with folders.

I guess, the issue is with importA1111 function
You can look at it here: https://github.com/comfyanonymous/ComfyUI/blob/38b7ac6e269e6ecc5bdd6fefdfb2fb1185b09c9d/web/scripts/pnginfo.js#L166

As you can see, when it comes to getting loras names, it simply extract it from `` string:
![image](https://github.com/comfyanonymous/ComfyUI/assets/51882489/8db6ca06-4228-4cd9-b4e5-1b9513273aff)

So I suggest:
1. extract names directly from metadata, because it comes with hash.
2. get this hash
3. use this hash to get location of a model
4. set text to location of file with all folders and subfolders. Like: "anime/characters/whatever.safetensors"

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.