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

[Bug]: download model on colab #974

Open
wolfkingal2000 opened this issue Jan 25, 2024 · 9 comments
Open

[Bug]: download model on colab #974

wolfkingal2000 opened this issue Jan 25, 2024 · 9 comments
Labels
bug-report Something might not be working

Comments

@wolfkingal2000
Copy link

What happened?

Hello, how can I download the models with api on colab ؟

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

Hello, how can I download the models with api on colab ؟

What platforms do you use to access the site?

Linux

What browsers do you use to access the site?

Mozilla Firefox

Additional information, context and logs

No response

@wolfkingal2000 wolfkingal2000 added the bug-report Something might not be working label Jan 25, 2024
@eddyizm
Copy link

eddyizm commented Jan 26, 2024

What have you tried?
This was working previously and now you need to add your civitia api key on some models/loras.

@wolfkingal2000
Copy link
Author

What have you tried?
This was working previously and now you need to add your civitia api key on some models/loras.

I know this, but I use colab, so I have to download the models every time I want to use it, so I want to know how to add the api to colab so that there is no problem when downloading, and I will add

@shinshin86
Copy link

@wolfkingal2000 Hi!
You can download the file by giving the URL parameter as follows

https://civitai.com/api/download/models/xxxxx?token={civitai_api_key}

To get a Civitai API Key, you need to create a Civitai account.

@wolfkingal2000
Copy link
Author

@wolfkingal2000 Hi!
You can download the file by giving the URL parameter as follows

https://civitai.com/api/download/models/xxxxx?token={civitai_api_key}

To get a Civitai API Key, you need to create a Civitai account.

Reall? Thanks for answering

@eddyizm
Copy link

eddyizm commented Jan 28, 2024

I think we will need a fix to add the api key to a config or cli argument so that if any calls to the civitai.com api are used, it gets passed to all of them as it only seems to affect the ones where the model owners have enabled that feature, eg they required the user be logged in to download the model.

@wolfkingal2000
Copy link
Author

I think we will need a fix to add the api key to a config or cli argument so that if any calls to the civitai.com api are used, it gets passed to all of them as it only seems to affect the ones where the model owners have enabled that feature, eg they required the user be logged in to download the model.

Thank you, it would be great if you made this command or make cell command send this issue to use that

@eddyizm
Copy link

eddyizm commented Jan 28, 2024

I think we will need a fix to add the api key to a config or cli argument so that if any calls to the civitai.com api are used, it gets passed to all of them as it only seems to affect the ones where the model owners have enabled that feature, eg they required the user be logged in to download the model.

Thank you, it would be great if you made this command or make cell command send this issue to use that

My fork/branch has it in notebook as a variable but it is a little manual currently depending on what type of stuff I am creating.

@jchook
Copy link

jchook commented Jan 31, 2024

It would be nice if we could use the Authorization: Bearer {token} header instead of a GET param.

For example, when using bash + wget, it's very easy to add this header, but less trivial to tack-on a GET param to an arbitrary URL that may or may not already have existing GET params, e.g.

if [[ "$URL" == *\?* ]]; then
  # If it does, append the token query parameter
  URL="$URL&token=$CIVITAI_API_KEY"
else
  # Otherwise, add the token query parameter
  URL="$URL?token=$CIVITAI_API_KEY"
fi

@holerik13
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Something might not be working
Projects
None yet
Development

No branches or pull requests

5 participants