Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwarmUI's metadata updates directly modify the metadata record in the safetensors file, changing hash. Consider supporting AutoV3 hashes, which ignore the metadata record(s). #115

Open
brendanhoar opened this issue Jun 29, 2024 · 3 comments

Comments

@brendanhoar
Copy link

Have you read document?

Yes.

Describe Issue

SwarmUI (ex-StableSwarm) allows the user to update the metadata of model, but it stores the updates directly in the safetensors files. This breaks SHA256 and AutoV2 hashes, and for users who share models between applications, this may cause those users to lose the ability to pull new or updated metadata using your extension.

AutoV3 hashes, however, ignore the metadata and hash only the tensor information.

Civitai API's model hash endpoint has support for AutoV3 lookups, even though the official API docs don't include that yet.

Please consider adding support for the newer AutoV3 hash standard.

Thanks
B

@brendanhoar brendanhoar changed the title SwarmUI's metadata updates directly update the metadata record in the safetensors file. Consider supporting AutoV3 hashes, which ignore the metadata record(s). SwarmUI's metadata updates directly modify the metadata record in the safetensors file, changing hash. Consider supporting AutoV3 hashes, which ignore the metadata record(s). Jun 29, 2024
@zixaphir
Copy link
Owner

zixaphir commented Jul 1, 2024

I'll look into it. I believe the hashing function I use can already skip hashing headers, I just need to pass a flag to the function and format for autov3.

@zixaphir
Copy link
Owner

zixaphir commented Jul 1, 2024

On a side note, can we all just appreciate that Civitai's API documentation is eternally out of date and/or missing documentation entirely? I'm guessing autov3 support isn't actually that new.

@brendanhoar
Copy link
Author

brendanhoar commented Jul 1, 2024

Looks like they added AutoV3 to their internal scanner 8mo ago. I'm assuming API followed not too long after.

https://github.com/civitai/model-scanner

(Mostly adding so you have an additional reference for the algorithm.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants