Spaces:
Running
on
Zero
Running
on
Zero
Remove LoRA support
#63
by
adamelliotfields
- opened
Civit httpx LoRA downloader for future reference:
def download_civit_file(lora_id, version_id, file_path=".", token=None):
file = f"{file_path}/{lora_id}.{version_id}.safetensors"
base_url = "https://civitai.com/api/download/models"
if os.path.exists(file):
return
try:
params = {"token": token}
response = httpx.get(
f"{base_url}/{version_id}",
follow_redirects=True,
params=params,
timeout=None,
)
response.raise_for_status()
os.makedirs(file_path, exist_ok=True)
with open(file, "wb") as f:
f.write(response.content)
except httpx.HTTPStatusError as e:
print(f"{e.response.status_code} {e.response.text}")
except httpx.RequestError as e:
print(f"RequestError: {e}")
adamelliotfields
changed discussion title from
Rename LoRA widgets
to Remove LoRA support