auto-diffusers 1.4.3__tar.gz → 1.5.0__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 (40) hide show
  1. {auto_diffusers-1.4.3/src/auto_diffusers.egg-info → auto_diffusers-1.5.0}/PKG-INFO +32 -10
  2. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/README.md +31 -8
  3. auto_diffusers-1.5.0/Version.txt +1 -0
  4. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/setup.py +0 -1
  5. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/__init__.py +1 -1
  6. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/model_path/create_pipeline.py +2 -2
  7. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/setup/base_config.py +1 -2
  8. auto_diffusers-1.5.0/src/auto_diffusers/setup/device_config.py +31 -0
  9. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0/src/auto_diffusers.egg-info}/PKG-INFO +32 -10
  10. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers.egg-info/requires.txt +0 -1
  11. auto_diffusers-1.4.3/Version.txt +0 -1
  12. auto_diffusers-1.4.3/src/auto_diffusers/setup/device_config.py +0 -56
  13. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/LICENSE +0 -0
  14. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/MANIFEST.in +0 -0
  15. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/setup.cfg +0 -0
  16. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/auto_pipe/__init__.py +0 -0
  17. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/auto_pipe/auto_pipe_cls.py +0 -0
  18. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/checker/__init__.py +0 -0
  19. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/checker/checkpoint_type.py +0 -0
  20. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/checker/get_checkpoint_type.py +0 -0
  21. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/checker/memorize_config.py +0 -0
  22. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/model_path/__init__.py +0 -0
  23. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/model_path/flax_config.py +0 -0
  24. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/model_path/mix_class.py +0 -0
  25. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/model_path/perform_path_search.py +0 -0
  26. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/model_path/search_civitai.py +0 -0
  27. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/model_path/search_hugface.py +0 -0
  28. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/py.typed +0 -0
  29. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/setup/__init__.py +0 -0
  30. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/setup/data_class.py +0 -0
  31. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/setup/runtime_config.py +0 -0
  32. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/utils/__init__.py +0 -0
  33. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/utils/device_config.py +0 -0
  34. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/utils/get_custom_logger.py +0 -0
  35. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/utils/hide_warning.py +0 -0
  36. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/utils/process_bar.py +0 -0
  37. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers/utils/run_download.py +0 -0
  38. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers.egg-info/SOURCES.txt +0 -0
  39. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/src/auto_diffusers.egg-info/dependency_links.txt +0 -0
  40. {auto_diffusers-1.4.3 → auto_diffusers-1.5.0}/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.4.3
3
+ Version: 1.5.0
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
@@ -24,7 +24,6 @@ Requires-Dist: diffusers
24
24
  Requires-Dist: transformers
25
25
  Requires-Dist: huggingface-hub
26
26
  Requires-Dist: safetensors
27
- Requires-Dist: tensorflow
28
27
  Requires-Dist: requests
29
28
  Requires-Dist: torch
30
29
  Requires-Dist: jax
@@ -64,10 +63,26 @@ pip install diffusers
64
63
  pip install auto_diffusers
65
64
 
66
65
  from diffusers import StableDiffusionPipeline
67
- from auto_diffusers import run_search
68
-
69
- model_path = run_search(<keyword>, auto=True, download=False)
70
- pipe = StableDIffusionPipeline.from_single_file(model_path)
66
+ from auto_diffusers import model_search
67
+
68
+
69
+ path = model_search(
70
+ <keyword>,
71
+ auto = True,
72
+ model_format="diffusers",
73
+ download = False
74
+ )
75
+ pipe = StableDiffusionPipeline.from_pretrained(path)
76
+
77
+ # or
78
+
79
+ path = model_search(
80
+ <keyword>,
81
+ auto = True,
82
+ model_format="single_file",
83
+ download = False
84
+ )
85
+ pipe = StableDIffusionPipeline.from_single_file(path)
71
86
  ```
72
87
 
73
88
  ## Example<a name = "Example"></a>
@@ -78,17 +93,24 @@ pip install --quiet auto_diffusers
78
93
 
79
94
  from diffusers import StableDiffusionPipeline
80
95
  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)
96
+ from auto_diffusers import model_search
97
+
98
+ model_path = model_search(
99
+ "Any",
100
+ auto=True,
101
+ model_format="diffusers",
102
+ download=False
103
+ )
84
104
  pipe = StableDiffusionPipeline.from_pretrained(model_path).to("cuda")
105
+
85
106
  image = pipe("Mt. Fuji").images[0]
107
+
86
108
  print(f"model_path: {model_path}")
87
109
  display(image)
88
110
  ```
89
111
 
90
112
  ## Description<a name = "Description"></a>
91
- > Arguments of `run_search`
113
+ > Arguments of `model_search`
92
114
  >
93
115
  | Name | Type | Default | Input Available | Description |
94
116
  |:--------------:|:------:|:-----------:|:----------------:|:--------------------------------------------------------:|
@@ -32,10 +32,26 @@ pip install diffusers
32
32
  pip install auto_diffusers
33
33
 
34
34
  from diffusers import StableDiffusionPipeline
35
- from auto_diffusers import run_search
36
-
37
- model_path = run_search(<keyword>, auto=True, download=False)
38
- pipe = StableDIffusionPipeline.from_single_file(model_path)
35
+ from auto_diffusers import model_search
36
+
37
+
38
+ path = model_search(
39
+ <keyword>,
40
+ auto = True,
41
+ model_format="diffusers",
42
+ download = False
43
+ )
44
+ pipe = StableDiffusionPipeline.from_pretrained(path)
45
+
46
+ # or
47
+
48
+ path = model_search(
49
+ <keyword>,
50
+ auto = True,
51
+ model_format="single_file",
52
+ download = False
53
+ )
54
+ pipe = StableDIffusionPipeline.from_single_file(path)
39
55
  ```
40
56
 
41
57
  ## Example<a name = "Example"></a>
@@ -46,17 +62,24 @@ pip install --quiet auto_diffusers
46
62
 
47
63
  from diffusers import StableDiffusionPipeline
48
64
  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)
65
+ from auto_diffusers import model_search
66
+
67
+ model_path = model_search(
68
+ "Any",
69
+ auto=True,
70
+ model_format="diffusers",
71
+ download=False
72
+ )
52
73
  pipe = StableDiffusionPipeline.from_pretrained(model_path).to("cuda")
74
+
53
75
  image = pipe("Mt. Fuji").images[0]
76
+
54
77
  print(f"model_path: {model_path}")
55
78
  display(image)
56
79
  ```
57
80
 
58
81
  ## Description<a name = "Description"></a>
59
- > Arguments of `run_search`
82
+ > Arguments of `model_search`
60
83
  >
61
84
  | Name | Type | Default | Input Available | Description |
62
85
  |:--------------:|:------:|:-----------:|:----------------:|:--------------------------------------------------------:|
@@ -0,0 +1 @@
1
+ 1.5.0
@@ -9,7 +9,6 @@ _deps = [
9
9
  "transformers",
10
10
  "huggingface-hub",
11
11
  "safetensors",
12
- "tensorflow",
13
12
  "requests",
14
13
  "torch",
15
14
  "jax",
@@ -3,4 +3,4 @@ from .utils.run_download import download
3
3
  from .checker.get_checkpoint_type import checkpoint_type
4
4
  from .model_path.perform_path_search import Search_cls
5
5
 
6
- run_search = Search_cls()
6
+ model_search = Search_cls()
@@ -251,6 +251,6 @@ class pipeline_setup(Config_Mix):
251
251
  self.logger.debug(a)
252
252
  raise OSError("Check your internet connection")
253
253
  base_pipe = self.pipe_status_check(base_pipe)
254
- if self.device_type == "cpu" and base_pipe.dtype == torch.float16:
254
+ if self.device == "cpu" and base_pipe.dtype == torch.float16:
255
255
  self.logger.warning("CPU cannot use base_pipe with half precision (torch.float16)")
256
- return base_pipe, params, model_dict["url_or_path"]
256
+ return base_pipe, params, model_dict["url_or_path"]
@@ -22,8 +22,7 @@ class Basic_config(
22
22
  def __init__(self):
23
23
  super().__init__()
24
24
  self.device_count = self.count_device()
25
- self.device_type = self.device_type_check()
26
- self.device = self.extra_device_set()
25
+ self.device = self.device_type_check()
27
26
  self.use_TPU = self.is_TPU()
28
27
  self.logger = custom_logger()
29
28
 
@@ -0,0 +1,31 @@
1
+ import torch
2
+ import jax
3
+
4
+ from ..utils.get_custom_logger import custom_logger
5
+
6
+
7
+ class device_set:
8
+ def __init__(self):
9
+ self.device_type = self.device_type_check()
10
+ self.logger = custom_logger()
11
+
12
+ def device_type_check(self):
13
+ if torch.cuda.is_available():
14
+ return "cuda"
15
+ else:
16
+ device_type = jax.devices()[0].device_kind
17
+ if "TPU" in device_type:
18
+ return "TPU"
19
+ else:
20
+ return "cpu"
21
+
22
+
23
+ def count_device(self):
24
+ return jax.device_count()
25
+
26
+
27
+ def is_TPU(self):
28
+ if self.device_type_check() == "TPU":
29
+ return True
30
+ else:
31
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: auto_diffusers
3
- Version: 1.4.3
3
+ Version: 1.5.0
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
@@ -24,7 +24,6 @@ Requires-Dist: diffusers
24
24
  Requires-Dist: transformers
25
25
  Requires-Dist: huggingface-hub
26
26
  Requires-Dist: safetensors
27
- Requires-Dist: tensorflow
28
27
  Requires-Dist: requests
29
28
  Requires-Dist: torch
30
29
  Requires-Dist: jax
@@ -64,10 +63,26 @@ pip install diffusers
64
63
  pip install auto_diffusers
65
64
 
66
65
  from diffusers import StableDiffusionPipeline
67
- from auto_diffusers import run_search
68
-
69
- model_path = run_search(<keyword>, auto=True, download=False)
70
- pipe = StableDIffusionPipeline.from_single_file(model_path)
66
+ from auto_diffusers import model_search
67
+
68
+
69
+ path = model_search(
70
+ <keyword>,
71
+ auto = True,
72
+ model_format="diffusers",
73
+ download = False
74
+ )
75
+ pipe = StableDiffusionPipeline.from_pretrained(path)
76
+
77
+ # or
78
+
79
+ path = model_search(
80
+ <keyword>,
81
+ auto = True,
82
+ model_format="single_file",
83
+ download = False
84
+ )
85
+ pipe = StableDIffusionPipeline.from_single_file(path)
71
86
  ```
72
87
 
73
88
  ## Example<a name = "Example"></a>
@@ -78,17 +93,24 @@ pip install --quiet auto_diffusers
78
93
 
79
94
  from diffusers import StableDiffusionPipeline
80
95
  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)
96
+ from auto_diffusers import model_search
97
+
98
+ model_path = model_search(
99
+ "Any",
100
+ auto=True,
101
+ model_format="diffusers",
102
+ download=False
103
+ )
84
104
  pipe = StableDiffusionPipeline.from_pretrained(model_path).to("cuda")
105
+
85
106
  image = pipe("Mt. Fuji").images[0]
107
+
86
108
  print(f"model_path: {model_path}")
87
109
  display(image)
88
110
  ```
89
111
 
90
112
  ## Description<a name = "Description"></a>
91
- > Arguments of `run_search`
113
+ > Arguments of `model_search`
92
114
  >
93
115
  | Name | Type | Default | Input Available | Description |
94
116
  |:--------------:|:------:|:-----------:|:----------------:|:--------------------------------------------------------:|
@@ -2,7 +2,6 @@ diffusers
2
2
  transformers
3
3
  huggingface-hub
4
4
  safetensors
5
- tensorflow
6
5
  requests
7
6
  torch
8
7
  jax
@@ -1 +0,0 @@
1
- 1.4.3
@@ -1,56 +0,0 @@
1
- import jax
2
- import tensorflow as tf
3
-
4
- from ..utils.get_custom_logger import custom_logger
5
-
6
-
7
- class device_set:
8
- def __init__(self):
9
- self.device_type = self.device_type_check()
10
- self.logger = custom_logger()
11
-
12
- def device_type_check(self):
13
- if tf.config.experimental.list_physical_devices('GPU'):
14
- device_type = "cuda"
15
- else:
16
- try:
17
- tpu = tf.distribute.cluster_resolver.TPUClusterResolver() # TPUの検出
18
- tf.tpu.experimental.initialize_tpu_system(tpu)
19
- device_type = "TPU"
20
- except ValueError:
21
- device_type = "cpu"
22
- return device_type
23
-
24
-
25
- def extra_device_type_check(self):
26
- _device_type = jax.devices()[0].device_kind
27
- if "TPU" in _device_type:
28
- return "TPU"
29
- elif "cpu" in _device_type:
30
- return "cpu"
31
- else:
32
- return "cuda"
33
-
34
-
35
- def extra_device_set(self):
36
- device_type = self.device_type_check()
37
-
38
- if device_type == "TPU":
39
- #import torch_xla.core.xla_model as xm
40
- #device = xm.xla_device()
41
- device = tf.distribute.cluster_resolver.TPUClusterResolver() # TPUの検出
42
- tf.tpu.experimental.initialize_tpu_system(device)
43
- else:
44
- device = device_type
45
- return device
46
-
47
-
48
- def count_device(self):
49
- return jax.device_count()
50
-
51
-
52
- def is_TPU(self):
53
- if self.device_type_check() == "TPU":
54
- return True
55
- else:
56
- return False
File without changes
File without changes