Skip to content
4 min read · 718 words

Interface: LocalDiffusionGenerationAdapterOptions ​

Defined in: src/batteries/generation/local_diffusion/types.ts:86

Constructor options for LocalDiffusionGenerationAdapter.

Extends ​

Properties ​

PropertyTypeDescriptionInherited fromDefined in
abortGraceMs?numberGrace period after cancellation.-src/batteries/generation/local_diffusion/types.ts:119
args?string[]Backend arguments before the model context.-src/batteries/generation/local_diffusion/types.ts:91
cfgScale?numberDefault classifier-free guidance scale.-src/batteries/generation/local_diffusion/types.ts:127
commandstringBackend executable.-src/batteries/generation/local_diffusion/types.ts:89
commandPrefix?stringCommand prefix override.-src/batteries/generation/local_diffusion/types.ts:105
control?Partial<{ shutdown: string; stop: string; }>Control tag overrides.-src/batteries/generation/local_diffusion/types.ts:111
disposeGraceMs?numberGrace period for graceful disposal.-src/batteries/generation/local_diffusion/types.ts:121
eventPrefix?stringEvent prefix override.-src/batteries/generation/local_diffusion/types.ts:107
events?Partial<{ done: string; error: string; image: string; modelLoad: string; progress: string; ready: string; }>Event tag overrides.-src/batteries/generation/local_diffusion/types.ts:113
fs?DiffusionFsLikeFilesystem seam.-src/batteries/generation/local_diffusion/types.ts:95
height?numberDefault output height.-src/batteries/generation/local_diffusion/types.ts:135
isAvailable?() => booleanRuntime availability override.-src/batteries/generation/local_diffusion/types.ts:137
maxDecodedBytes?numberMaximum decoded inline image size.-src/batteries/generation/local_diffusion/types.ts:99
maxLineBytes?numberMaximum protocol line size.-src/batteries/generation/local_diffusion/types.ts:101
modelstringModel id to generate/edit images with. Required, no default. For OpenAI this is e.g. gpt-image-1 or dall-e-3.BaseGenerationAdapterOptions.modelsrc/batteries/generation/openai/types.ts:71
negativePrompt?stringDefault negative prompt.-src/batteries/generation/local_diffusion/types.ts:123
onCompiling?BatteryLifecycleCallbackEngine/graph/shader compilation after download, before the first token. A COARSE marker: the on-device runtimes (LiteRT Engine.create, transformers.js from_pretrained) expose the boundary — download done, opaque WebGPU/WASM graph build about to run — but NOT a progress stream, so progress is usually absent. Often the slowest part of a cold start; without this it was invisible.BatteryLifecycleHooks.onCompilingsrc/batteries/llm/chat_common/lifecycle.ts:95
onComplete?BatteryLifecycleCallbackAfter the turn's output is parsed + persisted, before ack (fires per turn).BatteryLifecycleHooks.onCompletesrc/batteries/llm/chat_common/lifecycle.ts:105
onError?BatteryLifecycleCallbackA load or generation failure (paired with nack).BatteryLifecycleHooks.onErrorsrc/batteries/llm/chat_common/lifecycle.ts:107
onGenerating?BatteryLifecycleCallbackThe generate call is in progress (fires per turn). Fires once immediately before the provider call for most engines; engines that stream per-step generation progress (e.g. a diffusion denoise loop) fire it REPEATEDLY during generation, each carrying a progress in 0..1.BatteryLifecycleHooks.onGeneratingsrc/batteries/llm/chat_common/lifecycle.ts:103
onLifecycle?BatteryLifecycleCallbackFires on EVERY phase transition (the firehose).BatteryLifecycleHooks.onLifecyclesrc/batteries/llm/chat_common/lifecycle.ts:86
onLoading?BatteryLifecycleCallbackWeights/runtime loading — may fire repeatedly with progress as the provider reports it.BatteryLifecycleHooks.onLoadingsrc/batteries/llm/chat_common/lifecycle.ts:88
onReady?BatteryLifecycleCallbackEngine/pipeline resolved and cached, before the first generation.BatteryLifecycleHooks.onReadysrc/batteries/llm/chat_common/lifecycle.ts:97
ops?Partial<{ edit: string; generate: string; }>Operation and event tag overrides.-src/batteries/generation/local_diffusion/types.ts:109
outputDir?stringDirectory within which backend output files may be deleted.-src/batteries/generation/local_diffusion/types.ts:97
protocol?Partial<ProtocolConfig>Protocol tag overrides.-src/batteries/generation/local_diffusion/types.ts:103
requestTimeoutMs?numberRequest deadline in milliseconds; zero disables it.-src/batteries/generation/local_diffusion/types.ts:117
sampler?stringDefault sampler.-src/batteries/generation/local_diffusion/types.ts:129
seed?numberDefault random seed.-src/batteries/generation/local_diffusion/types.ts:131
spawn?DiffusionBackendSpawnerProcess factory seam.-src/batteries/generation/local_diffusion/types.ts:93
startupTimeoutMs?numberStartup deadline in milliseconds.-src/batteries/generation/local_diffusion/types.ts:115
steps?numberDefault denoising steps.-src/batteries/generation/local_diffusion/types.ts:125
width?numberDefault output width.-src/batteries/generation/local_diffusion/types.ts:133