Skip to content

Model Downloader attaches the wrong metadata to huggingface models if you previously downloaded from CivitAI #743

Open
@coredumperror

Description

@coredumperror

Expected Behavior

The Model Downloader should unset any unrelated data from its form fields when a new URL that doesn't match that data gets pasted into the URL field.

Actual Behavior

The downloader leaves all the existing data it loaded from a previous CivitAI model/lora when you paste a non-Civit URL, and then uses all that metadata for the new download, even though it's the wrong data.

Steps to Reproduce

First, paste this URL into the Model Downloader's URL field:
https://civitai.com/models/253223/playboy-bunny-suit

The Status will change to "URL appears to be a CivitAI link, and has been loaded from Civitai API", and a bunch of metadata about the model will be loaded into the form fields.

Then, paste this URL into the field:
https://huggingface.co/OnomaAIResearch/Illustrious-XL-v2.0/blob/main/Illustrious-XL-v2.0.safetensors

The "Status" descriptor will change to "URL appears to be a huggingface link, and has been autocorrected to a download link", but the rest of the form doesn't change.

Which means that when you press Download, it'll add all the metadata from the previous LORA to the thing you're downloading, including the title, image, etc, and put the object in the LORA folder, even if it's a Model.

Debug Logs

https://paste.denizenscript.com/View/133044

Other

Given that the system can tell that it's no longer got a CivitAI URL attached after pasting the huggingface URL, it should reset every field in the form that can't be filled by the contents from huggingface (or wherever).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingFrontendThis pertains to the frontend UI (HTML/CSS/JS)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions