abstractvision 0.1.0__py3-none-any.whl → 0.2.1__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.
@@ -0,0 +1,243 @@
1
+ Metadata-Version: 2.4
2
+ Name: abstractvision
3
+ Version: 0.2.1
4
+ Summary: Model-agnostic generative vision abstractions (image/video) for the Abstract ecosystem
5
+ Author-email: Laurent-Philippe Albou <contact@abstractcore.ai>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/abstractcore/abstractvision
8
+ Project-URL: Repository, https://github.com/abstractcore/abstractvision
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Topic :: Multimedia
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Requires-Python: >=3.8
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: diffusers>=0.36.0
24
+ Requires-Dist: torch<3.0.0,>=2.0
25
+ Requires-Dist: transformers<6.0.0,>=4.0
26
+ Requires-Dist: accelerate>=0.0
27
+ Requires-Dist: safetensors>=0.0
28
+ Requires-Dist: sentencepiece>=0.1.99
29
+ Requires-Dist: protobuf>=3.20.0
30
+ Requires-Dist: einops>=0.7.0
31
+ Requires-Dist: peft>=0.10.0
32
+ Requires-Dist: Pillow>=9.0
33
+ Requires-Dist: stable-diffusion-cpp-python>=0.4.2
34
+ Provides-Extra: openai-compatible
35
+ Provides-Extra: sdcpp
36
+ Requires-Dist: stable-diffusion-cpp-python>=0.4.2; extra == "sdcpp"
37
+ Provides-Extra: huggingface
38
+ Requires-Dist: diffusers>=0.36.0; extra == "huggingface"
39
+ Requires-Dist: torch>=2.0; extra == "huggingface"
40
+ Requires-Dist: transformers>=4.0; extra == "huggingface"
41
+ Requires-Dist: accelerate>=0.0; extra == "huggingface"
42
+ Requires-Dist: safetensors>=0.0; extra == "huggingface"
43
+ Requires-Dist: Pillow>=9.0; extra == "huggingface"
44
+ Provides-Extra: local
45
+ Requires-Dist: stable-diffusion-cpp-python>=0.4.2; extra == "local"
46
+ Requires-Dist: diffusers>=0.36.0; extra == "local"
47
+ Requires-Dist: torch>=2.0; extra == "local"
48
+ Requires-Dist: transformers>=4.0; extra == "local"
49
+ Requires-Dist: accelerate>=0.0; extra == "local"
50
+ Requires-Dist: safetensors>=0.0; extra == "local"
51
+ Requires-Dist: Pillow>=9.0; extra == "local"
52
+ Provides-Extra: huggingface-dev
53
+ Requires-Dist: diffusers>=0.36.0; extra == "huggingface-dev"
54
+ Requires-Dist: torch>=2.0; extra == "huggingface-dev"
55
+ Requires-Dist: transformers>=5.0; extra == "huggingface-dev"
56
+ Requires-Dist: accelerate>=0.0; extra == "huggingface-dev"
57
+ Requires-Dist: safetensors>=0.0; extra == "huggingface-dev"
58
+ Requires-Dist: Pillow>=9.0; extra == "huggingface-dev"
59
+ Provides-Extra: abstractcore
60
+ Requires-Dist: abstractcore>=2.0.0; extra == "abstractcore"
61
+ Dynamic: license-file
62
+
63
+ # AbstractVision
64
+
65
+ Model-agnostic generative vision API (images, optional video) for Python and the Abstract* ecosystem.
66
+
67
+ ## What you get
68
+
69
+ - A stable task API: `VisionManager` (`src/abstractvision/vision_manager.py`)
70
+ - A packaged capability registry (“what models can do”): `VisionModelCapabilitiesRegistry` backed by `src/abstractvision/assets/vision_model_capabilities.json`
71
+ - Optional artifact-ref outputs (small JSON refs): `LocalAssetStore` / store adapters (`src/abstractvision/artifacts.py`)
72
+ - Built-in backends (`src/abstractvision/backends/`):
73
+ - OpenAI-compatible HTTP (`openai_compatible.py`)
74
+ - Local Diffusers (`huggingface_diffusers.py`)
75
+ - Local stable-diffusion.cpp / GGUF (`stable_diffusion_cpp.py`)
76
+ - CLI/REPL for manual testing: `abstractvision ...` (`src/abstractvision/cli.py`)
77
+
78
+ ## Status (current backend support)
79
+
80
+ - Built-in backends implement: `text_to_image` and `image_to_image`.
81
+ - Video (`text_to_video`, `image_to_video`) is supported only via the OpenAI-compatible backend **when** endpoints are configured.
82
+ - `multi_view_image` is part of the public API (`VisionManager.generate_angles`) but no built-in backend implements it yet.
83
+
84
+ Details: `docs/reference/backends.md`.
85
+
86
+ ## Installation
87
+
88
+ ```bash
89
+ pip install abstractvision
90
+ ```
91
+
92
+ Install optional integrations:
93
+
94
+ ```bash
95
+ pip install "abstractvision[abstractcore]"
96
+ ```
97
+
98
+ Some newer model pipelines may require Diffusers from GitHub `main` (see `docs/getting-started.md`):
99
+
100
+ ```bash
101
+ pip install -U "abstractvision[huggingface-dev]"
102
+ ```
103
+
104
+ For local dev (from a repo checkout):
105
+
106
+ ```bash
107
+ pip install -e .
108
+ ```
109
+
110
+ ## Usage
111
+
112
+ Start here:
113
+ - Getting started: `docs/getting-started.md`
114
+ - FAQ: `docs/faq.md`
115
+ - API reference: `docs/api.md`
116
+ - Architecture: `docs/architecture.md`
117
+ - Docs index: `docs/README.md`
118
+
119
+ ### Capability-driven model selection
120
+
121
+ ```python
122
+ from abstractvision import VisionModelCapabilitiesRegistry
123
+
124
+ reg = VisionModelCapabilitiesRegistry()
125
+ assert reg.supports("Qwen/Qwen-Image-2512", "text_to_image")
126
+
127
+ print(reg.list_tasks())
128
+ print(reg.models_for_task("text_to_image"))
129
+ ```
130
+
131
+ ### Backend wiring + generation (artifact outputs)
132
+
133
+ The default install is “batteries included” (Torch + Diffusers + stable-diffusion.cpp python bindings), but heavy
134
+ modules are imported lazily (see `src/abstractvision/backends/__init__.py`).
135
+
136
+ ```python
137
+ from abstractvision import LocalAssetStore, VisionManager, VisionModelCapabilitiesRegistry, is_artifact_ref
138
+ from abstractvision.backends import OpenAICompatibleBackendConfig, OpenAICompatibleVisionBackend
139
+
140
+ reg = VisionModelCapabilitiesRegistry()
141
+
142
+ backend = OpenAICompatibleVisionBackend(
143
+ config=OpenAICompatibleBackendConfig(
144
+ base_url="http://localhost:1234/v1",
145
+ api_key="YOUR_KEY", # optional for local servers
146
+ model_id="REMOTE_MODEL", # optional (server-dependent)
147
+ )
148
+ )
149
+
150
+ vm = VisionManager(
151
+ backend=backend,
152
+ store=LocalAssetStore(), # enables artifact-ref outputs
153
+ model_id="zai-org/GLM-Image", # optional: capability gating
154
+ registry=reg, # optional: reuse loaded registry
155
+ )
156
+
157
+ out = vm.generate_image("a cinematic photo of a red fox in snow")
158
+ assert is_artifact_ref(out)
159
+ print(out) # {"$artifact": "...", "content_type": "...", ...}
160
+
161
+ png_bytes = vm.store.load_bytes(out["$artifact"]) # type: ignore[union-attr]
162
+ ```
163
+
164
+ ### Interactive testing (CLI / REPL)
165
+
166
+ ```bash
167
+ abstractvision models
168
+ abstractvision tasks
169
+ abstractvision show-model zai-org/GLM-Image
170
+
171
+ abstractvision repl
172
+ ```
173
+
174
+ Inside the REPL:
175
+
176
+ ```text
177
+ /backend openai http://localhost:1234/v1
178
+ /cap-model zai-org/GLM-Image
179
+ /set width 1024
180
+ /set height 1024
181
+ /t2i "a watercolor painting of a lighthouse" --open
182
+ ```
183
+
184
+ The CLI/REPL can also be configured via `ABSTRACTVISION_*` env vars; see `docs/reference/configuration.md`.
185
+
186
+ One-shot commands (OpenAI-compatible HTTP backend only):
187
+
188
+ ```bash
189
+ abstractvision t2i --base-url http://localhost:1234/v1 "a studio photo of an espresso machine"
190
+ abstractvision i2i --base-url http://localhost:1234/v1 --image ./input.png "make it watercolor"
191
+ ```
192
+
193
+ #### Local GGUF via stable-diffusion.cpp
194
+
195
+ If you want to run GGUF diffusion models locally (e.g. Qwen Image), use the stable-diffusion.cpp backend (`sdcpp`).
196
+
197
+ Recommended (pip-only; no external binary download): `pip install abstractvision` already includes the stable-diffusion.cpp python bindings (`stable-diffusion-cpp-python`).
198
+
199
+ Alternative (external executable):
200
+
201
+ - Install `sd-cli`: https://github.com/leejet/stable-diffusion.cpp/releases
202
+
203
+ In the REPL:
204
+
205
+ ```text
206
+ /backend sdcpp /path/to/qwen-image-2512-Q4_K_M.gguf /path/to/qwen_image_vae.safetensors /path/to/Qwen2.5-VL-7B-Instruct-*.gguf
207
+ /t2i "a watercolor painting of a lighthouse" --sampling-method euler --offload-to-cpu --diffusion-fa --flow-shift 3 --open
208
+ ```
209
+
210
+ Extra flags are forwarded via `request.extra`. In CLI mode they are forwarded to `sd-cli`; in python bindings mode, keys are mapped to python binding kwargs when supported and unsupported keys are ignored.
211
+
212
+ ### AbstractCore tool integration (artifact refs)
213
+
214
+ If you’re using AbstractCore tool calling, AbstractVision can expose vision tasks as tools:
215
+
216
+ ```python
217
+ from abstractvision.integrations.abstractcore import make_vision_tools
218
+
219
+ tools = make_vision_tools(vision_manager=vm, model_id="zai-org/GLM-Image")
220
+ ```
221
+
222
+ ## Project
223
+
224
+ - Release notes: `CHANGELOG.md`
225
+ - Contributing: `CONTRIBUTING.md`
226
+ - Security: `SECURITY.md`
227
+ - Acknowledgments: `ACKNOWLEDMENTS.md`
228
+
229
+ ## Requirements
230
+
231
+ - Python >= 3.8
232
+
233
+ ## License
234
+
235
+ MIT License - see LICENSE file for details.
236
+
237
+ ## Author
238
+
239
+ Laurent-Philippe Albou
240
+
241
+ ## Contact
242
+
243
+ contact@abstractcore.ai
@@ -0,0 +1,23 @@
1
+ abstractvision/__init__.py,sha256=X8elAB4DbOVU1ZRy1mDiSnuvLIBQK0Uikm6kb7EF11k,692
2
+ abstractvision/__main__.py,sha256=pXsGul2Vonr-hhezpPCXz76NxzdaEAgQPFBMpZ81GQo,117
3
+ abstractvision/artifacts.py,sha256=h0TWWbVx2zOI86vCamieIZ1fH_Uza1IkqYKbbMGNA-w,11346
4
+ abstractvision/cli.py,sha256=fYrhfgJA_Zg40JjnWzR1kUr3mY0X6IhOjIl1byer4Fc,34296
5
+ abstractvision/errors.py,sha256=-wvsCCOd3a9ztAmUj5fTnllkfe045RrrtaidvfUy01Y,633
6
+ abstractvision/model_capabilities.py,sha256=1oKcw8bXgaIdg73DmPwvwvVppGEkZ4LWjo4Z-egg6_w,10176
7
+ abstractvision/types.py,sha256=CJTmio8jtX-63zO5LVu34RSQ7NfdZVFfq6aOMwWX4so,2767
8
+ abstractvision/vision_manager.py,sha256=pcnZb8doGujU1hO2K_M01VdJi_feveN2tpBOIJ8wARU,5375
9
+ abstractvision/assets/vision_model_capabilities.json,sha256=LFu3gh7YtsPgKiGMcV0Qz0ukPcSPiTRpDMPdnUGYtDQ,14170
10
+ abstractvision/backends/__init__.py,sha256=h2lDPlJBrH8IRstkm0V-Bnvh2bTXG4sLCBjfyjTh4nU,1729
11
+ abstractvision/backends/base_backend.py,sha256=wboWF28FPhg4BMA0bCyg0FASlubrUhAH1SoPngN9UP0,2017
12
+ abstractvision/backends/huggingface_diffusers.py,sha256=UACu5ggrMYNg1wd-yE1NJ_tsPCi8O6qilt6nqtpHKzo,60451
13
+ abstractvision/backends/openai_compatible.py,sha256=RtLzdshoCuKgfZcnmXjSfoGdBHB3TAUqY__Cp0nAE-Y,13842
14
+ abstractvision/backends/stable_diffusion_cpp.py,sha256=aeH3LD85NMQgZ1KVBjVmMXgjRYUb9NsM3NOWRGfY1wA,28733
15
+ abstractvision/integrations/__init__.py,sha256=bw1iQ8xU0T82ej3V0Zda8Fgz_ZwgboWkSC8wqWvF3pc,149
16
+ abstractvision/integrations/abstractcore.py,sha256=nr5_jO49Jd_s52LIMilrATYZv1xbP_omy9AumlNVoJM,10179
17
+ abstractvision/integrations/abstractcore_plugin.py,sha256=VjJswb7s6wvAi3lWI1BDZlzdDsFm6tRJWj5dZo7RaUU,8061
18
+ abstractvision-0.2.1.dist-info/licenses/LICENSE,sha256=ifO3lH7cJAMqNv7IWJlVUsJ_4FOBfoh1SkhzTkxQHd4,1079
19
+ abstractvision-0.2.1.dist-info/METADATA,sha256=miH98efXN3SPPqPLv2bSl90LUHAIElPLA3WWven3cvA,8297
20
+ abstractvision-0.2.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
21
+ abstractvision-0.2.1.dist-info/entry_points.txt,sha256=SioGhlJ_kSc4RYzjZAZ97zjBWc6CnBamk3OKdpn7Re4,170
22
+ abstractvision-0.2.1.dist-info/top_level.txt,sha256=ZWt-i-WRPiqmiSny1lXgfS4oeN60q--SaJOaS8ft5UQ,15
23
+ abstractvision-0.2.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,5 @@
1
+ [abstractcore.capabilities_plugins]
2
+ abstractvision = abstractvision.integrations.abstractcore_plugin:register
3
+
4
+ [console_scripts]
5
+ abstractvision = abstractvision.cli:main
@@ -1,65 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: abstractvision
3
- Version: 0.1.0
4
- Summary: Generative vision capabilities for abstractcore.ai
5
- Home-page: https://github.com/abstractcore/abstractvision
6
- Author: Laurent-Philippe Albou
7
- Author-email: contact@abstractcore.ai
8
- Classifier: Development Status :: 3 - Alpha
9
- Classifier: Intended Audience :: Developers
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Requires-Python: >=3.8
17
- Description-Content-Type: text/markdown
18
- License-File: LICENSE
19
- Dynamic: author
20
- Dynamic: author-email
21
- Dynamic: classifier
22
- Dynamic: description
23
- Dynamic: description-content-type
24
- Dynamic: home-page
25
- Dynamic: license-file
26
- Dynamic: requires-python
27
- Dynamic: summary
28
-
29
- # abstractvision
30
-
31
- A Python project designed to work with abstractcore.ai and enable generative capabilities for vision.
32
-
33
- ## Overview
34
-
35
- abstractvision provides vision-related generative capabilities as part of the abstractcore.ai ecosystem.
36
-
37
- ## Installation
38
-
39
- ```bash
40
- pip install abstractvision
41
- ```
42
-
43
- ## Usage
44
-
45
- ```python
46
- from abstractvision import Vision
47
-
48
- # Example usage coming soon
49
- ```
50
-
51
- ## Requirements
52
-
53
- - Python >= 3.8
54
-
55
- ## License
56
-
57
- MIT License - see LICENSE file for details.
58
-
59
- ## Author
60
-
61
- Laurent-Philippe Albou
62
-
63
- ## Contact
64
-
65
- contact@abstractcore.ai
@@ -1,6 +0,0 @@
1
- abstractvision/__init__.py,sha256=f2PwzsC1Waw08X-N0qOHe2pu1AHKOqVaW3OG4ZuKtjM,227
2
- abstractvision-0.1.0.dist-info/licenses/LICENSE,sha256=ifO3lH7cJAMqNv7IWJlVUsJ_4FOBfoh1SkhzTkxQHd4,1079
3
- abstractvision-0.1.0.dist-info/METADATA,sha256=h_46a2CyvDNaPyxaWU_ExPZ3WT46d6IngYGdokKvoyM,1463
4
- abstractvision-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
- abstractvision-0.1.0.dist-info/top_level.txt,sha256=ZWt-i-WRPiqmiSny1lXgfS4oeN60q--SaJOaS8ft5UQ,15
6
- abstractvision-0.1.0.dist-info/RECORD,,