dsh-h3-image 0.2.9 → 0.2.10

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.
@@ -12,12 +12,17 @@ returned without any network access, so the following engine run is instant
12
12
  for the main weights while still converting shard by shard as usual.
13
13
 
14
14
  Endpoint honesty: every endpoint is tried DIRECT first (proxies explicitly
15
- disabled — a proxy download would silently spend the user's proxy data). Only
16
- after every endpoint failed direct does one final round run through the system
17
- proxy, announced by its own line before it starts. Redirects (301/302/303/
18
- 307/308) are followed by hand because urllib does not follow 308, which is
19
- exactly what a mirror answers for every file; the Range header is kept across
20
- hops so a resumed download stays resumed through a 308.
15
+ disabled — a proxy download would silently spend the user's proxy data). The
16
+ direct round runs twice: mirrors are often flaky in bursts, and a second
17
+ direct round costs nothing next to silently spending proxy data. Only after
18
+ both direct rounds fail does one final round run through the system proxy,
19
+ announced by its own line before it starts. Redirects (301/302/303/307/308)
20
+ are followed by hand because urllib does not follow 308, which is exactly
21
+ what a mirror answers for every file; the Range header is kept across hops
22
+ so a resumed download stays resumed through a 308. When a redirect chain
23
+ lands on a different host than the endpoint asked for (a mirror bouncing
24
+ users back to the origin), a note line says so — a slow file behind such a
25
+ bounce is the mirror's doing, and the log should not hide it.
21
26
 
22
27
  File-list truth: imported from the engine script (--engine-script), so a pin
23
28
  bump needs no change here.
@@ -27,6 +32,8 @@ Progress contract (parsed by lib/jobs.js, all flushed):
27
32
  [stage n/N] placed <name>
28
33
  [stage n/N] skipped <name> (already present)
29
34
  [stage n/N] switched endpoint: <host>
35
+ [stage n/N] note: <name> redirected to <host>
36
+ stage: <name>: direct round failed (<err>); retrying direct once
30
37
  stage: retrying via system proxy (may count against proxy data)
31
38
  STAGE OK (terminal, stdout)
32
39
  STAGE FAIL <rel> (terminal, stderr, exit 1)
@@ -113,6 +120,12 @@ def attempt(opener, url: str, dest: Path, part: Path, size: int, sha, name: str,
113
120
  have = 0
114
121
  headers = {"Range": f"bytes={have}-"} if have else {}
115
122
  with open_following(opener, url, headers) as resp:
123
+ final_host = urllib.parse.urlsplit(resp.geturl()).hostname or host
124
+ if final_host != host:
125
+ # A mirror that bounces to another host (typically the origin) is
126
+ # still "via <mirror>" in the log above; say where the bytes
127
+ # actually come from so a slow/stalled transfer is attributed right.
128
+ print(f"[stage {index}/{total}] note: {name} redirected to {final_host}", flush=True)
116
129
  resume = bool(have) and getattr(resp, "status", 200) == 206
117
130
  with part.open("ab" if resume else "wb") as out:
118
131
  while True:
@@ -154,13 +167,19 @@ def stage_file(*, name: str, rel: str, dest: Path, size: int, sha, endpoints,
154
167
  last_error = None
155
168
  attempts = 0
156
169
  direct = build_opener(direct=True)
157
- for endpoint in endpoints:
158
- try:
159
- attempt(direct, url_of(endpoint), dest, part, size, sha, name, index, total, first=attempts == 0)
160
- return True
161
- except Exception as error: # noqa: BLE001 — any failure means: next endpoint
162
- last_error = error
163
- attempts += 1
170
+ # Two direct rounds before touching the proxy: mirror flakiness is bursty
171
+ # (a file that times out once often succeeds seconds later), and a second
172
+ # direct round is free while proxy bytes are not.
173
+ for round_no in (1, 2):
174
+ for endpoint in endpoints:
175
+ try:
176
+ attempt(direct, url_of(endpoint), dest, part, size, sha, name, index, total, first=attempts == 0)
177
+ return True
178
+ except Exception as error: # noqa: BLE001 — any failure means: next endpoint
179
+ last_error = error
180
+ attempts += 1
181
+ if round_no == 1:
182
+ print(f"stage: {name}: direct round failed ({last_error}); retrying direct once", flush=True)
164
183
  print("stage: retrying via system proxy (may count against proxy data)", flush=True)
165
184
  proxied = build_opener(direct=False)
166
185
  for endpoint in endpoints:
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "H3 Image (dsh-h3-image)",
4
- "description": "Unofficial third-party plugin, not affiliated with MiniMax. On Apple Silicon, fully local text-to-image with the open-source MiniMax H3-Image (MLX engine). A one-time setup wizard downloads a fixed version of the engine and weights to your machine (the MiniMax community license and its region terms are shown before any download; you accept it yourself), then generation runs offline — no keys, no accounts, no network access. Long setup steps are background jobs that survive restarts and resume where they stopped. Requires Apple Silicon with 48 GB+ unified memory (32 GB is not guaranteed) and ~60 GB free disk during setup; Intel Macs and other platforms are declined up front. Current version (0.2.9): read-only environment check, setup wizard, and local generation (the community license must be explicitly accepted by you before the first image)."
4
+ "description": "Unofficial third-party plugin, not affiliated with MiniMax. On Apple Silicon, fully local text-to-image with the open-source MiniMax H3-Image (MLX engine). A one-time setup wizard downloads a fixed version of the engine and weights to your machine (the MiniMax community license and its region terms are shown before any download; you accept it yourself), then generation runs offline — no keys, no accounts, no network access. Long setup steps are background jobs that survive restarts and resume where they stopped. Requires Apple Silicon with 48 GB+ unified memory (32 GB is not guaranteed) and ~60 GB free disk during setup; Intel Macs and other platforms are declined up front. Current version (0.2.10): read-only environment check, setup wizard, and local generation (the community license must be explicitly accepted by you before the first image)."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "H3 本地生图 (dsh-h3-image)",
4
- "description": "非官方第三方插件,与 MiniMax 无关联。在 Apple Silicon 上用开源 MiniMax H3-Image(MLX 引擎)做完全本地文生图。安装向导一次性把固定版本的引擎与权重下载到本机(下载前展示 MiniMax 社区许可及地域条款,由你本人确认接受);之后生图全程离线——不用密钥、不用账号、不联网。安装中的长步骤是后台任务,DSH 重启不丢、断点续传。需 Apple Silicon、48GB 及以上统一内存(32GB 不保证)、安装期约 60GB 可用磁盘;Intel Mac 与其他平台在检查阶段即明确拒绝。当前版本(0.2.9):只读环境体检 + 安装向导 + 本地产图(社区许可需你本人确认接受后才会出图)。"
4
+ "description": "非官方第三方插件,与 MiniMax 无关联。在 Apple Silicon 上用开源 MiniMax H3-Image(MLX 引擎)做完全本地文生图。安装向导一次性把固定版本的引擎与权重下载到本机(下载前展示 MiniMax 社区许可及地域条款,由你本人确认接受);之后生图全程离线——不用密钥、不用账号、不联网。安装中的长步骤是后台任务,DSH 重启不丢、断点续传。需 Apple Silicon、48GB 及以上统一内存(32GB 不保证)、安装期约 60GB 可用磁盘;Intel Mac 与其他平台在检查阶段即明确拒绝。当前版本(0.2.10):只读环境体检 + 安装向导 + 本地产图(社区许可需你本人确认接受后才会出图)。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-h3-image",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "在 Apple Silicon 上用开源 MiniMax H3-Image(MLX 引擎)做完全本地文生图的 DeepSeek Harness 插件:一键安装向导 + 零出网本地生图。Fully local MiniMax H3-Image text-to-image on Apple Silicon MLX — a DeepSeek Harness plugin with a one-time setup wizard and no network access at generation.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",