Skip to main content

Customized diffusers with model search and other functions.

Project description

auto_diffusers

GitHub release

GitHub release GitHub release Visitor Badge

CONTENTS

Announcements📢

Due to changes in the hf_api specification, the function was stopped for a while.
I apologize for any inconvenience this may have caused.

[Updated on October 29, 2024]
Fixed an error that security status could not be acquired due to hf_api specification changes

About The Project

Enhance the functionality of diffusers.

  • Search models from huggingface and Civitai.

How to use

pip install diffusers
pip install auto_diffusers

from diffusers import StableDiffusionPipeline
from auto_diffusers import model_search


path = model_search(
           <keyword>,
           auto = True,
           model_format="diffusers",
           download = False
           )
pipe = StableDiffusionPipeline.from_pretrained(path)

# or

path = model_search(
           <keyword>,
           auto = True,
           model_format="single_file",
           download = False
           )
pipe = StableDIffusionPipeline.from_single_file(path)

Example

pip install --quiet diffusers
pip install --quiet auto_diffusers

from diffusers import StableDiffusionPipeline
from IPython.display import display
from auto_diffusers import model_search

model_path = model_search(
                 "Any",
                 auto=True,
                 model_format="diffusers",
                 download=False
                 )
pipe = StableDiffusionPipeline.from_pretrained(model_path).to("cuda")

image = pipe("Mt. Fuji").images[0]

print(f"model_path: {model_path}")
display(image)

Description

Arguments of model_search

Name Type Default Input Available Description
search_word string Details Keywords to search models
auto bool True Minimize user input by selecting the highest-rated models.
download bool False Returns the path where the file was downloaded.
model_format string "single_file" all,
diffusers,
single_file
Specifies the format of the model. Details
model_type string "Checkpoint" Checkpoint,
TextualInversion,
Hypernetwork,
AestheticGradient,
LORA,
Controlnet,
Poses
Valid only in Civitai.
include_params bool False Returns the model path or a dictionary with parameters.
branch string "main" Specify the branches of huggingface and civitai.
local_file_only bool False Search local folders only.
In the case of auto, files with names similar to search_word will be given priority.
hf_token string None Token used for authentication with Hugging Face.
civitai_token string None Token used for authentication with Civitai.

search_word
Type Description
keyword Keywords to search model
url Can be any URL other than huggingface or Civitai.
Local directory or file path Search for files with the extensions: .safetensors, .ckpt, .bin
huggingface path The following format: < creator > / < repo >

model_format
Argument Description
all In auto, multifolder diffusers format checkpoint takes precedence
single_file Only single file checkpoint are searched.
diffusers Search only for multifolder diffusers format checkpoint
Note that only the huggingface is searched for, since it is not in civitai.

License

In accordance with BSD-3-Clause license

Acknowledgement

I have used open source resources and free tools in the creation of this project.

I would like to take this opportunity to thank the open source community and those who provided free tools.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auto_diffusers-1.9.0.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

auto_diffusers-1.9.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file auto_diffusers-1.9.0.tar.gz.

File metadata

  • Download URL: auto_diffusers-1.9.0.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for auto_diffusers-1.9.0.tar.gz
Algorithm Hash digest
SHA256 400bd70d099671c434cc86154123f1b9dc7bbaada071a813a6bd754a677b29f8
MD5 345dc8658d09c51dda116857aa60c6e7
BLAKE2b-256 ca7a5bdacd9550c6d868c750967598024d293e723fcc11857a47ab72de316776

See more details on using hashes here.

File details

Details for the file auto_diffusers-1.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for auto_diffusers-1.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 858d1261faa2c09d11e6af78b929d8b397544e449b13c5f658c3325d6271213f
MD5 ad8bd21561e38a332d7b59eabb2a8037
BLAKE2b-256 2cd106b2d122393826b561edcb377dc7c5f15a2d382f0158a8a3cb8fa80d9211

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page