Giter Club home page Giter Club logo

Comments (4)

zixaphir avatar zixaphir commented on July 23, 2024 1

It will use the hash to query Civitai's API and use whatever civitai gives it. Currently the update will fail if the id does not match the current id in stored [model_name].civitai.info.

if "civitai" in path:
new_id = new_data.get("id", "")
old_id = old_data.get("id", "")
if new_id != old_id:
if old_id != "":
raise VersionMismatchException(f"New metadata id ({new_id}) does not match old metadata id ({old_id})")

from stable-diffusion-webui-civitai-helper.

JingJang avatar JingJang commented on July 23, 2024

Another bug found. It uses the version id I think or maybe modelid to get the JSON data. Not good as sometimes models are removed and then re-uploaded. So the model id changes but the SHA256 hasn't. So maybe check using first the version id and then the AutoV2 if version id json fails. The reason for both, is because for some unknown reason people can upload the exact same files, so you may have multiple models may have files with the same AutoV2 value. Not sure how the API treats this.

from stable-diffusion-webui-civitai-helper.

zixaphir avatar zixaphir commented on July 23, 2024

I lost a lot of data with this. I should've backed up. A mistake on my behalf.

I apologize for this. A scenario where a model has been deleted completely slipped my mind.

Finally not an issue. I thought you might end up merging the data into the json file and thus not needing the info file.

As you can already see with this issue, changing the underlying files can have unforeseen circumstances that I am at high-risk for not considering, so this is not something I'm looking to undertake at the moment. Just off the top of my head, I'd have to consider scenarios where the user already has working JSON, but the model itself was removed from Civitai, so if I forgot to consider that scenario, the user could end up with data that worked previously, but no longer does after a re-scan, just like it did here.

It uses the version id I think or maybe modelid to get the JSON data. Not good as sometimes models are removed and then re-uploaded.

We calculate the hash and then send the hash to Civitai's API, which gives us a model id / version id. There really isn't a way to compare a file against multiple entries in the API. I've written in a check so that if we already have a model id from a previous scan, new data with a mismatched model id will not overwrite old data (tho mismatched version ids are not considered.)

from stable-diffusion-webui-civitai-helper.

JingJang avatar JingJang commented on July 23, 2024

No problem. This is all for free, so I am very grateful.

`We calculate the hash and then send the hash to Civitai's API, which gives us a model id / version id. There really isn't a way to compare a file against multiple entries in the API. I've written in a check so that if we already have a model id from a previous scan, new data with a mismatched model id will not overwrite old data (tho mismatched version ids are not considered.)

Ignore the second post, it's a mess and wrong.

I was wondering how do you update? What happens when you downloaded the info file, but the model gets removed and then re-uploaded. Do you check using the saved id or save hash? That's it. Not sure how one would handle that. Because the old info file might be more useful than the re-upload.

from stable-diffusion-webui-civitai-helper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.