pycivitai.dispatch

civitai_download

pycivitai.dispatch.civitai_download(model: Union[str, int], version: Optional[Union[int, str]] = None, file: Optional[str] = None, creator: Optional[str] = None, offline: bool = False)[source]

Download and get the local file path of the specified model file.

Parameters:
  • model (Union[str, int]) – The name or ID of the model to download and manage.

  • version (Union[str, int, None]) – The version ID or name of the model version. If None, the latest version is used.

  • file (str) – The pattern or name of the file to get. If None, the primary file will be returned.

  • creator (Optional[str]) – Name of creator. None means anyone.

  • offline (bool) – If True, the manager operates in offline mode, using locally downloaded resources.

Returns:

The local path of the specified model file.

Return type:

str

civitai_find_online

pycivitai.dispatch.civitai_find_online(model: Union[str, int], version: Optional[Union[int, str]] = None, file: Optional[str] = None, creator: Optional[str] = None) Resource[source]

Find the online model resource (file) information from civitai.com.

Parameters:
  • model (Union[str, int]) – The name or ID of the model.

  • version (Union[str, int, None]) – The version ID or name of the model version. If None, the latest version is used.

  • file (str) – The pattern or name of the file to find. If None, the primary file will be returned.

  • creator (Optional[str]) – Name of creator. None means anyone.

Returns:

The Resource object containing the information about the specified model file.

Return type:

Resource

civitai_search_online

pycivitai.dispatch.civitai_search_online(model_name: str, creator: Optional[str] = None) List[Model][source]
Overview:

Search from civitai site.

Parameters:
  • model_name (str) – The name of the model to retrieve information for.

  • creator (Optional[str]) – Name of creator. None means anyone.