code: def load_file_from_url(
      url: str,
      *,
      model_dir: str,
      progress: bool = True,
      file_name: str | None = None,
  ) -> str:
      """Download a file from `url` into `model_dir`, using the file present if possible.
  
      Returns the path to the downloaded file.
      """
      os.makedirs(model_dir, exist_ok=True)
      if not file_name:
          parts = urlparse(url)
          file_name = os.path.basename(parts.path)
      cached_file = os.path.abspath(os.path.join(model_dir, file_name))
      if not os.path.exists(cached_file):
          print(f'Downloading: "{url}" to {cached_file}\n')
          from torch.hub import download_url_to_file
  
          download_url_to_file(url, cached_file, progress=progress)
      return cached_file
  
file_path: stable-diffusion-webui/modules/modelloader.py
imports: from __future__ import annotations
  import os
  import shutil
  import importlib
  from urllib.parse import urlparse
  from modules import shared
  from modules.upscaler import Upscaler, UpscalerLanczos, UpscalerNearest, UpscalerNone
  from modules.paths import script_path, models_path
label_desc: Use image node_id 1 for calling a global function with example usage: load_file_from_url(url) and returns: cached_file