Forked from ceveyne/generate-image
Forked from ceveyne/generate-image
src / config.ts
src / config.ts
// src/config.ts
// Local globalConfigSchematics for generate-image standalone plugin.
// Does NOT import from core-bundle — only @lmstudio/sdk.
// Key difference from draw-things-chat-core/src/config.ts:
// - PREVIEW_IN_CHAT default = true (inline delivery via tool result)
// - No baseUrl / apiKey / unloadAgentModelDuringRender (orchestrator-only fields)
import { createConfigSchematics } from "@lmstudio/sdk";
export const globalConfigSchematics = createConfigSchematics()
.field(
"PREVIEW_IN_CHAT",
"boolean",
{
displayName: "Previews in Chat",
subtitle:
"When enabled, tool responses include inline image previews. Recommended for local models without vision capability.",
},
true
)
.field(
"DRAW_THINGS_HOST",
"string",
{
displayName: "Draw Things Host",
subtitle: "Hostname or IP of the Draw Things backend server.",
placeholder: "127.0.0.1",
},
"127.0.0.1"
)
.field(
"DRAW_THINGS_HTTP_PORT",
"numeric",
{
displayName: "Draw Things HTTP Port",
subtitle: "HTTP API port (default: 7860).",
},
7860
)
.field(
"DRAW_THINGS_GRPC_PORT",
"numeric",
{
displayName: "Draw Things gRPC Port",
subtitle: "gRPC port (default: 7859).",
},
7859
)
.field(
"embedPngMetadata",
"boolean",
{
displayName: "Embed Metadata in PNGs",
subtitle:
"Write generation parameters (prompt, model, seed, LoRAs, sources) into saved PNGs as XMP metadata. Compatible with draw-things-index.",
},
true
)
.field(
"usePromptUpsampling",
"boolean",
{
displayName: "Use Prompt Upsampling",
subtitle:
"Rewrites the prompt with a prompt upsampling model before rendering, for models that support it. OFF: the prompt goes to Draw Things unchanged.",
},
true
)
.field(
"promptUpsamplingApiBaseUrl",
"string",
{
displayName: "Prompt Upsampling API base-URL",
subtitle:
"LM Studio server that provides the prompt upsampling model. Default: http://127.0.0.1:1234/v1",
placeholder: "http://127.0.0.1:1234/v1",
},
"http://127.0.0.1:1234/v1"
)
.field(
"promptUpsamplingApiKey",
"string",
{
displayName: "(Optional) Prompt Upsampling API Key",
subtitle: "Only needed if that server requires authentication.",
isProtected: true,
placeholder: "sk-...",
},
""
)
.field(
"customConfigsPath",
"string",
{
displayName: "Custom Configs Path",
subtitle:
"Path to custom_configs.json from Draw Things. Set to `none` to disable.",
placeholder:
"~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json",
},
"~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json"
)
.field(
"HTTP_SERVER_PORT",
"numeric",
{
displayName: "Local HTTP Server Port",
subtitle:
"Port for serving generated images over localhost (default: 54760).",
engineDoesNotSupport: true,
},
54760
)
.build();
// src/config.ts
// Local globalConfigSchematics for generate-image standalone plugin.
// Does NOT import from core-bundle — only @lmstudio/sdk.
// Key difference from draw-things-chat-core/src/config.ts:
// - PREVIEW_IN_CHAT default = true (inline delivery via tool result)
// - No baseUrl / apiKey / unloadAgentModelDuringRender (orchestrator-only fields)
import { createConfigSchematics } from "@lmstudio/sdk";
export const globalConfigSchematics = createConfigSchematics()
.field(
"PREVIEW_IN_CHAT",
"boolean",
{
displayName: "Previews in Chat",
subtitle:
"When enabled, tool responses include inline image previews. Recommended for local models without vision capability.",
},
true
)
.field(
"DRAW_THINGS_HOST",
"string",
{
displayName: "Draw Things Host",
subtitle: "Hostname or IP of the Draw Things backend server.",
placeholder: "127.0.0.1",
},
"127.0.0.1"
)
.field(
"DRAW_THINGS_HTTP_PORT",
"numeric",
{
displayName: "Draw Things HTTP Port",
subtitle: "HTTP API port (default: 7860).",
},
7860
)
.field(
"DRAW_THINGS_GRPC_PORT",
"numeric",
{
displayName: "Draw Things gRPC Port",
subtitle: "gRPC port (default: 7859).",
},
7859
)
.field(
"embedPngMetadata",
"boolean",
{
displayName: "Embed Metadata in PNGs",
subtitle:
"Write generation parameters (prompt, model, seed, LoRAs, sources) into saved PNGs as XMP metadata. Compatible with draw-things-index.",
},
true
)
.field(
"usePromptUpsampling",
"boolean",
{
displayName: "Use Prompt Upsampling",
subtitle:
"Rewrites the prompt with a prompt upsampling model before rendering, for models that support it. OFF: the prompt goes to Draw Things unchanged.",
},
true
)
.field(
"promptUpsamplingApiBaseUrl",
"string",
{
displayName: "Prompt Upsampling API base-URL",
subtitle:
"LM Studio server that provides the prompt upsampling model. Default: http://127.0.0.1:1234/v1",
placeholder: "http://127.0.0.1:1234/v1",
},
"http://127.0.0.1:1234/v1"
)
.field(
"promptUpsamplingApiKey",
"string",
{
displayName: "(Optional) Prompt Upsampling API Key",
subtitle: "Only needed if that server requires authentication.",
isProtected: true,
placeholder: "sk-...",
},
""
)
.field(
"customConfigsPath",
"string",
{
displayName: "Custom Configs Path",
subtitle:
"Path to custom_configs.json from Draw Things. Set to `none` to disable.",
placeholder:
"~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json",
},
"~/Library/Containers/com.liuliu.draw-things/Data/Documents/Models/custom_configs.json"
)
.field(
"HTTP_SERVER_PORT",
"numeric",
{
displayName: "Local HTTP Server Port",
subtitle:
"Port for serving generated images over localhost (default: 54760).",
engineDoesNotSupport: true,
},
54760
)
.build();