[Pipeline] Enhancements to AutoPipeline#10006
[Pipeline] Enhancements to AutoPipeline#10006suzukimain wants to merge 7 commits intohuggingface:mainfrom
AutoPipeline#10006Conversation
|
cc @vladmandic check this out 😹 oh god @suzukimain you genius. thank you. |
i have something similar, but this is pretty clean! needs a bit of cleanup to actually use params - e.g., instead of
use actual |
|
hi @suzukimain If you make this tool as separate repo, we are happy to add it to our doc and help promote it! |
Originally, this PR was incorporated into |
|
assuming huggingface doesnt want to support a competitor even if it benefits the user or this project. bummer |
Sorry, what do you mean by “competitor”? |
|
CivitAI as a model hosting provider |
|
Oh, I see |
|
@suzukimain feel free to dress it up and write a nice introduction about it! |
|
@suzukimain this is cool and I agree that it would work a lot better as an external tool with your library. Do you have plans for something similar with loras? |
The functions DetailsBy the way, the from huggingface_hub import hf_api
info = hf_api.model_info(
"stable-diffusion-v1-5/stable-diffusion-v1-5",
expand=["baseModels"]
)
print(info.baseModels)
# AttributeError: 'ModelInfo' object has no attribute 'baseModels'diffusers/src/diffusers/pipelines/auto_pipeline.py Lines 783 to 791 in dbe8fcb from diffusers.pipelines.auto_pipeline import (
search_huggingface,
search_civitai,
)
# Search Lora
Lora = search_civitai(
"Keyword_to_search_Lora",
model_type="LORA",
base_model = "SD 1.5",
download=True,
)
# Load Lora into the pipeline.
pipeline.load_lora_weights(Lora)
# Search TextualInversion
TextualInversion = search_civitai(
"EasyNegative",
model_type="TextualInversion",
base_model = "SD 1.5",
download=True
)
# Load TextualInversion into the pipeline.
pipeline.load_textual_inversion(TextualInversion, token="EasyNegative") |
|
cc @stevhliu, where should this go if we want to add a doc page about it (as an external library)? |
|
Made it available for use as an external tool.
Made it as usable as possible in the same way as a pull request. pip install --quiet auto_diffusers
from auto_diffusers import EasyPipelineForText2Image
# Search for Huggingface
pipe = EasyPipelineForText2Image.from_huggingface("any").to("cuda")
img = pipe("cat").images[0]
img.save("cat.png")
# Search for Civitai
pipe = EasyPipelineForText2Image.from_civitai("any").to("cuda")
image = pipe("cat").images[0]
image.save("cat.png") |
Based on this advice, I have made some revisions here. Is it okay to apply these changes? |
I intend to apply the changes in this way. |
|
Yeah thats fine with me, feel free to apply the changes in #9986 :) |
|
hi @stevhliu , What should I do with this PR? |
|
I think this can be closed since we your project is here https://github.com/huggingface/diffusers/tree/main/examples/model_search now :) |
|
Add this functionality to auto_diffusers and close this as #9986 and #10358 have been merged. thank you! |
What does this PR do?
This PR adds the ability to automatically search for models from
civitaiandhuggingfacein AutoPipeline and enables the loading of single file checkpoints.From #9986
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@yiyixuxu @asomoza @bghira