Closed duskfallcrew closed 3 months ago
It told me via gpt, because i don't program lol - i look crap up! That the following MIGHT FIX THIS: from fake_useragent import UserAgent or: pip install fake_useragent
Noting that i'm on a linux based OS running it, but it's not asssuming my browser as i'm not on local -
Also noting: Kayfa from civit (we're both in the creator program) - said it was working fine for them on desktop... WHICH IS WEIRD. (And they said it was recently optimized for runpod, which is similar to vast in that both are jupyter/linux environments)
ALRIGHT! So this is how i managed to fix it on my end and if this breaks your code don't worry about patching it, i'm able to figure this out once it's installed
I had to do this: def get_headers(referer=None, no_api=None): api_key = getattr(opts, "custom_api_key", "") try: user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36" except ImportError: user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" headers = { "Connection": "keep-alive", "User-Agent": user_agent, "Content-Type": "application/json" } if referer: headers['Referer'] = f"https://civitai.com/models/{referer}" if api_key and not no_api: headers['Authorization'] = f'Bearer {api_key}'
return headers
As well as the pip install thing.
Also extra error i'm coming across that's easy fix for me that's no huge biggie: When the API key is entered somehow the text box goes "API KEY" and then the api key. I just deleted the text and it worked.
Btw: You rule, this plugin is amazing.
If it helps in context I patched the python file on the server i'm renting, and for easier use i'll just replace this each time for me XD I'm weird :3 sorry if this b reaks code p_p no like seriously this extension is saving my bacon
it turns out after a new GPU: I just need the PIP install thing. That's it, it's just a tad fussy - :) one more PIP install when i set up isn't gonna hurt <3 It's not a bug, it's just a feature LMAO.
Glad to hear you managed to fix it! And enjoy the new GPU :)
Describe the bug.
Went to go search for a PonyXL model to add, and it gave me the error UserAgent not defined.
Steps to reproduce the problem.
Expected behavior
Expected to get an erroneously LARGE AMOUNT of pony loras and models because I searched for "PONY" but meant to type ponyXL model LOL. INstead i got useragent error :P
System info
Console logs
Additional information
No response