auto-diffusers 1.3.3__py3-none-any.whl → 1.4.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- auto_diffusers/__init__.py +2 -2
- auto_diffusers/auto_pipe/__init__.py +1 -0
- auto_diffusers/auto_pipe/auto_pipe_cls.py +91 -0
- auto_diffusers/checker/checkpoint_type.py +1856 -0
- auto_diffusers/checker/get_checkpoint_type.py +4 -3
- auto_diffusers/model_path/__init__.py +1 -1
- auto_diffusers/model_path/create_pipeline.py +6 -3
- auto_diffusers/model_path/flax_config.py +1 -1
- auto_diffusers/model_path/mix_class.py +1 -1
- auto_diffusers/model_path/perform_path_search.py +337 -0
- auto_diffusers/model_path/search_civitai.py +17 -9
- auto_diffusers/model_path/search_hugface.py +164 -114
- auto_diffusers/setup/__init__.py +1 -1
- auto_diffusers/setup/{Base_config.py → base_config.py} +16 -1
- auto_diffusers/setup/device_config.py +17 -3
- auto_diffusers/utils/run_download.py +0 -2
- {auto_diffusers-1.3.3.dist-info → auto_diffusers-1.4.3.dist-info}/METADATA +38 -6
- auto_diffusers-1.4.3.dist-info/RECORD +31 -0
- auto_diffusers/model_path/Perform_path_search.py +0 -228
- auto_diffusers-1.3.3.dist-info/RECORD +0 -28
- {auto_diffusers-1.3.3.dist-info → auto_diffusers-1.4.3.dist-info}/LICENSE +0 -0
- {auto_diffusers-1.3.3.dist-info → auto_diffusers-1.4.3.dist-info}/WHEEL +0 -0
- {auto_diffusers-1.3.3.dist-info → auto_diffusers-1.4.3.dist-info}/top_level.txt +0 -0
auto_diffusers/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from .setup.
|
|
1
|
+
from .setup.base_config import Basic_config
|
|
2
2
|
from .utils.run_download import download
|
|
3
3
|
from .checker.get_checkpoint_type import checkpoint_type
|
|
4
|
-
from .model_path.
|
|
4
|
+
from .model_path.perform_path_search import Search_cls
|
|
5
5
|
|
|
6
6
|
run_search = Search_cls()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from model_path.mix_class import Basic_config
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#main
|
|
2
|
+
|
|
3
|
+
from typing import Any, Callable, Dict, List, Optional, Union
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
import diffusers
|
|
7
|
+
from diffusers import (
|
|
8
|
+
StableDiffusionPipeline,
|
|
9
|
+
AutoPipelineForText2Image,
|
|
10
|
+
AutoPipelineForImage2Image,
|
|
11
|
+
AutoPipelineForInpainting,
|
|
12
|
+
TextToVideoZeroPipeline,
|
|
13
|
+
FlaxStableDiffusionPipeline,
|
|
14
|
+
FlaxStableDiffusionImg2ImgPipeline,
|
|
15
|
+
FlaxStableDiffusionInpaintPipeline,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
from model_path.perform_path_search import Search_cls
|
|
19
|
+
from model_path.mix_class import Basic_config
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@dataclass
|
|
23
|
+
class AutoPipe_data:
|
|
24
|
+
pipe_dict = {
|
|
25
|
+
"torch":{
|
|
26
|
+
"base" : StableDiffusionPipeline,
|
|
27
|
+
"txt2img" : AutoPipelineForText2Image,
|
|
28
|
+
"img2img" : AutoPipelineForImage2Image,
|
|
29
|
+
"inpaint" : AutoPipelineForInpainting,
|
|
30
|
+
"txt2video" : TextToVideoZeroPipeline,
|
|
31
|
+
},
|
|
32
|
+
"flax" : {
|
|
33
|
+
"base" : FlaxStableDiffusionPipeline,
|
|
34
|
+
"txt2img" : FlaxStableDiffusionPipeline,
|
|
35
|
+
"img2img" : FlaxStableDiffusionImg2ImgPipeline,
|
|
36
|
+
"inpaint" : FlaxStableDiffusionInpaintPipeline,
|
|
37
|
+
"txt2video" : None,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class AutoPipeline(Search_cls,Basic_config):
|
|
45
|
+
def __init__(
|
|
46
|
+
self,
|
|
47
|
+
search_word: str,
|
|
48
|
+
pipe_type = "txt2img",
|
|
49
|
+
auto: Optional[bool] = True,
|
|
50
|
+
priority: Optional[str] = "hugface",
|
|
51
|
+
branch: Optional[str] = "main",
|
|
52
|
+
search_local_only: Optional[bool] = False,
|
|
53
|
+
**keywords
|
|
54
|
+
):
|
|
55
|
+
|
|
56
|
+
super().__init__()
|
|
57
|
+
self.seach_word = search_word
|
|
58
|
+
self.pipe_type = pipe_type
|
|
59
|
+
self.auto = auto
|
|
60
|
+
self.priority = priority
|
|
61
|
+
self.branch = branch
|
|
62
|
+
self.search_local_only = search_local_only
|
|
63
|
+
|
|
64
|
+
self.device = self.device_type_check()
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def pipeline_type(
|
|
69
|
+
self,
|
|
70
|
+
cls_or_name
|
|
71
|
+
):
|
|
72
|
+
if isinstance(str, cls_or_name):
|
|
73
|
+
if hasattr(diffusers, cls_or_name):
|
|
74
|
+
return getattr(diffusers, cls_or_name)
|
|
75
|
+
else:
|
|
76
|
+
candidate = self.max_temper(cls_or_name,dir(diffusers))
|
|
77
|
+
error_txt = f"Maybe {candidate}?" if candidate else ""
|
|
78
|
+
raise ValueError(f"{cls_or_name} is not in diffusers.{error_txt}")
|
|
79
|
+
|
|
80
|
+
elif hasattr(diffusers, cls_or_name.__name__):
|
|
81
|
+
return cls_or_name
|
|
82
|
+
|
|
83
|
+
else:
|
|
84
|
+
candidate = self.max_temper(cls_or_name,dir(diffusers))
|
|
85
|
+
error_txt = f"Maybe {candidate}?" if candidate else ""
|
|
86
|
+
raise ValueError(f"{cls_or_name} is not in diffusers.{error_txt}")
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|