BlafKing / sd-civitai-browser-plus

Extension to access CivitAI via WebUI: download, delete, scan for updates, list installed models, assign tags, and boost downloads with multi-threading.
GNU Affero General Public License v3.0
309 stars 53 forks source link

[Bug]: requests.exceptions.MissingSchema: Invalid URL '': No scheme supplied. Perhaps you meant https://? #127

Closed EdithForsaken closed 10 months ago

EdithForsaken commented 10 months ago

Describe the bug.

image

Steps to reproduce the problem.

  1. just click download

Expected behavior

I cannot download any files, even though I have prepared everything that is needed.

System info

Console logs

/home/studio-lab-user/content/sdw
Python 3.9.16 | packaged by conda-forge | (main, Feb  1 2023, 21:39:03) 
[GCC 11.3.0]
Version: v1.6.1
Commit hash: 4afaaf8a020c1df457bcf7250cb1c7f609699fa7
Launching Web UI with arguments: --listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --skip-torch-cuda-test --precision full --no-half --use-cpu SD GFPGAN BSRGAN ESRGAN SCUNet CodeFormer --all --ngrok 2Pru5tTivWjXNLotYH6jsGqJZRN_4MpnwGEaAEVKTgHJMt77t
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Found no NVIDIA driver on your system. Please check that you have an NVIDIA GPU and installed a driver from http://www.nvidia.com/Download/index.aspx', memory monitor disabled
ngrok authtoken detected, trying to connect...
ngrok connected to localhost:7860! URL: https://9392-3-136-172-40.ngrok-free.app
You can use this link after the launch is complete.
Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[AddNet] Updating model hashes...
0it [00:00, ?it/s]
[-] ADetailer initialized. version: 23.11.1, num models: 9
CivitAI Browser+: Aria2 RPC started
Model Downloader v1.0.8
Checking Directories...
all Directories already Created.
2023-12-08 13:14:47,268 - ControlNet - INFO - ControlNet v1.1.422
ControlNet preprocessor location: /home/studio-lab-user/content/sdw/extensions/sd-webui-controlnet/annotator/downloads
2023-12-08 13:14:47,523 - ControlNet - INFO - ControlNet v1.1.422
Checkpoint Cavry_V2.safetensors not found; loading fallback majicmixRealistic_v7.safetensors [7c819b6d13]
Loading weights [7c819b6d13] from /home/studio-lab-user/content/sdw/models/Stable-diffusion/majicmixRealistic_v7.safetensors
/home/studio-lab-user/content/sdw/extensions/additional-networks-s/scripts/metadata_editor.py:343: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  with gr.Row().style(equal_height=False):
/home/studio-lab-user/content/sdw/extensions/additional-networks-s/scripts/metadata_editor.py:423: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  cover_image = gr.Image(label="Cover image", elem_id="additional_networks_cover_image", source="upload", interactive=can_edit, type="pil", image_mode="RGBA").style(height=480)
/home/studio-lab-user/content/sdw/extensions/images-browser/scripts/images_history.py:581: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  history_gallery = gr.Gallery(show_label=False, elem_id=tabname + "_images_history_gallery").style(grid=opts.images_history_page_columns)
/home/studio-lab-user/content/sdw/extensions/images-browser/scripts/images_history.py:581: GradioDeprecationWarning: The 'grid' parameter will be deprecated. Please use 'columns' in the constructor instead.
  history_gallery = gr.Gallery(show_label=False, elem_id=tabname + "_images_history_gallery").style(grid=opts.images_history_page_columns)
Creating model from config: /home/studio-lab-user/content/sdw/configs/v1-inference.yaml
/home/studio-lab-user/content/sdw/extensions/sd-model-downloader/scripts/model-downloader.py:309: GradioDeprecationWarning: The `style` method is deprecated. Please set these arguments in the constructor instead.
  image.style(width=156, height=234)
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
[HF Out] No HF Token provided. HF Out will be disabled.
Startup time: 14.1s (prepare environment: 0.9s, import torch: 3.1s, import gradio: 1.5s, setup paths: 0.7s, initialize shared: 0.1s, other imports: 1.0s, setup codeformer: 0.1s, load scripts: 3.6s, create ui: 2.4s, gradio launch: 0.6s).
Couldn't find VAE named vae-ft-mse-840000-ema-pruned.safetensors; using None instead
Applying attention optimization: InvokeAI... done.
Model loaded in 5.3s (load weights from disk: 1.8s, create model: 1.1s, apply weights to model: 1.2s, apply float(): 1.1s, calculate empty prompt: 0.2s).
Exception in thread Thread-14:
Traceback (most recent call last):
  File "/home/studio-lab-user/.conda/envs/default/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/home/studio-lab-user/.conda/envs/default/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/home/studio-lab-user/content/sdw/extensions/sd-civitai-browser-plus/scripts/civitai_download.py", line 320, in download_file
    download_link = get_download_link(url)
  File "/home/studio-lab-user/content/sdw/extensions/sd-civitai-browser-plus/scripts/civitai_download.py", line 306, in get_download_link
    response = requests.get(url, headers=headers, allow_redirects=False)
  File "/home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/requests/sessions.py", line 575, in request
    prep = self.prepare_request(req)
  File "/home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/requests/sessions.py", line 486, in prepare_request
    p.prepare(
  File "/home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/requests/models.py", line 368, in prepare
    self.prepare_url(url, params)
  File "/home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/requests/models.py", line 439, in prepare_url
    raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL '': No scheme supplied. Perhaps you meant https://?

Additional information

No response

BlafKing commented 10 months ago

Thanks for reporting!

I've personally never used Sagemaker jupiternotebook but I'll have a look to see if I can find out why this issue is occuring!

Worldgate commented 10 months ago

Traceback (most recent call last): File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1431, in process_api result = await self.call_function( File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1103, in call_function prediction = await anyio.to_thread.run_sync( File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, args) File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper response = f(args, kwargs) File "/home/mavrick/stable-diffusion-webui/extensions/sd-civitai-browser-plus/scripts/civitai_file_manage.py", line 788, in file_scan response = requests.get(api_url, timeout=(10,30)) File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, kwargs) File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, **kwargs) File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/sessions.py", line 575, in request prep = self.prepare_request(req) File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/sessions.py", line 486, in prepare_request p.prepare( File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/models.py", line 368, in prepare self.prepare_url(url, params) File "/home/mavrick/stable-diffusion-webui/venv/lib/python3.10/site-packages/requests/models.py", line 439, in prepare_url raise MissingSchema( requests.exceptions.MissingSchema: Invalid URL 'None': No scheme supplied. Perhaps you meant https://None?

Worldgate commented 10 months ago

I was scanning models to find them on civitai so i can scrape their info for images and such.

Worldgate commented 10 months ago

Update: Removing the extension and reinstalling it fixed my issue.

EdithForsaken commented 10 months ago

Thank you so much for fixing that BUG, I really appreciate it.

BlafKing commented 10 months ago

Looks like it's fixed by re-installing so I'll close this thread, I suspect the issue was actually caused by civitai having issues providing the download link, regardless, I'll close this issue and insert some better logic for when a download link has failed to be retrieved.