ollamadiffuser 2.0.1__tar.gz → 2.0.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.
- {ollamadiffuser-2.0.1/ollamadiffuser.egg-info → ollamadiffuser-2.0.3}/PKG-INFO +1 -1
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/__init__.py +1 -1
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/flux_strategy.py +10 -3
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/generic_strategy.py +3 -14
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/hidream_strategy.py +6 -3
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/video_strategy.py +1 -2
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3/ollamadiffuser.egg-info}/PKG-INFO +1 -1
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/pyproject.toml +1 -1
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/tests/test_engine.py +3 -3
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/CHANGELOG.md +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/LICENSE +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/MANIFEST.in +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/README.md +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/__main__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/api/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/api/server.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/cli/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/cli/commands.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/cli/config_commands.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/cli/lora_commands.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/cli/main.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/cli/model_commands.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/cli/recommend_command.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/cli/registry_commands.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/config/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/config/model_registry.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/config/settings.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/base.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/engine.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/controlnet_strategy.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/gguf_strategy.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/sd15_strategy.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/sd3_strategy.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/sdxl_strategy.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/models/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/models/gguf_loader.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/models/manager.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/utils/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/utils/controlnet_preprocessors.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/utils/download_utils.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/utils/lora_manager.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/mcp/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/mcp/server.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/canny/geometric_shapes.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/canny/house_outline.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/canny/portrait_outline.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/depth/linear_perspective.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/depth/radial_gradient.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/depth/sphere_3d.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/metadata.json +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/openpose/running_pose.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/openpose/sitting_pose.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/openpose/standing_pose.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/scribble/car_sketch.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/scribble/face_sketch.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/scribble/tree_sketch.png +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/templates/index.html +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/web.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/utils/__init__.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser.egg-info/SOURCES.txt +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser.egg-info/dependency_links.txt +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser.egg-info/entry_points.txt +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser.egg-info/not-zip-safe +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser.egg-info/requires.txt +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser.egg-info/top_level.txt +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/requirements.txt +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/setup.cfg +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/setup.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/tests/test_api_base64.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/tests/test_api_server.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/tests/test_mcp_server.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/tests/test_model_registry.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/tests/test_mps_support.py +0 -0
- {ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/tests/test_settings.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ollamadiffuser
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: Local AI Image Generation with Ollama-style CLI for Stable Diffusion, FLUX, and LoRA support
|
|
5
5
|
Home-page: https://github.com/ollamadiffuser/ollamadiffuser
|
|
6
6
|
Author: OllamaDiffuser Team
|
|
@@ -4,7 +4,7 @@ OllamaDiffuser - Local AI Image Generation with Ollama-style CLI
|
|
|
4
4
|
A tool for managing and running Stable Diffusion, FLUX.1, and other AI image generation models locally.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
__version__ = "2.0.
|
|
7
|
+
__version__ = "2.0.3"
|
|
8
8
|
__author__ = "OllamaDiffuser Team"
|
|
9
9
|
__email__ = "ollamadiffuser@gmail.com"
|
|
10
10
|
__description__ = "🎨 Local AI Image Generation with Ollama-style CLI for Stable Diffusion, FLUX.1, and LoRA support"
|
|
@@ -38,6 +38,11 @@ class FluxStrategy(InferenceStrategy):
|
|
|
38
38
|
if device == "cpu":
|
|
39
39
|
load_kwargs["torch_dtype"] = torch.float32
|
|
40
40
|
logger.warning("FLUX on CPU will be very slow for this 12B parameter model")
|
|
41
|
+
elif device == "mps":
|
|
42
|
+
# MPS has limited bfloat16 support; float16 avoids VAE decode crashes
|
|
43
|
+
load_kwargs["torch_dtype"] = torch.float16
|
|
44
|
+
load_kwargs["use_safetensors"] = True
|
|
45
|
+
load_kwargs["low_cpu_mem_usage"] = True
|
|
41
46
|
else:
|
|
42
47
|
load_kwargs["torch_dtype"] = torch.bfloat16
|
|
43
48
|
load_kwargs["use_safetensors"] = True
|
|
@@ -46,11 +51,11 @@ class FluxStrategy(InferenceStrategy):
|
|
|
46
51
|
model_config.path, **load_kwargs
|
|
47
52
|
)
|
|
48
53
|
|
|
49
|
-
if device
|
|
50
|
-
# CPU offloading manages device placement itself — don't call _move_to_device
|
|
54
|
+
if device == "cuda" and hasattr(self.pipeline, "enable_model_cpu_offload"):
|
|
51
55
|
self.pipeline.enable_model_cpu_offload(device=device)
|
|
52
56
|
logger.info(f"Enabled CPU offloading for FLUX on {device}")
|
|
53
57
|
else:
|
|
58
|
+
# MPS: unified memory means CPU offload adds overhead without saving memory
|
|
54
59
|
self._move_to_device(device)
|
|
55
60
|
self._apply_memory_optimizations()
|
|
56
61
|
|
|
@@ -102,7 +107,9 @@ class FluxStrategy(InferenceStrategy):
|
|
|
102
107
|
|
|
103
108
|
max_seq_len = kwargs.get("max_sequence_length", params.get("max_sequence_length", 512))
|
|
104
109
|
|
|
105
|
-
generator
|
|
110
|
+
# CPU offload moves tensors between CPU/device; use CPU generator to avoid device mismatches
|
|
111
|
+
gen_device = "cpu" if self.device == "mps" else self.device
|
|
112
|
+
generator, used_seed = self._make_generator(seed, gen_device)
|
|
106
113
|
|
|
107
114
|
gen_kwargs = {
|
|
108
115
|
"prompt": prompt,
|
|
@@ -72,20 +72,8 @@ class GenericPipelineStrategy(InferenceStrategy):
|
|
|
72
72
|
|
|
73
73
|
# Device placement
|
|
74
74
|
enable_offload = params.get("enable_cpu_offload", False)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
enable_offload = True
|
|
78
|
-
|
|
79
|
-
if enable_offload and device in ("cuda", "mps"):
|
|
80
|
-
if device == "mps" and hasattr(self.pipeline, "enable_model_cpu_offload"):
|
|
81
|
-
# MPS/unified memory: model-level offload is more effective than
|
|
82
|
-
# sequential offload because it fully deallocates entire components
|
|
83
|
-
# (T5 encoder, transformer, VAE) between stages, reducing peak
|
|
84
|
-
# memory pressure on the MPS allocator.
|
|
85
|
-
self.pipeline.enable_model_cpu_offload(device=device)
|
|
86
|
-
logger.info(f"Enabled model CPU offloading on {device}")
|
|
87
|
-
elif hasattr(self.pipeline, "enable_sequential_cpu_offload"):
|
|
88
|
-
# CUDA: sequential offload moves individual layers, lowest VRAM usage
|
|
75
|
+
if enable_offload and device == "cuda":
|
|
76
|
+
if hasattr(self.pipeline, "enable_sequential_cpu_offload"):
|
|
89
77
|
self.pipeline.enable_sequential_cpu_offload(device=device)
|
|
90
78
|
logger.info(f"Enabled sequential CPU offloading on {device}")
|
|
91
79
|
elif hasattr(self.pipeline, "enable_model_cpu_offload"):
|
|
@@ -94,6 +82,7 @@ class GenericPipelineStrategy(InferenceStrategy):
|
|
|
94
82
|
else:
|
|
95
83
|
self._move_to_device(device)
|
|
96
84
|
else:
|
|
85
|
+
# MPS: unified memory means CPU offload adds overhead without saving memory
|
|
97
86
|
self._move_to_device(device)
|
|
98
87
|
|
|
99
88
|
self._apply_memory_optimizations()
|
|
@@ -34,6 +34,9 @@ class HiDreamStrategy(InferenceStrategy):
|
|
|
34
34
|
load_kwargs = {**SAFETY_DISABLED_KWARGS}
|
|
35
35
|
if device == "cpu":
|
|
36
36
|
load_kwargs["torch_dtype"] = torch.float32
|
|
37
|
+
elif device == "mps":
|
|
38
|
+
load_kwargs["torch_dtype"] = torch.float16
|
|
39
|
+
load_kwargs["low_cpu_mem_usage"] = True
|
|
37
40
|
else:
|
|
38
41
|
load_kwargs["torch_dtype"] = torch.bfloat16
|
|
39
42
|
|
|
@@ -41,8 +44,7 @@ class HiDreamStrategy(InferenceStrategy):
|
|
|
41
44
|
model_config.path, **load_kwargs
|
|
42
45
|
)
|
|
43
46
|
|
|
44
|
-
if device
|
|
45
|
-
# CPU offloading manages device placement itself — don't call _move_to_device
|
|
47
|
+
if device == "cuda" and hasattr(self.pipeline, "enable_model_cpu_offload"):
|
|
46
48
|
self.pipeline.enable_model_cpu_offload(device=device)
|
|
47
49
|
else:
|
|
48
50
|
self._move_to_device(device)
|
|
@@ -77,7 +79,8 @@ class HiDreamStrategy(InferenceStrategy):
|
|
|
77
79
|
guidance = guidance_scale if guidance_scale is not None else params.get("guidance_scale", 5.0)
|
|
78
80
|
max_seq_len = kwargs.get("max_sequence_length", params.get("max_sequence_length", 128))
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
gen_device = "cpu" if self.device == "mps" else self.device
|
|
83
|
+
generator, used_seed = self._make_generator(seed, gen_device)
|
|
81
84
|
|
|
82
85
|
gen_kwargs = {
|
|
83
86
|
"prompt": prompt,
|
|
@@ -46,8 +46,7 @@ class VideoStrategy(InferenceStrategy):
|
|
|
46
46
|
steps_offset=1,
|
|
47
47
|
)
|
|
48
48
|
|
|
49
|
-
if device
|
|
50
|
-
# CPU offloading manages device placement itself — don't call _move_to_device
|
|
49
|
+
if device == "cuda" and hasattr(self.pipeline, "enable_model_cpu_offload"):
|
|
51
50
|
self.pipeline.enable_model_cpu_offload(device=device)
|
|
52
51
|
else:
|
|
53
52
|
self._move_to_device(device)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ollamadiffuser
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: Local AI Image Generation with Ollama-style CLI for Stable Diffusion, FLUX, and LoRA support
|
|
5
5
|
Home-page: https://github.com/ollamadiffuser/ollamadiffuser
|
|
6
6
|
Author: OllamaDiffuser Team
|
|
@@ -242,9 +242,9 @@ class TestGenericStrategy:
|
|
|
242
242
|
def test_generic_strategy_cpu_offload_mps(self):
|
|
243
243
|
result, mock_pipe = self._load_generic_with_offload("mps")
|
|
244
244
|
assert result is True
|
|
245
|
-
# MPS
|
|
246
|
-
mock_pipe.enable_model_cpu_offload.
|
|
247
|
-
mock_pipe.to.
|
|
245
|
+
# MPS: unified memory means CPU offload adds overhead, so load directly to device
|
|
246
|
+
mock_pipe.enable_model_cpu_offload.assert_not_called()
|
|
247
|
+
mock_pipe.to.assert_called_once()
|
|
248
248
|
|
|
249
249
|
|
|
250
250
|
class TestInferenceStrategyBase:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/inference/strategies/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/core/utils/controlnet_preprocessors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/canny/geometric_shapes.png
RENAMED
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/canny/house_outline.png
RENAMED
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/canny/portrait_outline.png
RENAMED
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/depth/linear_perspective.png
RENAMED
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/depth/radial_gradient.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/openpose/running_pose.png
RENAMED
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/openpose/sitting_pose.png
RENAMED
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/openpose/standing_pose.png
RENAMED
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/scribble/car_sketch.png
RENAMED
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/scribble/face_sketch.png
RENAMED
|
File without changes
|
{ollamadiffuser-2.0.1 → ollamadiffuser-2.0.3}/ollamadiffuser/ui/samples/scribble/tree_sketch.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|