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