auto-diffusers 1.3.3__tar.gz → 1.4.3__tar.gz
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-1.3.3/src/auto_diffusers.egg-info → auto_diffusers-1.4.3}/PKG-INFO +38 -6
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/README.md +35 -5
- auto_diffusers-1.4.3/Version.txt +1 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/setup.py +2 -0
- auto_diffusers-1.4.3/src/auto_diffusers/__init__.py +6 -0
- auto_diffusers-1.4.3/src/auto_diffusers/auto_pipe/__init__.py +1 -0
- auto_diffusers-1.4.3/src/auto_diffusers/auto_pipe/auto_pipe_cls.py +91 -0
- auto_diffusers-1.4.3/src/auto_diffusers/checker/checkpoint_type.py +1856 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/checker/get_checkpoint_type.py +4 -3
- auto_diffusers-1.4.3/src/auto_diffusers/model_path/__init__.py +7 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/model_path/create_pipeline.py +6 -3
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/model_path/flax_config.py +1 -1
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/model_path/mix_class.py +1 -1
- auto_diffusers-1.4.3/src/auto_diffusers/model_path/perform_path_search.py +337 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/model_path/search_civitai.py +17 -9
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/model_path/search_hugface.py +164 -114
- auto_diffusers-1.4.3/src/auto_diffusers/setup/__init__.py +1 -0
- auto_diffusers-1.3.3/src/auto_diffusers/setup/Base_config.py → auto_diffusers-1.4.3/src/auto_diffusers/setup/base_config.py +16 -1
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/setup/device_config.py +17 -3
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/utils/run_download.py +0 -2
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3/src/auto_diffusers.egg-info}/PKG-INFO +38 -6
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers.egg-info/SOURCES.txt +5 -2
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers.egg-info/requires.txt +2 -0
- auto_diffusers-1.3.3/Version.txt +0 -1
- auto_diffusers-1.3.3/src/auto_diffusers/__init__.py +0 -6
- auto_diffusers-1.3.3/src/auto_diffusers/model_path/Perform_path_search.py +0 -228
- auto_diffusers-1.3.3/src/auto_diffusers/model_path/__init__.py +0 -7
- auto_diffusers-1.3.3/src/auto_diffusers/setup/__init__.py +0 -1
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/LICENSE +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/MANIFEST.in +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/setup.cfg +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/checker/__init__.py +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/checker/memorize_config.py +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/py.typed +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/setup/data_class.py +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/setup/runtime_config.py +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/utils/__init__.py +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/utils/device_config.py +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/utils/get_custom_logger.py +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/utils/hide_warning.py +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers/utils/process_bar.py +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers.egg-info/dependency_links.txt +0 -0
- {auto_diffusers-1.3.3 → auto_diffusers-1.4.3}/src/auto_diffusers.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: auto_diffusers
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.3
|
|
4
4
|
Summary: Customized diffusers with model search and other functions.
|
|
5
5
|
Home-page: https://github.com/suzukimain/auto_diffusers
|
|
6
6
|
Author: suzukimain
|
|
@@ -23,6 +23,8 @@ License-File: LICENSE
|
|
|
23
23
|
Requires-Dist: diffusers
|
|
24
24
|
Requires-Dist: transformers
|
|
25
25
|
Requires-Dist: huggingface-hub
|
|
26
|
+
Requires-Dist: safetensors
|
|
27
|
+
Requires-Dist: tensorflow
|
|
26
28
|
Requires-Dist: requests
|
|
27
29
|
Requires-Dist: torch
|
|
28
30
|
Requires-Dist: jax
|
|
@@ -37,12 +39,14 @@ Requires-Dist: natsort
|
|
|
37
39
|
<p>
|
|
38
40
|
<a href="https://pepy.tech/project/auto_diffusers"><img alt="GitHub release" src="https://static.pepy.tech/badge/auto_diffusers"></a>
|
|
39
41
|
<a href="https://github.com/suzukimain/auto_diffusers/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/suzukimain/auto_diffusers.svg"></a>
|
|
42
|
+
<img src="https://visitor-badge.laobi.icu/badge?page_id=suzukimain.auto_diffusers" alt="Visitor Badge">
|
|
40
43
|
</p>
|
|
41
44
|
|
|
42
45
|
|
|
43
46
|
>CONTENTS
|
|
44
47
|
+ [About The Project](#About_The_Project)
|
|
45
48
|
+ [How to use](#How_to_use)
|
|
49
|
+
+ [Example](#Example)
|
|
46
50
|
+ [Description](#Description)
|
|
47
51
|
+ [License](#License)
|
|
48
52
|
+ [Acknowledgement](#Acknowledgement)
|
|
@@ -66,6 +70,23 @@ model_path = run_search(<keyword>, auto=True, download=False)
|
|
|
66
70
|
pipe = StableDIffusionPipeline.from_single_file(model_path)
|
|
67
71
|
```
|
|
68
72
|
|
|
73
|
+
## Example<a name = "Example"></a>
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
pip install --quiet diffusers
|
|
77
|
+
pip install --quiet auto_diffusers
|
|
78
|
+
|
|
79
|
+
from diffusers import StableDiffusionPipeline
|
|
80
|
+
from IPython.display import display
|
|
81
|
+
from auto_diffusers import run_search
|
|
82
|
+
|
|
83
|
+
model_path = run_search("Any", auto=True, model_format="diffusers", download=False)
|
|
84
|
+
pipe = StableDiffusionPipeline.from_pretrained(model_path).to("cuda")
|
|
85
|
+
image = pipe("Mt. Fuji").images[0]
|
|
86
|
+
print(f"model_path: {model_path}")
|
|
87
|
+
display(image)
|
|
88
|
+
```
|
|
89
|
+
|
|
69
90
|
## Description<a name = "Description"></a>
|
|
70
91
|
> Arguments of `run_search`
|
|
71
92
|
>
|
|
@@ -74,10 +95,12 @@ pipe = StableDIffusionPipeline.from_single_file(model_path)
|
|
|
74
95
|
| search_word | string | ー | [Details](#search-word) | Keywords to search models |
|
|
75
96
|
| auto | bool | True | ー | Minimize user input by selecting the highest-rated models. |
|
|
76
97
|
| download | bool | False | ー | Returns the path where the file was downloaded. |
|
|
77
|
-
|
|
|
98
|
+
| model_format | string | "single_file" | `all`,<br> `diffusers`,<br> `single_file`| Specifies the format of the model. [Details](#model_format) |
|
|
99
|
+
| model_type | string | "Checkpoint"| `Checkpoint`,<br>`TextualInversion`,<br>`Hypernetwork`,<br>`AestheticGradient`,<br>`LORA`,<br>`Controlnet`,<br>`Poses` | Valid only in Civitai. |
|
|
78
100
|
| return_path | bool | True | ー | Returns only the path or `[model_path, status_dict]`. |
|
|
79
101
|
| branch | string | "main" | ー | Specify the branches of huggingface and civitai. |
|
|
80
|
-
| local_file_only| bool | False | ー | Search local folders only
|
|
102
|
+
| local_file_only| bool | False | ー | Search local folders only.<br>**In the case of `auto`, files with names similar to `search_word` will be given priority.** |
|
|
103
|
+
|
|
81
104
|
|
|
82
105
|
|
|
83
106
|
<a id="search-word"></a>
|
|
@@ -93,11 +116,20 @@ pipe = StableDIffusionPipeline.from_single_file(model_path)
|
|
|
93
116
|
|
|
94
117
|
</details>
|
|
95
118
|
|
|
96
|
-
|
|
97
|
-
<
|
|
98
|
-
|
|
119
|
+
|
|
120
|
+
<a id="model_format"></a>
|
|
121
|
+
<details open>
|
|
122
|
+
<summary>model_format</summary>
|
|
123
|
+
|
|
124
|
+
| Argument | Description |
|
|
125
|
+
| :--------------------------: | :--------------------------------------------------------------------: |
|
|
126
|
+
| all | In auto, `multifolder diffusers format checkpoint` takes precedence |
|
|
127
|
+
| single_file | Only `single file checkpoint` are searched. |
|
|
128
|
+
| diffusers | Search only for `multifolder diffusers format checkpoint`<br>**Note that only the huggingface is searched for, since it is not in civitai.** |
|
|
129
|
+
|
|
99
130
|
</details>
|
|
100
131
|
|
|
132
|
+
|
|
101
133
|
## License<a name = "License"></a>
|
|
102
134
|
In accordance with [BSD-3-Clause license](LICENSE)
|
|
103
135
|
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
<p>
|
|
8
8
|
<a href="https://pepy.tech/project/auto_diffusers"><img alt="GitHub release" src="https://static.pepy.tech/badge/auto_diffusers"></a>
|
|
9
9
|
<a href="https://github.com/suzukimain/auto_diffusers/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/suzukimain/auto_diffusers.svg"></a>
|
|
10
|
+
<img src="https://visitor-badge.laobi.icu/badge?page_id=suzukimain.auto_diffusers" alt="Visitor Badge">
|
|
10
11
|
</p>
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
>CONTENTS
|
|
14
15
|
+ [About The Project](#About_The_Project)
|
|
15
16
|
+ [How to use](#How_to_use)
|
|
17
|
+
+ [Example](#Example)
|
|
16
18
|
+ [Description](#Description)
|
|
17
19
|
+ [License](#License)
|
|
18
20
|
+ [Acknowledgement](#Acknowledgement)
|
|
@@ -36,6 +38,23 @@ model_path = run_search(<keyword>, auto=True, download=False)
|
|
|
36
38
|
pipe = StableDIffusionPipeline.from_single_file(model_path)
|
|
37
39
|
```
|
|
38
40
|
|
|
41
|
+
## Example<a name = "Example"></a>
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
pip install --quiet diffusers
|
|
45
|
+
pip install --quiet auto_diffusers
|
|
46
|
+
|
|
47
|
+
from diffusers import StableDiffusionPipeline
|
|
48
|
+
from IPython.display import display
|
|
49
|
+
from auto_diffusers import run_search
|
|
50
|
+
|
|
51
|
+
model_path = run_search("Any", auto=True, model_format="diffusers", download=False)
|
|
52
|
+
pipe = StableDiffusionPipeline.from_pretrained(model_path).to("cuda")
|
|
53
|
+
image = pipe("Mt. Fuji").images[0]
|
|
54
|
+
print(f"model_path: {model_path}")
|
|
55
|
+
display(image)
|
|
56
|
+
```
|
|
57
|
+
|
|
39
58
|
## Description<a name = "Description"></a>
|
|
40
59
|
> Arguments of `run_search`
|
|
41
60
|
>
|
|
@@ -44,10 +63,12 @@ pipe = StableDIffusionPipeline.from_single_file(model_path)
|
|
|
44
63
|
| search_word | string | ー | [Details](#search-word) | Keywords to search models |
|
|
45
64
|
| auto | bool | True | ー | Minimize user input by selecting the highest-rated models. |
|
|
46
65
|
| download | bool | False | ー | Returns the path where the file was downloaded. |
|
|
47
|
-
|
|
|
66
|
+
| model_format | string | "single_file" | `all`,<br> `diffusers`,<br> `single_file`| Specifies the format of the model. [Details](#model_format) |
|
|
67
|
+
| model_type | string | "Checkpoint"| `Checkpoint`,<br>`TextualInversion`,<br>`Hypernetwork`,<br>`AestheticGradient`,<br>`LORA`,<br>`Controlnet`,<br>`Poses` | Valid only in Civitai. |
|
|
48
68
|
| return_path | bool | True | ー | Returns only the path or `[model_path, status_dict]`. |
|
|
49
69
|
| branch | string | "main" | ー | Specify the branches of huggingface and civitai. |
|
|
50
|
-
| local_file_only| bool | False | ー | Search local folders only
|
|
70
|
+
| local_file_only| bool | False | ー | Search local folders only.<br>**In the case of `auto`, files with names similar to `search_word` will be given priority.** |
|
|
71
|
+
|
|
51
72
|
|
|
52
73
|
|
|
53
74
|
<a id="search-word"></a>
|
|
@@ -63,11 +84,20 @@ pipe = StableDIffusionPipeline.from_single_file(model_path)
|
|
|
63
84
|
|
|
64
85
|
</details>
|
|
65
86
|
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
87
|
+
|
|
88
|
+
<a id="model_format"></a>
|
|
89
|
+
<details open>
|
|
90
|
+
<summary>model_format</summary>
|
|
91
|
+
|
|
92
|
+
| Argument | Description |
|
|
93
|
+
| :--------------------------: | :--------------------------------------------------------------------: |
|
|
94
|
+
| all | In auto, `multifolder diffusers format checkpoint` takes precedence |
|
|
95
|
+
| single_file | Only `single file checkpoint` are searched. |
|
|
96
|
+
| diffusers | Search only for `multifolder diffusers format checkpoint`<br>**Note that only the huggingface is searched for, since it is not in civitai.** |
|
|
97
|
+
|
|
69
98
|
</details>
|
|
70
99
|
|
|
100
|
+
|
|
71
101
|
## License<a name = "License"></a>
|
|
72
102
|
In accordance with [BSD-3-Clause license](LICENSE)
|
|
73
103
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.4.3
|
|
@@ -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
|
+
|