@bendyline/gezel-inference 1.0.6 → 1.0.7
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.
- package/dist/cache/controller.d.ts +2 -0
- package/dist/cache/controller.js +38 -5
- package/dist/catalog/chat-models/index.json +1 -1
- package/dist/catalog/chat-models/lf/lfm3-1.7b-q4/manifest.json +114 -0
- package/dist/catalog/chat-models/lf/lfm3-1.7b-q4/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/chat-models/raw-index.json +1 -1
- package/dist/catalog/image-loras/index.json +1 -0
- package/dist/catalog/image-loras/kr/krea-2-ink-wash/manifest.json +31 -0
- package/dist/catalog/image-loras/kr/krea-2-ink-wash/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/kr/krea-2-isometric-3d/manifest.json +32 -0
- package/dist/catalog/image-loras/kr/krea-2-isometric-3d/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/kr/krea-2-kids-drawing/manifest.json +31 -0
- package/dist/catalog/image-loras/kr/krea-2-kids-drawing/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/kr/krea-2-pixel-art/manifest.json +31 -0
- package/dist/catalog/image-loras/kr/krea-2-pixel-art/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/kr/krea-2-soft-watercolor/manifest.json +31 -0
- package/dist/catalog/image-loras/kr/krea-2-soft-watercolor/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/kr/krea-2-turbo-4step/manifest.json +31 -0
- package/dist/catalog/image-loras/kr/krea-2-turbo-4step/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/mo/moss-image-gouache/manifest.json +29 -0
- package/dist/catalog/image-loras/mo/moss-image-gouache/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/mo/moss-image-sft-4step/manifest.json +30 -0
- package/dist/catalog/image-loras/mo/moss-image-sft-4step/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/qw/qwen-image-edit-2511-lightning/manifest.json +31 -0
- package/dist/catalog/image-loras/qw/qwen-image-edit-2511-lightning/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/raw-index.json +1 -0
- package/dist/catalog/image-loras/sd/sdxl-3d-render/manifest.json +29 -0
- package/dist/catalog/image-loras/sd/sdxl-3d-render/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/sd/sdxl-coloring-book/manifest.json +30 -0
- package/dist/catalog/image-loras/sd/sdxl-coloring-book/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/sd/sdxl-papercut/manifest.json +29 -0
- package/dist/catalog/image-loras/sd/sdxl-papercut/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-loras/sd/sdxl-pixel-art/manifest.json +29 -0
- package/dist/catalog/image-loras/sd/sdxl-pixel-art/versions/1.0.0/manifest.json +15 -0
- package/dist/catalog/image-models/fl/flux-2-klein-4b-q4/manifest.json +3 -0
- package/dist/catalog/image-models/index.json +1 -1
- package/dist/catalog/image-models/qw/qwen-image-edit-2511-q4/manifest.json +44 -0
- package/dist/catalog/image-models/qw/qwen-image-edit-2511-q4/versions/1.0.0/manifest.json +36 -0
- package/dist/catalog/image-models/raw-index.json +1 -1
- package/dist/catalog/knowledge-catalogs/index.json +1 -1
- package/dist/catalog/knowledge-catalogs/raw-index.json +1 -1
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-arts/versions/2026.10.2/manifest.json +181 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-astronomy/versions/2026.10.2/manifest.json +181 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-biology/versions/2026.10.2/manifest.json +217 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-business/versions/2026.10.2/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-film-tv/versions/2026.10.2/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-food-drink/versions/2026.10.2/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-games/versions/2026.10.2/manifest.json +181 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-general/manifest.json +55 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-general/versions/2026.10.2/manifest.json +165 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-geography/versions/2026.10.2/manifest.json +217 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-history/versions/2026.10.2/manifest.json +217 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-language/versions/2026.10.2/manifest.json +181 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-law/versions/2026.10.2/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-literature/versions/2026.10.2/manifest.json +193 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-mathematics/versions/2026.10.2/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-medicine/versions/2026.10.2/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-military/versions/2026.10.2/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-music/versions/2026.10.2/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-arts/versions/2026.10.2/manifest.json +209 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-business/versions/2026.10.2/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-entertainment/versions/2026.10.2/manifest.json +201 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-military/versions/2026.10.2/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-other/versions/2026.10.2/manifest.json +165 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-politics/versions/2026.10.2/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-religion/versions/2026.10.2/manifest.json +201 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-science/versions/2026.10.2/manifest.json +205 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-people-sports/versions/2026.10.2/manifest.json +237 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-politics/versions/2026.10.2/manifest.json +197 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-religion-philosophy/versions/2026.10.2/manifest.json +189 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-science/versions/2026.10.2/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-sports/versions/2026.10.2/manifest.json +193 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-technology/versions/2026.10.2/manifest.json +185 -0
- package/dist/catalog/knowledge-catalogs/wi/wikipedia-transportation/versions/2026.10.2/manifest.json +189 -0
- package/dist/catalog/provenance.json +2 -1
- package/dist/engine-components.js +2 -2
- package/dist/engines/electron-native-reuse.d.ts +7 -1
- package/dist/engines/electron-native-reuse.js +12 -4
- package/dist/engines/native-file-manifest.json +546 -406
- package/dist/engines/native-manifest.d.ts +4 -4
- package/dist/engines/native-manifest.js +36 -36
- package/dist/engines/resolver.js +1 -0
- package/dist/http/auth-context.d.ts +12 -0
- package/dist/http/routes/image-ensure-routes.d.ts +4 -0
- package/dist/http/routes/image-ensure-routes.js +102 -0
- package/dist/http/routes/v1-image-styles.d.ts +5 -0
- package/dist/http/routes/v1-image-styles.js +91 -0
- package/dist/http/routes/v1-images.d.ts +1 -0
- package/dist/http/routes/v1-images.js +15 -93
- package/dist/inference-service.js +2 -1
- package/dist/knowledge/worker-host.js +2 -0
- package/dist/machine-engine/inspect-runtime.js +12 -3
- package/dist/memory/embed-core.js +3 -0
- package/dist/memory/embeddings.js +2 -0
- package/dist/models/image-fit.js +2 -2
- package/dist/models/weight-facts.d.ts +5 -0
- package/dist/models/weight-facts.js +5 -2
- package/dist/providers/ds4/build-provider.js +1 -1
- package/dist/providers/ds4/residency.js +3 -3
- package/dist/providers/image/img2img-support.d.ts +36 -1
- package/dist/providers/image/img2img-support.js +30 -1
- package/dist/providers/image/local-engine.d.ts +1 -0
- package/dist/providers/image/local-engine.js +8 -2
- package/dist/providers/image/local-factory.d.ts +10 -1
- package/dist/providers/image/local-factory.js +33 -6
- package/dist/providers/image/mock.d.ts +8 -1
- package/dist/providers/image/mock.js +46 -1
- package/dist/providers/image/pull-registry.d.ts +25 -3
- package/dist/providers/image/pull-registry.js +96 -34
- package/dist/providers/image/sd-cpp.d.ts +63 -4
- package/dist/providers/image/sd-cpp.js +361 -38
- package/dist/providers/image/types.d.ts +76 -4
- package/dist/providers/image/types.js +8 -0
- package/dist/providers/llama-cpp/build-provider.js +3 -2
- package/dist/providers/llama-cpp/cache-adapter.d.ts +3 -0
- package/dist/providers/llama-cpp/cache-adapter.js +18 -4
- package/dist/providers/llama-cpp/devices.js +2 -2
- package/dist/providers/llama-cpp/engine-flags.d.ts +5 -0
- package/dist/providers/llama-cpp/engine-flags.js +5 -2
- package/dist/providers/mlx/provider.js +13 -4
- package/dist/providers/mlx/python/gezel_mlx_server.py +9 -2
- package/dist/providers/mlx/python/spec_decode.py +44 -5
- package/dist/providers/native/capacity-broker.d.ts +1 -1
- package/dist/providers/native/capacity-broker.js +8 -8
- package/dist/providers/native/capacity-budget.js +5 -4
- package/dist/providers/native/device-capacity-ledger.d.ts +2 -0
- package/dist/providers/native/device-capacity-ledger.js +36 -5
- package/dist/providers/native/device-capacity.js +4 -3
- package/dist/providers/native/local-engine-runtime.js +4 -4
- package/dist/providers/native/process-identity.d.ts +2 -0
- package/dist/providers/native/process-identity.js +70 -0
- package/dist/relevance/relevance-core.js +2 -0
- package/dist/relevance/relevance-model.js +2 -0
- package/dist/relevance/settings.js +2 -2
- package/dist/runtime-lock.d.ts +43 -5
- package/dist/runtime-lock.js +189 -26
- package/dist/system/host-memory.d.ts +46 -0
- package/dist/system/host-memory.js +89 -0
- package/dist/system/memory.js +5 -4
- package/dist/transformers-cache.js +2 -0
- package/dist/utils/download-common.d.ts +1 -1
- package/package.json +8 -8
|
@@ -15,10 +15,11 @@
|
|
|
15
15
|
* catalog manifest (so local state is self-describing even if the
|
|
16
16
|
* catalog entry later disappears).
|
|
17
17
|
*/
|
|
18
|
+
import { type ImageLoraPrompt, type ImageLoraPurpose, type ImageLoraRender } from '@bendyline/gezel';
|
|
18
19
|
import { type ModelStorageRoots } from '../../models/storage-roots.js';
|
|
19
20
|
import type { GpuArbiter } from '../gpu-arbiter.js';
|
|
20
21
|
import type { NativeEngineSupervisor } from '../native/supervisor.js';
|
|
21
|
-
import { type ImageEngineHealth, type ImageGenerationInput, type ImageGenerationOutput, type ImageGenerationProgress, type ImageModelPullEvent, type ImageModelPullSpec, type ImageProvider, type InstalledImageModelInfo } from './types.js';
|
|
22
|
+
import { type ImageEngineHealth, type ImageGenerationInput, type ImageGenerationOutput, type ImageGenerationProgress, type ImageLoraPullSpec, type ImageModelPullEvent, type ImageModelPullSpec, type ImageProvider, type InstalledImageLoraInfo, type InstalledImageModelInfo } from './types.js';
|
|
22
23
|
export interface StableDiffusionCppProviderOptions {
|
|
23
24
|
/** Base URL of the running sd-server (no trailing slash). */
|
|
24
25
|
baseUrl: string;
|
|
@@ -26,6 +27,13 @@ export interface StableDiffusionCppProviderOptions {
|
|
|
26
27
|
modelsRoot: string;
|
|
27
28
|
/** Optional read-only machine-store overlay. */
|
|
28
29
|
storageRoots?: ModelStorageRoots;
|
|
30
|
+
/**
|
|
31
|
+
* Where LoRAs install (`modelStorageRoots({ engine: 'sd-cpp-loras' })`).
|
|
32
|
+
* Only the writable root reaches the engine, which takes one
|
|
33
|
+
* `--lora-model-dir`. Absent when the engine is someone else's server
|
|
34
|
+
* (`GEZEL_SD_SERVER_URL`): renders then go without LoRAs, with a note.
|
|
35
|
+
*/
|
|
36
|
+
loraRoots?: ModelStorageRoots;
|
|
29
37
|
/** Awake-time budget for one render request, in ms. Defaults to 30 minutes. */
|
|
30
38
|
timeoutMs?: number;
|
|
31
39
|
/** Injected for tests. Defaults to global fetch. */
|
|
@@ -130,6 +138,8 @@ export interface SdServerLoadProfile {
|
|
|
130
138
|
* measured not to change.
|
|
131
139
|
*/
|
|
132
140
|
stepCache?: 'easycache';
|
|
141
|
+
/** `--model-args` key=value list. See MODEL_ARGS. */
|
|
142
|
+
modelArgs?: string;
|
|
133
143
|
}
|
|
134
144
|
export declare function sdServerLoadProfile(modelId: string): SdServerLoadProfile;
|
|
135
145
|
export declare class StableDiffusionCppProvider implements ImageProvider {
|
|
@@ -137,6 +147,7 @@ export declare class StableDiffusionCppProvider implements ImageProvider {
|
|
|
137
147
|
private readonly baseUrl;
|
|
138
148
|
private readonly modelsRoot;
|
|
139
149
|
private readonly storageRoots;
|
|
150
|
+
private readonly loraRoots?;
|
|
140
151
|
private readonly timeoutMs;
|
|
141
152
|
private readonly fetchImpl;
|
|
142
153
|
private readonly supervisor?;
|
|
@@ -150,6 +161,28 @@ export declare class StableDiffusionCppProvider implements ImageProvider {
|
|
|
150
161
|
generate(input: ImageGenerationInput): Promise<ImageGenerationOutput>;
|
|
151
162
|
private generateInner;
|
|
152
163
|
listInstalledModels(): Promise<InstalledImageModelInfo[]>;
|
|
164
|
+
/** Installed LoRAs, from the root the engine reads; none when this engine takes none. */
|
|
165
|
+
listLoras(): Promise<InstalledImageLoraInfo[]>;
|
|
166
|
+
/**
|
|
167
|
+
* Install one LoRA: a single safetensors file, sha256-checked like a model,
|
|
168
|
+
* beside a `manifest.json` that keeps the catalog's recipe so the engine can
|
|
169
|
+
* apply it without the catalog.
|
|
170
|
+
*/
|
|
171
|
+
pullLora(id: string, spec: ImageLoraPullSpec, signal?: AbortSignal): AsyncIterable<ImageModelPullEvent>;
|
|
172
|
+
deleteLora(id: string): Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* The LoRAs a render asked for that this engine can apply to `modelId`:
|
|
175
|
+
* installed in the root the engine reads and checked on that model. The
|
|
176
|
+
* rest are dropped with a note, never an error.
|
|
177
|
+
*/
|
|
178
|
+
private resolveLoras;
|
|
179
|
+
/**
|
|
180
|
+
* Keep the LoRAs the running engine can see. sd-server fills its LoRA list
|
|
181
|
+
* only when it is asked for it, and answers `invalid lora path` for any LoRA
|
|
182
|
+
* named before then, so the list is read before every LoRA render.
|
|
183
|
+
*/
|
|
184
|
+
private lorasTheEngineHas;
|
|
185
|
+
private readInstalledLora;
|
|
153
186
|
pullModel(id: string, spec: ImageModelPullSpec, signal?: AbortSignal): AsyncIterable<ImageModelPullEvent>;
|
|
154
187
|
/**
|
|
155
188
|
* Stream a single URL to disk with sha256 verification, reporting cumulative
|
|
@@ -167,11 +200,13 @@ export declare class StableDiffusionCppProvider implements ImageProvider {
|
|
|
167
200
|
health(): Promise<ImageEngineHealth>;
|
|
168
201
|
shutdown(): Promise<void>;
|
|
169
202
|
/**
|
|
170
|
-
* The
|
|
171
|
-
*
|
|
172
|
-
* {@link listInstalledModels} so the default is
|
|
203
|
+
* The model a fresh picture renders with: the configured default when it
|
|
204
|
+
* is installed and draws, else the first installed model that draws. Stable
|
|
205
|
+
* ordering matches {@link listInstalledModels} so the default is
|
|
206
|
+
* deterministic.
|
|
173
207
|
*/
|
|
174
208
|
resolveDefaultModelId(): Promise<string | undefined>;
|
|
209
|
+
private chooseModel;
|
|
175
210
|
private defaultSampleSteps;
|
|
176
211
|
/**
|
|
177
212
|
* Read the installed `manifest.json` fields that steer per-model
|
|
@@ -182,6 +217,30 @@ export declare class StableDiffusionCppProvider implements ImageProvider {
|
|
|
182
217
|
*/
|
|
183
218
|
private readInstalledManifestFields;
|
|
184
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* sd-server reads `<sd_cpp_extra_args>{json}</sd_cpp_extra_args>` out of a
|
|
222
|
+
* prompt and applies the JSON as generation parameters, including LoRA and
|
|
223
|
+
* ADetailer model paths it never checks. Prompts come from gezels reading
|
|
224
|
+
* untrusted content and from other apps, so the tag never reaches the engine.
|
|
225
|
+
* Repeated until stable: removing one tag can join the pieces around it into
|
|
226
|
+
* another.
|
|
227
|
+
*/
|
|
228
|
+
export declare function withoutEngineDirectives(text: string): string;
|
|
229
|
+
/** An installed LoRA with the recipe its catalog entry gave it. */
|
|
230
|
+
export interface InstalledLora {
|
|
231
|
+
id: string;
|
|
232
|
+
name: string;
|
|
233
|
+
filename: string;
|
|
234
|
+
purpose: ImageLoraPurpose;
|
|
235
|
+
strength: number;
|
|
236
|
+
baseModels: string[];
|
|
237
|
+
prompt?: ImageLoraPrompt;
|
|
238
|
+
render?: ImageLoraRender;
|
|
239
|
+
approxSizeBytes: number;
|
|
240
|
+
installedAt: string;
|
|
241
|
+
}
|
|
242
|
+
/** Every LoRA installed under `loraRoot`, skipping malformed ones. */
|
|
243
|
+
export declare function readInstalledLoras(loraRoot: string): Promise<InstalledLora[]>;
|
|
185
244
|
/**
|
|
186
245
|
* Parse one line of sd-server's weight-load bar, which it prints inside the
|
|
187
246
|
* first request after a launch because it loads weights lazily:
|