dsh-image-gen 0.8.5 → 0.8.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/README.en.md +436 -418
- package/README.md +436 -418
- package/lib/client.js +689 -103
- package/lib/index.js +533 -102
- package/lib/types/client/conversation-image-revisions.d.ts +4 -1
- package/lib/types/client/conversation-regenerate.d.ts +4 -1
- package/lib/types/client/gallery-store.d.ts +4 -1
- package/lib/types/client/index.d.ts +8 -5
- package/lib/types/client/multi-model-compare.d.ts +8 -1
- package/lib/types/client/output-settings.d.ts +3 -0
- package/lib/types/client/settings-state.d.ts +12 -0
- package/lib/types/client/studio-style.d.ts +1 -1
- package/lib/types/client/watermark-control.d.ts +9 -0
- package/lib/types/config.d.ts +13 -2
- package/lib/types/dashscope.d.ts +1 -0
- package/lib/types/openai-compatible.d.ts +2 -1
- package/lib/types/openai-output.d.ts +12 -0
- package/lib/types/settings-health.d.ts +6 -0
- package/lib/types/shared.d.ts +26 -0
- package/lib/types/subscription/vendors/antigravity.d.ts +18 -8
- package/lib/types/watermark.d.ts +20 -0
- package/package.json +139 -139
- package/skills/install-dsh-image-gen/SKILL.md +22 -22
- package/README.zh-CN.md +0 -3
package/lib/client.js
CHANGED
|
@@ -72,6 +72,27 @@ window.__ModuleLoader__.load({
|
|
|
72
72
|
}
|
|
73
73
|
if (typeof CSS !== "undefined") ensureCssSupports(CSS);
|
|
74
74
|
//#endregion
|
|
75
|
+
//#region lib/types/watermark.js
|
|
76
|
+
/** Model names alone do not establish the protocol of an unknown relay. */
|
|
77
|
+
function officialContract(config, mode) {
|
|
78
|
+
const model = (mode === "generate" ? config.openaiCompatExtraBody : config.openaiCompatEditExtra)?.model ?? config.openaiCompatModel;
|
|
79
|
+
if (typeof model !== "string") return void 0;
|
|
80
|
+
try {
|
|
81
|
+
const url = new URL(config.openaiCompatBaseURL ?? "");
|
|
82
|
+
if (url.protocol !== "https:" || url.port || url.search || url.hash) return void 0;
|
|
83
|
+
const path = url.pathname.replace(/\/+$/, "");
|
|
84
|
+
if (url.hostname === "token.sensenova.cn" && path === "/v1" && model === "sensenova-u1.5-lite") return "sensenova";
|
|
85
|
+
if (/^[a-z0-9-]+\.(?:cn-beijing|ap-southeast-1|us-east-1|eu-central-1|ap-northeast-1|cn-hongkong)\.maas\.aliyuncs\.com$/.test(url.hostname) && path === "/compatible-mode/v1" && /^qwen-image-(?:3\.0(?:-pro)?|2\.1-(?:pro|turbo))$/.test(model)) return "qwen";
|
|
86
|
+
} catch {}
|
|
87
|
+
}
|
|
88
|
+
/** Known official edit contracts take precedence over relay-specific format settings. */
|
|
89
|
+
function compatEditFormat(config) {
|
|
90
|
+
const contract = officialContract(config, "edit");
|
|
91
|
+
if (contract === "sensenova") return "jsonImageUrlArray";
|
|
92
|
+
if (contract === "qwen") return "qwenJson";
|
|
93
|
+
return config.openaiCompatEditFormat ?? "multipart";
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
75
96
|
//#region lib/types/shared.js
|
|
76
97
|
/** Browser route used by the generated-image card. */
|
|
77
98
|
const IMAGE_ROUTE = "/plugins/dsh-image-gen/image";
|
|
@@ -87,6 +108,8 @@ window.__ModuleLoader__.load({
|
|
|
87
108
|
const SAVE_WORKSPACE_ROUTE = "/plugins/dsh-image-gen/save-workspace";
|
|
88
109
|
/** Browser route the settings card probes provider connectivity through. */
|
|
89
110
|
const TEST_CONNECTION_ROUTE = "/plugins/dsh-image-gen/test";
|
|
111
|
+
/** Non-secret settings capability probe, available even when the host cannot serve a form. */
|
|
112
|
+
const SETTINGS_HEALTH_ROUTE = "/plugins/dsh-image-gen/settings-health";
|
|
90
113
|
/** Browser route the workbench infinite canvas pushes live state through. */
|
|
91
114
|
const CANVAS_STATE_ROUTE = "/plugins/dsh-image-gen/canvas-state";
|
|
92
115
|
/** Upload a selected canvas original to the host attachment store. */
|
|
@@ -153,6 +176,17 @@ window.__ModuleLoader__.load({
|
|
|
153
176
|
function cloudCredentialRef(provider) {
|
|
154
177
|
return CLOUD_IMAGE_PROVIDERS.includes(provider) ? CLOUD_CREDENTIAL_REFS[provider] : void 0;
|
|
155
178
|
}
|
|
179
|
+
const STUDIO_WATERMARK_VALUES = [
|
|
180
|
+
"default",
|
|
181
|
+
"off",
|
|
182
|
+
"on"
|
|
183
|
+
];
|
|
184
|
+
function studioWatermarkCapability(profile, mode) {
|
|
185
|
+
return profile?.watermarkCapabilities?.[mode] ?? (mode === "generate" && profile?.watermarkOptions?.length ? { status: "supported" } : {
|
|
186
|
+
status: "unknown",
|
|
187
|
+
reason: "channel-unconfirmed"
|
|
188
|
+
});
|
|
189
|
+
}
|
|
156
190
|
/** Default endpoints and base URLs. */
|
|
157
191
|
const DEFAULT_GOOGLE_ENDPOINT = "https://generativelanguage.googleapis.com/v1beta/interactions";
|
|
158
192
|
const DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
|
|
@@ -246,6 +280,38 @@ window.__ModuleLoader__.load({
|
|
|
246
280
|
"google-sub": ""
|
|
247
281
|
};
|
|
248
282
|
//#endregion
|
|
283
|
+
//#region lib/types/client/settings-state.js
|
|
284
|
+
/** Preserve modern form states while accepting legacy scopes without status/mode. */
|
|
285
|
+
function settingsState(snapshot, health) {
|
|
286
|
+
if (snapshot.mode === "memory") return "remote";
|
|
287
|
+
if (health?.settings === "live" && !health.liveSchema) return "incompatible";
|
|
288
|
+
if (snapshot.status === "loading") return "loading";
|
|
289
|
+
if (snapshot.status === "unavailable") return "unavailable";
|
|
290
|
+
return snapshot.writable ? "ready" : "readOnly";
|
|
291
|
+
}
|
|
292
|
+
/** A failed probe cannot identify the cause; keep the host's own form state. */
|
|
293
|
+
async function fetchSettingsHealth(signal) {
|
|
294
|
+
try {
|
|
295
|
+
const response = await fetch(SETTINGS_HEALTH_ROUTE, {
|
|
296
|
+
cache: "no-store",
|
|
297
|
+
signal
|
|
298
|
+
});
|
|
299
|
+
if (!response.ok) return void 0;
|
|
300
|
+
const health = await response.json();
|
|
301
|
+
if (health === null || typeof health.liveSchema !== "boolean" || ![
|
|
302
|
+
"live",
|
|
303
|
+
"legacy",
|
|
304
|
+
"unavailable"
|
|
305
|
+
].includes(health.settings ?? "")) return void 0;
|
|
306
|
+
return {
|
|
307
|
+
settings: health.settings,
|
|
308
|
+
liveSchema: health.liveSchema
|
|
309
|
+
};
|
|
310
|
+
} catch {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
//#endregion
|
|
249
315
|
//#region lib/types/comfyui-workflow.js
|
|
250
316
|
/** Pure ComfyUI API-workflow validation and placeholder injection. */
|
|
251
317
|
const COMFYUI_PROMPT_PLACEHOLDER = "{{prompt}}";
|
|
@@ -1957,21 +2023,119 @@ window.__ModuleLoader__.load({
|
|
|
1957
2023
|
], { type: "application/zip" });
|
|
1958
2024
|
}
|
|
1959
2025
|
//#endregion
|
|
2026
|
+
//#region lib/types/openai-output.js
|
|
2027
|
+
const PROVIDER_DEFAULT_QUALITY = "__default__";
|
|
2028
|
+
const DEFAULT_COMPAT_QUALITIES = [
|
|
2029
|
+
"auto",
|
|
2030
|
+
"low",
|
|
2031
|
+
"medium",
|
|
2032
|
+
"high"
|
|
2033
|
+
];
|
|
2034
|
+
const LEGACY_SIZES = [
|
|
2035
|
+
"1024x1024",
|
|
2036
|
+
"1536x1024",
|
|
2037
|
+
"1024x1536"
|
|
2038
|
+
];
|
|
2039
|
+
const OPENAI_SIZES = {
|
|
2040
|
+
"1:1": {
|
|
2041
|
+
"1K": "1024x1024",
|
|
2042
|
+
"2K": "2048x2048"
|
|
2043
|
+
},
|
|
2044
|
+
"3:2": {
|
|
2045
|
+
"1K": "1536x1024",
|
|
2046
|
+
"2K": "2304x1536"
|
|
2047
|
+
},
|
|
2048
|
+
"2:3": {
|
|
2049
|
+
"1K": "1024x1536",
|
|
2050
|
+
"2K": "1536x2304"
|
|
2051
|
+
},
|
|
2052
|
+
"4:3": {
|
|
2053
|
+
"1K": "1152x864",
|
|
2054
|
+
"2K": "2048x1536"
|
|
2055
|
+
},
|
|
2056
|
+
"3:4": {
|
|
2057
|
+
"1K": "864x1152",
|
|
2058
|
+
"2K": "1536x2048"
|
|
2059
|
+
},
|
|
2060
|
+
"16:9": {
|
|
2061
|
+
"1K": "1536x864",
|
|
2062
|
+
"2K": "2048x1152",
|
|
2063
|
+
"4K": "3840x2160"
|
|
2064
|
+
},
|
|
2065
|
+
"9:16": {
|
|
2066
|
+
"1K": "864x1536",
|
|
2067
|
+
"2K": "1152x2048",
|
|
2068
|
+
"4K": "2160x3840"
|
|
2069
|
+
}
|
|
2070
|
+
};
|
|
2071
|
+
function flexibleSizeModel(model) {
|
|
2072
|
+
return /^gpt-image-2(?:$|[-.])/.test(model);
|
|
2073
|
+
}
|
|
2074
|
+
function officialSizeTable(config, model) {
|
|
2075
|
+
if (config.openaiSizes && Object.keys(config.openaiSizes).length > 0) return config.openaiSizes;
|
|
2076
|
+
if (flexibleSizeModel(model)) return OPENAI_SIZES;
|
|
2077
|
+
return {
|
|
2078
|
+
"1:1": { "1K": LEGACY_SIZES[0] },
|
|
2079
|
+
"3:2": { "1K": LEGACY_SIZES[1] },
|
|
2080
|
+
"2:3": { "1K": LEGACY_SIZES[2] }
|
|
2081
|
+
};
|
|
2082
|
+
}
|
|
2083
|
+
/** Check the official model contract before spending a request. Relays own their size contract. */
|
|
2084
|
+
function validateOfficialSize(model, size) {
|
|
2085
|
+
if (size === "auto") return;
|
|
2086
|
+
if (!flexibleSizeModel(model)) {
|
|
2087
|
+
if (!LEGACY_SIZES.includes(size)) throw new Error(`模型 ${model} 不支持尺寸 ${size};请使用 1024x1024、1536x1024 或 1024x1536`);
|
|
2088
|
+
return;
|
|
2089
|
+
}
|
|
2090
|
+
const match = /^(\d+)x(\d+)$/.exec(size);
|
|
2091
|
+
const width = Number(match?.[1]);
|
|
2092
|
+
const height = Number(match?.[2]);
|
|
2093
|
+
const pixels = width * height;
|
|
2094
|
+
if (!match || width % 16 !== 0 || height % 16 !== 0 || Math.max(width, height) > 3840 || pixels < 655360 || pixels > 8294400 || Math.max(width, height) > 3 * Math.min(width, height)) throw new Error(`OpenAI 尺寸 ${size} 无效:边长须为 16 的倍数且不超过 3840,比例在 1:3 到 3:1,像素数在 655360 到 8294400`);
|
|
2095
|
+
}
|
|
2096
|
+
//#endregion
|
|
1960
2097
|
//#region lib/types/client/multi-model-compare.js
|
|
1961
2098
|
/** Map one shared output intent to settings accepted by every target model. */
|
|
1962
|
-
function buildComparisonTargets(profiles, selectedProviders, ratio, quality) {
|
|
2099
|
+
function buildComparisonTargets(profiles, selectedProviders, ratio, quality, output) {
|
|
1963
2100
|
const selected = new Set(selectedProviders);
|
|
1964
2101
|
return profiles.filter((profile) => profile.configured && selected.has(profile.provider)).map((profile) => {
|
|
1965
2102
|
const targetRatio = profile.ratioOptions.some((option) => option.value === ratio) ? ratio : profile.defaultRatio;
|
|
1966
|
-
const
|
|
2103
|
+
const generationOptions = generationQualityOptions(profile);
|
|
2104
|
+
const qualityIntent = output === void 0 ? quality : profile.provider === "openai" || profile.provider === "chatgpt-sub" || profile.provider === "zhipu" ? output.generationQuality : output.resolution;
|
|
2105
|
+
const targetQuality = profile.qualityOptions.some((option) => option.value === qualityIntent) ? qualityIntent : profile.defaultQuality;
|
|
2106
|
+
const resolutions = profile.resolutionOptions?.[targetRatio];
|
|
2107
|
+
const targetResolution = output && resolutions ? resolutions.some((option) => option.value === output.resolution) ? output.resolution : resolutions[0]?.value : void 0;
|
|
2108
|
+
const targetGenerationQuality = output && profile.provider === "openai-compat" ? generationOptions.some((option) => option.value === output.generationQuality) ? output.generationQuality : profile.defaultGenerationQuality ?? "__default__" : void 0;
|
|
1967
2109
|
return {
|
|
1968
2110
|
profile,
|
|
1969
2111
|
ratio: targetRatio,
|
|
1970
|
-
quality: targetQuality,
|
|
1971
|
-
adjusted: targetRatio !== ratio || targetQuality !==
|
|
2112
|
+
quality: profile.provider === "openai-compat" ? targetResolution ?? targetQuality : targetQuality,
|
|
2113
|
+
adjusted: targetRatio !== ratio || targetQuality !== qualityIntent || targetResolution !== void 0 && targetResolution !== output?.resolution || targetGenerationQuality !== void 0 && targetGenerationQuality !== output?.generationQuality,
|
|
2114
|
+
...targetResolution === void 0 ? {} : { resolution: targetResolution },
|
|
2115
|
+
...targetGenerationQuality === void 0 ? {} : { generationQuality: targetGenerationQuality }
|
|
1972
2116
|
};
|
|
1973
2117
|
});
|
|
1974
2118
|
}
|
|
2119
|
+
function generationQualityOptions(profile) {
|
|
2120
|
+
return profile.generationQualityOptions ?? ([
|
|
2121
|
+
"openai",
|
|
2122
|
+
"chatgpt-sub",
|
|
2123
|
+
"zhipu"
|
|
2124
|
+
].includes(profile.provider) ? profile.qualityOptions : []);
|
|
2125
|
+
}
|
|
2126
|
+
/** Keep pixel tiers separate from upstream quality values in comparison mode. */
|
|
2127
|
+
function comparisonOutputOptions(profiles, ratio, kind) {
|
|
2128
|
+
const options = /* @__PURE__ */ new Map();
|
|
2129
|
+
for (const profile of profiles) {
|
|
2130
|
+
if (!profile.configured) continue;
|
|
2131
|
+
const entries = kind === "generationQuality" ? generationQualityOptions(profile) : profile.resolutionOptions ? profile.resolutionOptions[ratio] ?? profile.resolutionOptions[profile.defaultRatio] ?? [] : ["chatgpt-sub", "zhipu"].includes(profile.provider) ? [] : profile.qualityOptions;
|
|
2132
|
+
for (const entry of entries) if (!options.has(entry.value)) options.set(entry.value, {
|
|
2133
|
+
value: entry.value,
|
|
2134
|
+
label: entry.value === "__default__" ? entry.label : entry.value
|
|
2135
|
+
});
|
|
2136
|
+
}
|
|
2137
|
+
return [...options.values()];
|
|
2138
|
+
}
|
|
1975
2139
|
/** Start with two models, not every configured API, to avoid surprise spend. */
|
|
1976
2140
|
function initialComparisonProviders(profiles, activeProvider) {
|
|
1977
2141
|
const configured = profiles.filter((profile) => profile.configured);
|
|
@@ -2022,6 +2186,75 @@ window.__ModuleLoader__.load({
|
|
|
2022
2186
|
return [...seen.values()].sort((a, b) => rank(a.value) - rank(b.value));
|
|
2023
2187
|
}
|
|
2024
2188
|
//#endregion
|
|
2189
|
+
//#region lib/types/client/watermark-control.js
|
|
2190
|
+
const REASONS = {
|
|
2191
|
+
"channel-unconfirmed": {
|
|
2192
|
+
zh: "此渠道尚未确认水印支持,可按接口文档配置对应操作的水印字段。",
|
|
2193
|
+
en: "Watermark support is unconfirmed. Configure the matching operation using the channel documentation."
|
|
2194
|
+
},
|
|
2195
|
+
"model-unconfirmed": {
|
|
2196
|
+
zh: "当前模型尚未确认水印支持。",
|
|
2197
|
+
en: "Watermark support is unconfirmed for this model."
|
|
2198
|
+
},
|
|
2199
|
+
"account-unconfirmed": {
|
|
2200
|
+
zh: "此接口的水印参数和账号开通条件尚未确认。",
|
|
2201
|
+
en: "The watermark parameter and account requirements are unconfirmed for this API."
|
|
2202
|
+
},
|
|
2203
|
+
"edit-format": {
|
|
2204
|
+
zh: "当前图生图请求格式不支持已配置的水印字段。",
|
|
2205
|
+
en: "The configured watermark field is unavailable in this editing format."
|
|
2206
|
+
},
|
|
2207
|
+
"no-api-control": {
|
|
2208
|
+
zh: "此接口没有已确认的可见水印开关。",
|
|
2209
|
+
en: "No visible-watermark control has been confirmed for this API."
|
|
2210
|
+
}
|
|
2211
|
+
};
|
|
2212
|
+
/** Keep the control discoverable while clearly distinguishing confirmed and unknown contracts. */
|
|
2213
|
+
const WatermarkControl = ({ capability, value, onChange, lang }) => {
|
|
2214
|
+
const noteId = (0, react.useId)();
|
|
2215
|
+
const supported = capability.status === "supported";
|
|
2216
|
+
const reason = REASONS[capability.reason ?? "channel-unconfirmed"][lang];
|
|
2217
|
+
return (0, react_jsx_runtime.jsxs)("label", {
|
|
2218
|
+
className: "dsh-ig-field-select",
|
|
2219
|
+
children: [
|
|
2220
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
2221
|
+
id: `${noteId}-label`,
|
|
2222
|
+
children: lang === "en" ? "Visible watermark" : "可见水印"
|
|
2223
|
+
}),
|
|
2224
|
+
(0, react_jsx_runtime.jsx)("select", {
|
|
2225
|
+
value: supported ? value : "default",
|
|
2226
|
+
disabled: !supported,
|
|
2227
|
+
"aria-labelledby": `${noteId}-label`,
|
|
2228
|
+
"aria-describedby": supported ? void 0 : noteId,
|
|
2229
|
+
title: supported ? lang === "en" ? "Controls the visible watermark added during generation." : "控制生成图片时添加的可见水印。" : reason,
|
|
2230
|
+
onChange: (event) => onChange(event.target.value),
|
|
2231
|
+
children: supported ? (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
2232
|
+
(0, react_jsx_runtime.jsx)("option", {
|
|
2233
|
+
value: "default",
|
|
2234
|
+
children: lang === "en" ? "Channel default" : "渠道默认"
|
|
2235
|
+
}),
|
|
2236
|
+
(0, react_jsx_runtime.jsx)("option", {
|
|
2237
|
+
value: "off",
|
|
2238
|
+
children: lang === "en" ? "Off" : "关闭"
|
|
2239
|
+
}),
|
|
2240
|
+
(0, react_jsx_runtime.jsx)("option", {
|
|
2241
|
+
value: "on",
|
|
2242
|
+
children: lang === "en" ? "On" : "开启"
|
|
2243
|
+
})
|
|
2244
|
+
] }) : (0, react_jsx_runtime.jsx)("option", {
|
|
2245
|
+
value: "default",
|
|
2246
|
+
children: capability.status === "unknown" ? lang === "en" ? "Support unconfirmed" : "支持未确认" : lang === "en" ? "No confirmed control" : "无已确认开关"
|
|
2247
|
+
})
|
|
2248
|
+
}),
|
|
2249
|
+
!supported ? (0, react_jsx_runtime.jsx)("small", {
|
|
2250
|
+
id: noteId,
|
|
2251
|
+
className: "dsh-ig-inline-note",
|
|
2252
|
+
children: reason
|
|
2253
|
+
}) : null
|
|
2254
|
+
]
|
|
2255
|
+
});
|
|
2256
|
+
};
|
|
2257
|
+
//#endregion
|
|
2025
2258
|
//#region node_modules/.pnpm/@tldraw+utils@5.3.0/node_modules/@tldraw/utils/dist-esm/lib/version.mjs
|
|
2026
2259
|
const TLDRAW_LIBRARY_VERSION_KEY = "__TLDRAW_LIBRARY_VERSIONS__";
|
|
2027
2260
|
function getLibraryVersions() {
|
|
@@ -117147,6 +117380,9 @@ img.ProseMirror-separator {
|
|
|
117147
117380
|
const [model, setModel] = (0, react.useState)("");
|
|
117148
117381
|
const [ratio, setRatio] = (0, react.useState)("1:1");
|
|
117149
117382
|
const [quality, setQuality] = (0, react.useState)("1K");
|
|
117383
|
+
const [resolution, setResolution] = (0, react.useState)("1K");
|
|
117384
|
+
const [generationQuality, setGenerationQuality] = (0, react.useState)(PROVIDER_DEFAULT_QUALITY);
|
|
117385
|
+
const [watermark, setWatermark] = (0, react.useState)("default");
|
|
117150
117386
|
const [prompt, setPrompt] = (0, react.useState)("");
|
|
117151
117387
|
const [references, setReferences] = (0, react.useState)([]);
|
|
117152
117388
|
const [count, setCount] = (0, react.useState)(1);
|
|
@@ -117388,19 +117624,43 @@ img.ProseMirror-separator {
|
|
|
117388
117624
|
const subscriptionSignedInCount = config?.providers.filter((item) => item.configured && isSubscriptionProvider(item.provider)).length ?? 0;
|
|
117389
117625
|
const displayItems = (0, react.useMemo)(() => items.slice(0, visibleLimit), [items, visibleLimit]);
|
|
117390
117626
|
const comparisonProfiles = (0, react.useMemo)(() => (config?.providers ?? []).filter((item) => item.configured && (mode === "generate" || item.supportsEditing)), [config, mode]);
|
|
117391
|
-
const
|
|
117627
|
+
const selectedComparisonProfiles = (0, react.useMemo)(() => comparisonProfiles.filter((profile) => comparisonProviders.includes(profile.provider)), [comparisonProfiles, comparisonProviders]);
|
|
117628
|
+
const comparisonResolutionOpts = (0, react.useMemo)(() => comparisonOutputOptions(selectedComparisonProfiles, ratio, "resolution"), [selectedComparisonProfiles, ratio]);
|
|
117629
|
+
const comparisonGenerationQualityOpts = (0, react.useMemo)(() => localizeQualityOptions(comparisonOutputOptions(selectedComparisonProfiles, ratio, "generationQuality"), lang), [
|
|
117630
|
+
selectedComparisonProfiles,
|
|
117631
|
+
ratio,
|
|
117632
|
+
lang
|
|
117633
|
+
]);
|
|
117634
|
+
const comparisonResolution = comparisonResolutionOpts.some((option) => option.value === resolution) ? resolution : comparisonResolutionOpts[0]?.value ?? "standard";
|
|
117635
|
+
const comparisonGenerationQuality = comparisonGenerationQualityOpts.some((option) => option.value === generationQuality) ? generationQuality : comparisonGenerationQualityOpts[0]?.value ?? "__default__";
|
|
117636
|
+
const comparisonTargets = (0, react.useMemo)(() => buildComparisonTargets(comparisonProfiles, comparisonProviders, ratio, quality, {
|
|
117637
|
+
resolution: comparisonResolution,
|
|
117638
|
+
generationQuality: comparisonGenerationQuality
|
|
117639
|
+
}), [
|
|
117392
117640
|
comparisonProfiles,
|
|
117393
117641
|
comparisonProviders,
|
|
117394
117642
|
ratio,
|
|
117395
|
-
quality
|
|
117643
|
+
quality,
|
|
117644
|
+
comparisonResolution,
|
|
117645
|
+
comparisonGenerationQuality
|
|
117396
117646
|
]);
|
|
117647
|
+
const resolutionOpts = provider === "openai" ? activeProfile?.resolutionOptions?.[ratio] ?? [] : [];
|
|
117648
|
+
const singleQualityOpts = provider === "openai-compat" ? activeProfile?.resolutionOptions?.[ratio] ?? activeProfile?.qualityOptions ?? [] : activeProfile?.qualityOptions ?? [];
|
|
117649
|
+
const selectedQuality = singleQualityOpts.some((option) => option.value === quality) ? quality : singleQualityOpts[0]?.value ?? quality;
|
|
117650
|
+
const selectedResolution = resolutionOpts.some((option) => option.value === resolution) ? resolution : resolutionOpts[0]?.value;
|
|
117651
|
+
const selectedGenerationQuality = activeProfile?.generationQualityOptions?.some((option) => option.value === generationQuality) ? generationQuality : activeProfile?.defaultGenerationQuality ?? "__default__";
|
|
117652
|
+
const watermarkCapability = studioWatermarkCapability(activeProfile, mode);
|
|
117653
|
+
const comparisonWatermarkCapabilities = selectedComparisonProfiles.map((profile) => studioWatermarkCapability(profile, mode));
|
|
117654
|
+
const comparisonWatermarkCapability = comparisonWatermarkCapabilities.find((capability) => capability.status === "supported") ?? comparisonWatermarkCapabilities.find((capability) => capability.status === "unknown") ?? studioWatermarkCapability(selectedComparisonProfiles[0], mode);
|
|
117397
117655
|
const comparisonRatioOpts = (0, react.useMemo)(() => localizeRatioOptions(comparisonOptionUnion(comparisonProfiles, "ratioOptions"), lang), [comparisonProfiles, lang]);
|
|
117398
|
-
const comparisonQualityOpts = (0, react.useMemo)(() => localizeQualityOptions(comparisonOptionUnion(comparisonProfiles, "qualityOptions"), lang), [comparisonProfiles, lang]);
|
|
117399
117656
|
const applyProvider = (profile) => {
|
|
117400
117657
|
setProvider(profile.provider);
|
|
117401
117658
|
setModel(profile.model);
|
|
117402
117659
|
setRatio(profile.defaultRatio);
|
|
117403
117660
|
setQuality(profile.defaultQuality);
|
|
117661
|
+
setResolution(profile.defaultResolution ?? profile.defaultQuality);
|
|
117662
|
+
setGenerationQuality(profile.defaultGenerationQuality ?? profile.defaultQuality);
|
|
117663
|
+
setWatermark("default");
|
|
117404
117664
|
setError(null);
|
|
117405
117665
|
};
|
|
117406
117666
|
const changeProvider = (value) => {
|
|
@@ -117440,6 +117700,23 @@ img.ProseMirror-separator {
|
|
|
117440
117700
|
setSelected(null);
|
|
117441
117701
|
resetFit();
|
|
117442
117702
|
};
|
|
117703
|
+
const prepareRegeneration = (item) => {
|
|
117704
|
+
setMode("generate");
|
|
117705
|
+
setComparisonEnabled(false);
|
|
117706
|
+
setPrompt(item.prompt);
|
|
117707
|
+
const profile = config?.providers.find((entry) => entry.provider === item.provider);
|
|
117708
|
+
if (!profile) return;
|
|
117709
|
+
applyProvider(profile);
|
|
117710
|
+
const nextRatio = profile.ratioOptions.some((option) => option.value === item.aspectRatio) ? item.aspectRatio : profile.defaultRatio;
|
|
117711
|
+
setRatio(nextRatio);
|
|
117712
|
+
if (profile.qualityOptions.some((option) => option.value === item.imageSize)) {
|
|
117713
|
+
setQuality(item.imageSize);
|
|
117714
|
+
if (profile.provider === "openai") setGenerationQuality(item.imageSize);
|
|
117715
|
+
}
|
|
117716
|
+
if (profile.resolutionOptions?.[nextRatio]?.some((option) => option.value === item.resolution)) setResolution(item.resolution);
|
|
117717
|
+
if (profile.generationQualityOptions?.some((option) => option.value === item.generationQuality)) setGenerationQuality(item.generationQuality);
|
|
117718
|
+
if (item.watermark && studioWatermarkCapability(profile, "generate").status === "supported") setWatermark(item.watermark);
|
|
117719
|
+
};
|
|
117443
117720
|
const handleCanvasMouseDown = (e) => {
|
|
117444
117721
|
if (e.button !== 0 && e.button !== 1) return;
|
|
117445
117722
|
if (selected === null && (!currentBatch || currentBatch.length === 0)) return;
|
|
@@ -117689,6 +117966,9 @@ img.ProseMirror-separator {
|
|
|
117689
117966
|
prompt: prompt.trim(),
|
|
117690
117967
|
ratio: target.ratio,
|
|
117691
117968
|
quality: target.quality,
|
|
117969
|
+
...target.resolution === void 0 ? {} : { resolution: target.resolution },
|
|
117970
|
+
...target.generationQuality === void 0 ? {} : { generationQuality: target.generationQuality },
|
|
117971
|
+
...studioWatermarkCapability(target.profile, mode).status === "supported" ? { watermark } : {},
|
|
117692
117972
|
...workspace?.path ? { workspaceRoot: workspace.path } : {},
|
|
117693
117973
|
...referencesPayload === void 0 ? {} : { references: referencesPayload }
|
|
117694
117974
|
})
|
|
@@ -117716,6 +117996,9 @@ img.ProseMirror-separator {
|
|
|
117716
117996
|
createdAt: value.payload.createdAt + idx,
|
|
117717
117997
|
aspectRatio: value.target.ratio,
|
|
117718
117998
|
imageSize: value.target.quality,
|
|
117999
|
+
resolution: value.target.resolution,
|
|
118000
|
+
generationQuality: value.target.generationQuality,
|
|
118001
|
+
watermark: studioWatermarkCapability(value.target.profile, mode).status === "supported" ? watermark : void 0,
|
|
117719
118002
|
output: value.payload.output,
|
|
117720
118003
|
...value.payload.savedTo ? { savedTo: value.payload.savedTo } : {},
|
|
117721
118004
|
...workspace?.path ? { workspacePath: workspace.path } : {},
|
|
@@ -117751,7 +118034,10 @@ img.ProseMirror-separator {
|
|
|
117751
118034
|
model,
|
|
117752
118035
|
prompt: prompt.trim(),
|
|
117753
118036
|
ratio,
|
|
117754
|
-
quality,
|
|
118037
|
+
quality: selectedQuality,
|
|
118038
|
+
...selectedResolution === void 0 ? {} : { resolution: selectedResolution },
|
|
118039
|
+
...provider === "openai-compat" ? { generationQuality: selectedGenerationQuality } : {},
|
|
118040
|
+
...watermarkCapability.status === "supported" ? { watermark } : {},
|
|
117755
118041
|
...count > 1 ? { count } : {},
|
|
117756
118042
|
...workspace?.path ? { workspaceRoot: workspace.path } : {},
|
|
117757
118043
|
...referencesPayload === void 0 ? {} : { references: referencesPayload }
|
|
@@ -117772,7 +118058,10 @@ img.ProseMirror-separator {
|
|
|
117772
118058
|
model: payload.model,
|
|
117773
118059
|
createdAt: payload.createdAt + idx,
|
|
117774
118060
|
aspectRatio: ratio,
|
|
117775
|
-
imageSize:
|
|
118061
|
+
imageSize: selectedQuality,
|
|
118062
|
+
resolution: selectedResolution,
|
|
118063
|
+
generationQuality: provider === "openai-compat" ? selectedGenerationQuality : void 0,
|
|
118064
|
+
watermark: watermarkCapability.status === "supported" ? watermark : void 0,
|
|
117776
118065
|
output: gen.output,
|
|
117777
118066
|
...gen.savedTo ? { savedTo: gen.savedTo } : {},
|
|
117778
118067
|
...workspace?.path ? { workspacePath: workspace.path } : {},
|
|
@@ -118503,10 +118792,7 @@ img.ProseMirror-separator {
|
|
|
118503
118792
|
children: [(0, react_jsx_runtime.jsx)(PencilLine, { size: 15 }), t("continueEdit")]
|
|
118504
118793
|
}), (0, react_jsx_runtime.jsxs)("button", {
|
|
118505
118794
|
type: "button",
|
|
118506
|
-
onClick: () =>
|
|
118507
|
-
setMode("generate");
|
|
118508
|
-
setPrompt(selected.prompt);
|
|
118509
|
-
},
|
|
118795
|
+
onClick: () => prepareRegeneration(selected),
|
|
118510
118796
|
children: [(0, react_jsx_runtime.jsx)(RefreshCw, { size: 15 }), t("regenerate")]
|
|
118511
118797
|
})] })]
|
|
118512
118798
|
}),
|
|
@@ -118770,12 +119056,12 @@ img.ProseMirror-separator {
|
|
|
118770
119056
|
}),
|
|
118771
119057
|
target && (0, react_jsx_runtime.jsxs)("span", {
|
|
118772
119058
|
className: "dsh-ig-model-settings",
|
|
118773
|
-
children: [
|
|
119059
|
+
children: [[
|
|
118774
119060
|
target.ratio,
|
|
118775
|
-
|
|
118776
|
-
target.quality,
|
|
118777
|
-
target.
|
|
118778
|
-
]
|
|
119061
|
+
target.resolution,
|
|
119062
|
+
target.quality === target.resolution ? void 0 : target.quality,
|
|
119063
|
+
target.generationQuality === "__default__" ? void 0 : target.generationQuality
|
|
119064
|
+
].filter(Boolean).join(" · "), target.adjusted ? (0, react_jsx_runtime.jsx)("em", { children: t("compareAdjusted") }) : null]
|
|
118779
119065
|
})
|
|
118780
119066
|
]
|
|
118781
119067
|
}, item.provider);
|
|
@@ -118785,19 +119071,38 @@ img.ProseMirror-separator {
|
|
|
118785
119071
|
]
|
|
118786
119072
|
}),
|
|
118787
119073
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
118788
|
-
className: "dsh-ig-field-grid",
|
|
118789
|
-
children: [
|
|
118790
|
-
|
|
118791
|
-
|
|
118792
|
-
|
|
118793
|
-
|
|
118794
|
-
|
|
118795
|
-
|
|
118796
|
-
|
|
118797
|
-
|
|
118798
|
-
|
|
118799
|
-
|
|
119074
|
+
className: "dsh-ig-field-grid is-output-grid",
|
|
119075
|
+
children: [
|
|
119076
|
+
(0, react_jsx_runtime.jsx)(FieldSelect, {
|
|
119077
|
+
label: t("ratio"),
|
|
119078
|
+
value: ratio,
|
|
119079
|
+
onChange: setRatio,
|
|
119080
|
+
options: comparisonRatioOpts
|
|
119081
|
+
}),
|
|
119082
|
+
comparisonResolutionOpts.length > 0 ? (0, react_jsx_runtime.jsx)(FieldSelect, {
|
|
119083
|
+
label: lang === "en" ? "Resolution" : "分辨率",
|
|
119084
|
+
value: comparisonResolution,
|
|
119085
|
+
onChange: setResolution,
|
|
119086
|
+
options: comparisonResolutionOpts
|
|
119087
|
+
}) : null,
|
|
119088
|
+
comparisonGenerationQualityOpts.length > 0 ? (0, react_jsx_runtime.jsx)(FieldSelect, {
|
|
119089
|
+
label: lang === "en" ? "Generation quality" : "生成质量",
|
|
119090
|
+
value: comparisonGenerationQuality,
|
|
119091
|
+
onChange: setGenerationQuality,
|
|
119092
|
+
options: comparisonGenerationQualityOpts
|
|
119093
|
+
}) : null,
|
|
119094
|
+
(0, react_jsx_runtime.jsx)(WatermarkControl, {
|
|
119095
|
+
capability: comparisonWatermarkCapability,
|
|
119096
|
+
value: watermark,
|
|
119097
|
+
onChange: setWatermark,
|
|
119098
|
+
lang
|
|
119099
|
+
})
|
|
119100
|
+
]
|
|
118800
119101
|
}),
|
|
119102
|
+
comparisonWatermarkCapability.status === "supported" ? (0, react_jsx_runtime.jsx)("div", {
|
|
119103
|
+
className: "dsh-ig-inline-note",
|
|
119104
|
+
children: lang === "en" ? "Watermark applies only to models with confirmed support for this operation." : "水印选项仅用于已确认支持当前操作的模型。"
|
|
119105
|
+
}) : null,
|
|
118801
119106
|
comparisonTargets.some((target) => target.profile.provider === "chatgpt-sub") && (0, react_jsx_runtime.jsx)("div", {
|
|
118802
119107
|
className: "dsh-ig-inline-note",
|
|
118803
119108
|
children: t("subscriptionParameterHint")
|
|
@@ -118824,18 +119129,47 @@ img.ProseMirror-separator {
|
|
|
118824
119129
|
})]
|
|
118825
119130
|
}),
|
|
118826
119131
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
118827
|
-
className: "dsh-ig-field-grid",
|
|
118828
|
-
children: [
|
|
118829
|
-
|
|
118830
|
-
|
|
118831
|
-
|
|
118832
|
-
|
|
118833
|
-
|
|
118834
|
-
|
|
118835
|
-
|
|
118836
|
-
|
|
118837
|
-
|
|
118838
|
-
|
|
119132
|
+
className: "dsh-ig-field-grid is-output-grid",
|
|
119133
|
+
children: [
|
|
119134
|
+
(0, react_jsx_runtime.jsx)(FieldSelect, {
|
|
119135
|
+
label: t("ratio"),
|
|
119136
|
+
value: ratio,
|
|
119137
|
+
onChange: setRatio,
|
|
119138
|
+
options: localizeRatioOptions(activeProfile?.ratioOptions ?? [], lang)
|
|
119139
|
+
}),
|
|
119140
|
+
resolutionOpts.length > 0 ? (0, react_jsx_runtime.jsx)(FieldSelect, {
|
|
119141
|
+
label: lang === "en" ? "Resolution" : "分辨率",
|
|
119142
|
+
value: selectedResolution ?? "",
|
|
119143
|
+
onChange: setResolution,
|
|
119144
|
+
options: resolutionOpts
|
|
119145
|
+
}) : null,
|
|
119146
|
+
(0, react_jsx_runtime.jsx)(FieldSelect, {
|
|
119147
|
+
label: [
|
|
119148
|
+
"openai",
|
|
119149
|
+
"chatgpt-sub",
|
|
119150
|
+
"zhipu"
|
|
119151
|
+
].includes(provider) ? lang === "en" ? "Generation quality" : "生成质量" : lang === "en" ? "Resolution" : "分辨率",
|
|
119152
|
+
value: selectedQuality,
|
|
119153
|
+
onChange: (value) => {
|
|
119154
|
+
setQuality(value);
|
|
119155
|
+
if (provider === "openai") setGenerationQuality(value);
|
|
119156
|
+
else setResolution(value);
|
|
119157
|
+
},
|
|
119158
|
+
options: provider === "openai-compat" ? singleQualityOpts : localizeQualityOptions(singleQualityOpts, lang)
|
|
119159
|
+
}),
|
|
119160
|
+
activeProfile?.generationQualityOptions ? (0, react_jsx_runtime.jsx)(FieldSelect, {
|
|
119161
|
+
label: lang === "en" ? "Generation quality" : "生成质量",
|
|
119162
|
+
value: selectedGenerationQuality,
|
|
119163
|
+
onChange: setGenerationQuality,
|
|
119164
|
+
options: localizeQualityOptions(activeProfile.generationQualityOptions, lang)
|
|
119165
|
+
}) : null,
|
|
119166
|
+
(0, react_jsx_runtime.jsx)(WatermarkControl, {
|
|
119167
|
+
capability: watermarkCapability,
|
|
119168
|
+
value: watermark,
|
|
119169
|
+
onChange: setWatermark,
|
|
119170
|
+
lang
|
|
119171
|
+
})
|
|
119172
|
+
]
|
|
118839
119173
|
}),
|
|
118840
119174
|
provider === "chatgpt-sub" && (0, react_jsx_runtime.jsx)("div", {
|
|
118841
119175
|
className: "dsh-ig-inline-note",
|
|
@@ -119265,7 +119599,7 @@ img.ProseMirror-separator {
|
|
|
119265
119599
|
function localizeQualityOptions(options, lang) {
|
|
119266
119600
|
return options.map((opt) => ({
|
|
119267
119601
|
value: opt.value,
|
|
119268
|
-
label: LOCALIZED_QUALITIES[opt.value]?.[lang] ?? opt.label
|
|
119602
|
+
label: opt.value === "__default__" ? lang === "en" ? "Provider default (omit)" : "渠道默认(不发送)" : LOCALIZED_QUALITIES[opt.value]?.[lang] ?? opt.label
|
|
119269
119603
|
}));
|
|
119270
119604
|
}
|
|
119271
119605
|
const RecentItem = ({ item, active, onClick }) => {
|
|
@@ -121778,17 +122112,20 @@ img.ProseMirror-separator {
|
|
|
121778
122112
|
function conversationRegenerateRequest(image, prompt, remembered) {
|
|
121779
122113
|
if (!CLOUD_IMAGE_PROVIDERS.includes(image.provider)) throw new Error("当前图片使用的 Provider 暂不支持重新生成");
|
|
121780
122114
|
const provider = image.provider;
|
|
121781
|
-
const settings = remembered ?? outputSettings(provider, image.output);
|
|
122115
|
+
const settings = remembered ?? outputSettings(provider, image.output, image.model);
|
|
121782
122116
|
return {
|
|
121783
122117
|
mode: "generate",
|
|
121784
122118
|
provider,
|
|
121785
122119
|
model: image.model,
|
|
121786
122120
|
prompt: prompt.trim(),
|
|
121787
122121
|
ratio: settings.ratio,
|
|
121788
|
-
quality: settings.quality
|
|
122122
|
+
quality: settings.quality,
|
|
122123
|
+
...settings.resolution === void 0 ? {} : { resolution: settings.resolution },
|
|
122124
|
+
...settings.generationQuality === void 0 ? {} : { generationQuality: settings.generationQuality },
|
|
122125
|
+
...settings.watermark === void 0 ? {} : { watermark: settings.watermark }
|
|
121789
122126
|
};
|
|
121790
122127
|
}
|
|
121791
|
-
function outputSettings(provider, output) {
|
|
122128
|
+
function outputSettings(provider, output, model = "") {
|
|
121792
122129
|
const normalized = (output ?? "").trim();
|
|
121793
122130
|
if (provider === "google") {
|
|
121794
122131
|
const [rawRatio, rawQuality] = normalized.split(",").map((value) => value.trim());
|
|
@@ -121801,16 +122138,39 @@ img.ProseMirror-separator {
|
|
|
121801
122138
|
ratio: "auto",
|
|
121802
122139
|
quality: normalized === "1K" || normalized === "4K" ? normalized : "2K"
|
|
121803
122140
|
};
|
|
121804
|
-
if (provider === "openai" || provider === "openai-compat" || provider === "xai" || provider === "zhipu")
|
|
121805
|
-
|
|
121806
|
-
quality:
|
|
121807
|
-
|
|
122141
|
+
if (provider === "openai" || provider === "openai-compat" || provider === "xai" || provider === "zhipu") {
|
|
122142
|
+
const [size, qualityPart] = normalized.split(",").map((value) => value.trim());
|
|
122143
|
+
const requestedQuality = qualityPart?.startsWith("quality=") ? qualityPart.slice(8) : void 0;
|
|
122144
|
+
const resolution = provider === "openai" ? Object.values(officialSizeTable({}, model)).flatMap((tiers) => Object.entries(tiers)).find(([, pixels]) => pixels === size)?.[0] : void 0;
|
|
122145
|
+
return {
|
|
122146
|
+
ratio: ratioFromSize(size ?? "", "x"),
|
|
122147
|
+
quality: provider === "openai" ? requestedQuality ?? "auto" : "standard",
|
|
122148
|
+
...resolution === void 0 ? {} : { resolution },
|
|
122149
|
+
...provider === "openai-compat" && requestedQuality ? { generationQuality: requestedQuality } : {}
|
|
122150
|
+
};
|
|
122151
|
+
}
|
|
121808
122152
|
return {
|
|
121809
122153
|
ratio: ratioFromSize(normalized, "*"),
|
|
121810
122154
|
quality: "standard"
|
|
121811
122155
|
};
|
|
121812
122156
|
}
|
|
121813
122157
|
function ratioFromSize(size, separator) {
|
|
122158
|
+
const dimensions = size.split(separator).map(Number);
|
|
122159
|
+
if (dimensions.length === 2 && dimensions.every((value) => Number.isFinite(value) && value > 0)) {
|
|
122160
|
+
const target = dimensions[0] / dimensions[1];
|
|
122161
|
+
for (const ratio of [
|
|
122162
|
+
"1:1",
|
|
122163
|
+
"3:2",
|
|
122164
|
+
"2:3",
|
|
122165
|
+
"4:3",
|
|
122166
|
+
"3:4",
|
|
122167
|
+
"16:9",
|
|
122168
|
+
"9:16"
|
|
122169
|
+
]) {
|
|
122170
|
+
const [width, height] = ratio.split(":").map(Number);
|
|
122171
|
+
if (Math.abs(target - width / height) < .015) return ratio;
|
|
122172
|
+
}
|
|
122173
|
+
}
|
|
121814
122174
|
return (separator === "x" ? {
|
|
121815
122175
|
"1024x1024": "1:1",
|
|
121816
122176
|
"1536x1024": "3:2",
|
|
@@ -122486,7 +122846,10 @@ img.ProseMirror-separator {
|
|
|
122486
122846
|
try {
|
|
122487
122847
|
const request = conversationRegenerateRequest(previewItem, regeneratePrompt, previewItem.aspectRatio ? {
|
|
122488
122848
|
ratio: previewItem.aspectRatio,
|
|
122489
|
-
quality: previewItem.imageSize || "standard"
|
|
122849
|
+
quality: previewItem.imageSize || "standard",
|
|
122850
|
+
resolution: previewItem.resolution,
|
|
122851
|
+
generationQuality: previewItem.generationQuality,
|
|
122852
|
+
watermark: previewItem.watermark
|
|
122490
122853
|
} : void 0);
|
|
122491
122854
|
if (activeWorkspace?.path) request.workspaceRoot = activeWorkspace.path;
|
|
122492
122855
|
const response = await fetch(STUDIO_ROUTE, {
|
|
@@ -122507,6 +122870,9 @@ img.ProseMirror-separator {
|
|
|
122507
122870
|
createdAt: payload.createdAt,
|
|
122508
122871
|
aspectRatio: request.ratio,
|
|
122509
122872
|
imageSize: request.quality,
|
|
122873
|
+
resolution: request.resolution,
|
|
122874
|
+
generationQuality: request.generationQuality,
|
|
122875
|
+
watermark: request.watermark,
|
|
122510
122876
|
output: payload.output,
|
|
122511
122877
|
...payload.savedTo ? { savedTo: payload.savedTo } : {},
|
|
122512
122878
|
...activeWorkspace?.path ? { workspacePath: activeWorkspace.path } : {},
|
|
@@ -124036,6 +124402,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
124036
124402
|
.dsh-ig-page-in-sidebar .dsh-ig-workbench-grid.is-sidebar-collapsed{grid-template-columns:minmax(0,1fr) minmax(206px,264px)}
|
|
124037
124403
|
.dsh-ig-page-in-sidebar .dsh-ig-workbench-grid.is-generate-collapsed{grid-template-columns:minmax(150px,190px) minmax(0,1fr)}
|
|
124038
124404
|
.dsh-ig-page-in-sidebar .dsh-ig-workbench-grid.is-sidebar-collapsed.is-generate-collapsed{grid-template-columns:minmax(0,1fr)}
|
|
124405
|
+
.dsh-ig-field-grid.is-output-grid{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}
|
|
124039
124406
|
.dsh-ig-page-in-sidebar .dsh-ig-recent-item{min-width:0}
|
|
124040
124407
|
.dsh-ig-page-in-sidebar .dsh-ig-generate-panel .dsh-ig-field-grid{grid-template-columns:1fr}
|
|
124041
124408
|
.dsh-ig-page-in-sidebar .dsh-ig-tl-canvas{min-height:280px}
|
|
@@ -124332,7 +124699,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
124332
124699
|
function isRevision(value) {
|
|
124333
124700
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
124334
124701
|
const candidate = value;
|
|
124335
|
-
return isAttachment(candidate.attachment) && typeof candidate.provider === "string" && STUDIO_PROVIDERS.includes(candidate.provider) && typeof candidate.prompt === "string" && typeof candidate.model === "string" && typeof candidate.output === "string" && typeof candidate.createdAt === "number" && Number.isFinite(candidate.createdAt) && typeof candidate.ratio === "string" && typeof candidate.quality === "string";
|
|
124702
|
+
return isAttachment(candidate.attachment) && typeof candidate.provider === "string" && STUDIO_PROVIDERS.includes(candidate.provider) && typeof candidate.prompt === "string" && typeof candidate.model === "string" && typeof candidate.output === "string" && typeof candidate.createdAt === "number" && Number.isFinite(candidate.createdAt) && typeof candidate.ratio === "string" && typeof candidate.quality === "string" && (candidate.resolution === void 0 || typeof candidate.resolution === "string") && (candidate.generationQuality === void 0 || typeof candidate.generationQuality === "string") && (candidate.watermark === void 0 || STUDIO_WATERMARK_VALUES.some((value) => value === candidate.watermark));
|
|
124336
124703
|
}
|
|
124337
124704
|
function isAttachment(value) {
|
|
124338
124705
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
@@ -124340,6 +124707,31 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
124340
124707
|
return typeof candidate.attachmentId === "string" && (candidate.mediaType === "image/png" || candidate.mediaType === "image/jpeg" || candidate.mediaType === "image/webp" || candidate.mediaType === "image/gif") && typeof candidate.bytes === "number" && typeof candidate.width === "number" && typeof candidate.height === "number";
|
|
124341
124708
|
}
|
|
124342
124709
|
//#endregion
|
|
124710
|
+
//#region lib/types/client/output-settings.js
|
|
124711
|
+
/** Validate all advanced output fields before the settings form starts writing. */
|
|
124712
|
+
function parseExtraFields(text, message) {
|
|
124713
|
+
if (!text.trim()) return {};
|
|
124714
|
+
let value;
|
|
124715
|
+
try {
|
|
124716
|
+
value = JSON.parse(text);
|
|
124717
|
+
} catch {
|
|
124718
|
+
throw new Error(message);
|
|
124719
|
+
}
|
|
124720
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error(message);
|
|
124721
|
+
return value;
|
|
124722
|
+
}
|
|
124723
|
+
function parseSizeTable(text, message) {
|
|
124724
|
+
const value = parseExtraFields(text, message);
|
|
124725
|
+
const table = {};
|
|
124726
|
+
for (const [ratio, tiers] of Object.entries(value)) {
|
|
124727
|
+
if (!/^\d+(?:\.\d+)?:\d+(?:\.\d+)?$/.test(ratio) || ratio.split(":").some((part) => Number(part) <= 0) || typeof tiers !== "object" || tiers === null || Array.isArray(tiers)) throw new Error(message);
|
|
124728
|
+
const entries = Object.entries(tiers);
|
|
124729
|
+
if (entries.length === 0 || entries.some(([tier, size]) => !/^(\d+(?:\.\d+)?)(K?)$/.test(tier) || Number.parseFloat(tier) <= 0 || typeof size !== "string" || !size.trim())) throw new Error(message);
|
|
124730
|
+
table[ratio] = Object.fromEntries(entries.map(([tier, size]) => [tier, size.trim()]));
|
|
124731
|
+
}
|
|
124732
|
+
return table;
|
|
124733
|
+
}
|
|
124734
|
+
//#endregion
|
|
124343
124735
|
//#region lib/types/client/settings-write.js
|
|
124344
124736
|
/** DSH 0.1.7 resolves refused writes to false; older settings scopes resolve to void. */
|
|
124345
124737
|
async function writeSetting(scope, field, value, rejectedMessage) {
|
|
@@ -124783,7 +125175,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
124783
125175
|
`;
|
|
124784
125176
|
//#endregion
|
|
124785
125177
|
//#region lib/types/client/index.js
|
|
124786
|
-
console.info(`[dsh-image-gen] canvas bundle 2026-
|
|
125178
|
+
console.info(`[dsh-image-gen] canvas bundle 2026-10-11T07:43:39.734Z`);
|
|
124787
125179
|
/** Right-sidebar tab-type registration id (DSH 0.1.5 `sidebarRightTabs`). */
|
|
124788
125180
|
const SIDEBAR_STUDIO_TAB_ID = "dsh-image-gen/studio";
|
|
124789
125181
|
/** The tab kind: a page type opened by kind, recognizing no resource address. */
|
|
@@ -124795,6 +125187,10 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
124795
125187
|
defaultProvider: "默认 Provider",
|
|
124796
125188
|
defaultProviderHint: "Agent 生图默认使用;Studio 与工具调用可临时指定其他 Provider。",
|
|
124797
125189
|
settingsReadOnly: "设置由配置文件提供,只读;如需修改请编辑对应的配置来源。",
|
|
125190
|
+
settingsLoading: "正在加载图像生成设置,请稍候。",
|
|
125191
|
+
settingsRemote: "当前连接不支持保存到宿主,请在 DSH 本机页面修改设置。",
|
|
125192
|
+
settingsUnavailable: "宿主尚未提供图像生成设置,请检查插件是否已启用及其加载日志。",
|
|
125193
|
+
settingsIncompatible: "当前加载的设置库不支持保存。请将插件所在环境的 @deepseek-ai/schemastery 更新到 3.18.4 或兼容的 3.x 版本,并重启 DSH。",
|
|
124798
125194
|
providerGoogle: "Google Gemini",
|
|
124799
125195
|
providerOpenAI: "OpenAI",
|
|
124800
125196
|
providerOpenAICompat: "OpenAI 兼容(中转站)",
|
|
@@ -124858,9 +125254,10 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
124858
125254
|
endpointHintOpenAICompat: "中转站/自建服务的 OpenAI 兼容 /v1 地址(必填),例如 https://your-relay.example.com/v1。",
|
|
124859
125255
|
editFormat: "图生图请求形态",
|
|
124860
125256
|
editFormatMultipart: "标准 multipart(OpenAI 官方)",
|
|
125257
|
+
editFormatAutomatic: "自动:官方接口 JSON 格式",
|
|
124861
125258
|
editFormatJsonImageUrlArray: "JSON images 数组(商汤等中转)",
|
|
124862
125259
|
editFormatFormReferenceImages: "multipart + reference_images JSON 数组(base64)",
|
|
124863
|
-
editFormatHint: "
|
|
125260
|
+
editFormatHint: "商汤、通义已确认的官方接口自动使用对应 JSON 格式;其他中转按接口文档选择。文生图不受影响。",
|
|
124864
125261
|
editExtra: "附加 JSON 字段",
|
|
124865
125262
|
editExtraPlaceholder: "{\"watermark\": false, \"prompt_extend\": true}",
|
|
124866
125263
|
editExtraHint: "仅 JSON 形态生效;会合并到请求体末尾,可覆盖默认字段。留空表示不附加。",
|
|
@@ -124877,6 +125274,17 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
124877
125274
|
arkBackgroundTransparent: "透明",
|
|
124878
125275
|
arkBackgroundHint: "仅图生图有效,且要求参考图本身带透明通道;文生图会被方舟拒绝,因此这一项只在图生图时发出。",
|
|
124879
125276
|
editExtraInvalid: "附加 JSON 字段必须是合法的 JSON 对象。",
|
|
125277
|
+
sizeTable: "自定义分辨率表(JSON)",
|
|
125278
|
+
sizeTableHint: "格式为「比例 → 档位 → 像素尺寸」。留空使用默认尺寸;例如 {\"16:9\":{\"2K\":\"2048x1152\"}}。",
|
|
125279
|
+
sizeTableInvalid: "分辨率表须为「比例 → 数字档位(如 2K)→ 非空尺寸字符串」的 JSON 对象。",
|
|
125280
|
+
defaultQuality: "默认生成质量",
|
|
125281
|
+
defaultQualityHint: "留空不发送 quality。该参数与分辨率独立,上游须支持所填值。",
|
|
125282
|
+
qualityOptions: "可选生成质量(逗号分隔)",
|
|
125283
|
+
generateExtra: "文生图附加字段(JSON)",
|
|
125284
|
+
generateExtraHint: "仅文生图生效,合并到请求体末尾,可覆盖 size 和 quality。关闭商汤水印可填 {\"watermark\":false}。",
|
|
125285
|
+
editSizeMode: "JSON 图生图尺寸",
|
|
125286
|
+
editSizeAuto: "自动(兼容商汤)",
|
|
125287
|
+
editSizeSelected: "使用所选分辨率",
|
|
124880
125288
|
endpointHintSeedream: "火山方舟兼容的 /api/v3 地址。",
|
|
124881
125289
|
endpointHintDashScope: "阿里云百炼 DashScope 官方接口地址。",
|
|
124882
125290
|
endpointHintXAI: "xAI 官方 api.x.ai 的 /v1 地址。",
|
|
@@ -124944,6 +125352,10 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
124944
125352
|
defaultProvider: "Default provider",
|
|
124945
125353
|
defaultProviderHint: "Used by the Agent by default; the Studio and tool calls can switch per call.",
|
|
124946
125354
|
settingsReadOnly: "Settings come from a profile file and are read-only; edit that source to change them.",
|
|
125355
|
+
settingsLoading: "Settings are loading; please wait.",
|
|
125356
|
+
settingsRemote: "This connection cannot save settings to the host. Edit them from the local DSH page.",
|
|
125357
|
+
settingsUnavailable: "The host has not provided image generation settings. Check that the plugin is enabled and review its load logs.",
|
|
125358
|
+
settingsIncompatible: "The loaded settings library cannot save these settings. Update @deepseek-ai/schemastery in the plugin environment to 3.18.4 or a compatible 3.x version, then restart DSH.",
|
|
124947
125359
|
providerGoogle: "Google Gemini",
|
|
124948
125360
|
providerOpenAI: "OpenAI",
|
|
124949
125361
|
providerOpenAICompat: "OpenAI-compatible (relay)",
|
|
@@ -125007,9 +125419,10 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
125007
125419
|
endpointHintOpenAICompat: "OpenAI-compatible /v1 base URL of your relay or self-hosted service (required), e.g. https://your-relay.example.com/v1.",
|
|
125008
125420
|
editFormat: "Edit request format",
|
|
125009
125421
|
editFormatMultipart: "Standard multipart (official OpenAI)",
|
|
125422
|
+
editFormatAutomatic: "Automatic: official JSON contract",
|
|
125010
125423
|
editFormatJsonImageUrlArray: "JSON images array (SenseNova etc.)",
|
|
125011
125424
|
editFormatFormReferenceImages: "Multipart with a reference_images JSON array (base64)",
|
|
125012
|
-
editFormatHint: "
|
|
125425
|
+
editFormatHint: "Recognized official SenseNova and Qwen endpoints automatically use their JSON edit contracts. Choose other relay formats according to their documentation. Text-to-image is unaffected.",
|
|
125013
125426
|
editExtra: "Extra JSON fields",
|
|
125014
125427
|
editExtraPlaceholder: "{\"watermark\": false, \"prompt_extend\": true}",
|
|
125015
125428
|
editExtraHint: "Only used with the JSON format; merged into the request body last and may override defaults. Leave empty for none.",
|
|
@@ -125026,6 +125439,17 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
125026
125439
|
arkBackgroundTransparent: "Transparent",
|
|
125027
125440
|
arkBackgroundHint: "Image-to-image only, and every reference image must already carry an alpha channel; Ark rejects it for text-to-image, so it is sent on edits alone.",
|
|
125028
125441
|
editExtraInvalid: "Extra JSON fields must be a valid JSON object.",
|
|
125442
|
+
sizeTable: "Custom resolution table (JSON)",
|
|
125443
|
+
sizeTableHint: "Aspect ratio → tier → pixel size. Leave empty for defaults; e.g. {\"16:9\":{\"2K\":\"2048x1152\"}}.",
|
|
125444
|
+
sizeTableInvalid: "Use a JSON object mapping ratios to numeric tiers (e.g. 2K) and nonempty size strings.",
|
|
125445
|
+
defaultQuality: "Default generation quality",
|
|
125446
|
+
defaultQualityHint: "Leave empty to omit quality. Independent of resolution; the upstream must support this value.",
|
|
125447
|
+
qualityOptions: "Available generation qualities (comma-separated)",
|
|
125448
|
+
generateExtra: "Generation extra fields (JSON)",
|
|
125449
|
+
generateExtraHint: "Generation only. Merged last; can override size and quality. Use {\"watermark\":false} for SenseNova.",
|
|
125450
|
+
editSizeMode: "JSON edit dimensions",
|
|
125451
|
+
editSizeAuto: "Auto (SenseNova compatible)",
|
|
125452
|
+
editSizeSelected: "Use selected resolution",
|
|
125029
125453
|
endpointHintSeedream: "Volcengine Ark compatible /api/v3 base URL.",
|
|
125030
125454
|
endpointHintDashScope: "Official Aliyun DashScope endpoint.",
|
|
125031
125455
|
endpointHintXAI: "Official xAI api.x.ai /v1 base URL.",
|
|
@@ -125397,7 +125821,8 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
125397
125821
|
return {
|
|
125398
125822
|
getSnapshot: () => ({
|
|
125399
125823
|
value: void 0,
|
|
125400
|
-
writable: false
|
|
125824
|
+
writable: false,
|
|
125825
|
+
status: "unavailable"
|
|
125401
125826
|
}),
|
|
125402
125827
|
subscribe: () => () => {},
|
|
125403
125828
|
set: async () => false
|
|
@@ -125649,6 +126074,11 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
125649
126074
|
timeoutSeconds: DEFAULT_COMFYUI_TIMEOUT_MS / 1e3,
|
|
125650
126075
|
editFormat: "multipart",
|
|
125651
126076
|
editExtraText: "",
|
|
126077
|
+
sizeTableText: "",
|
|
126078
|
+
generationQuality: "",
|
|
126079
|
+
qualityOptionsText: DEFAULT_COMPAT_QUALITIES.join(", "),
|
|
126080
|
+
generateExtraText: "",
|
|
126081
|
+
editSizeMode: "auto",
|
|
125652
126082
|
outputFormat: "jpeg",
|
|
125653
126083
|
watermark: true,
|
|
125654
126084
|
background: "opaque"
|
|
@@ -125716,6 +126146,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
125716
126146
|
...emptyProviderRow(),
|
|
125717
126147
|
model: modelOf(provider, value),
|
|
125718
126148
|
baseURL: baseURLOf(provider, value),
|
|
126149
|
+
...provider === "openai" ? { sizeTableText: editExtraTextOf(value?.openaiSizes) } : {},
|
|
125719
126150
|
...provider === "comfyui" ? {
|
|
125720
126151
|
workflows: resolveComfyUIWorkflows(value ?? {}),
|
|
125721
126152
|
activeWorkflow: activeComfyUIWorkflow(value ?? {})?.name ?? "",
|
|
@@ -125723,7 +126154,12 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
125723
126154
|
} : {},
|
|
125724
126155
|
...provider === "openai-compat" ? {
|
|
125725
126156
|
editFormat: parseEditFormat(value?.openaiCompatEditFormat),
|
|
125726
|
-
editExtraText: editExtraTextOf(value?.openaiCompatEditExtra)
|
|
126157
|
+
editExtraText: editExtraTextOf(value?.openaiCompatEditExtra),
|
|
126158
|
+
sizeTableText: editExtraTextOf(value?.openaiCompatSizes),
|
|
126159
|
+
generationQuality: value?.openaiCompatQuality ?? "",
|
|
126160
|
+
qualityOptionsText: (value?.openaiCompatQualityOptions ?? DEFAULT_COMPAT_QUALITIES).join(", "),
|
|
126161
|
+
generateExtraText: editExtraTextOf(value?.openaiCompatExtraBody),
|
|
126162
|
+
editSizeMode: value?.openaiCompatEditSizeMode === "selected" ? "selected" : "auto"
|
|
125727
126163
|
} : {},
|
|
125728
126164
|
...provider === "seedream" ? {
|
|
125729
126165
|
outputFormat: value?.seedreamOutputFormat === "png" ? "png" : "jpeg",
|
|
@@ -125737,6 +126173,9 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
125737
126173
|
function ImageGenerationSettingsCard(props) {
|
|
125738
126174
|
const [open, setOpen] = (0, react.useState)(false);
|
|
125739
126175
|
const [snapshot, setSnapshot] = (0, react.useState)(() => props.scope.getSnapshot());
|
|
126176
|
+
const [health, setHealth] = (0, react.useState)();
|
|
126177
|
+
const state = settingsState(snapshot, health);
|
|
126178
|
+
const settingsWritable = state === "ready";
|
|
125740
126179
|
const [lang, setLang] = (0, react.useState)(() => props.locale?.getSnapshot?.()?.active?.startsWith("en") ? "en" : "zh");
|
|
125741
126180
|
const [defaultProvider, setDefaultProvider] = (0, react.useState)(() => props.scope.getSnapshot().value?.provider ?? "google");
|
|
125742
126181
|
const [providerMessage, setProviderMessage] = (0, react.useState)("");
|
|
@@ -125758,9 +126197,28 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
125758
126197
|
const [subTick, setSubTick] = (0, react.useState)(0);
|
|
125759
126198
|
const [subBusy, setSubBusy] = (0, react.useState)({});
|
|
125760
126199
|
const [subPending, setSubPending] = (0, react.useState)([]);
|
|
125761
|
-
(0, react.useEffect)(() =>
|
|
125762
|
-
|
|
125763
|
-
|
|
126200
|
+
(0, react.useEffect)(() => {
|
|
126201
|
+
const sync = () => {
|
|
126202
|
+
setSnapshot(props.scope.getSnapshot());
|
|
126203
|
+
};
|
|
126204
|
+
const unsubscribe = props.scope.subscribe(sync);
|
|
126205
|
+
sync();
|
|
126206
|
+
return unsubscribe;
|
|
126207
|
+
}, [props.scope]);
|
|
126208
|
+
(0, react.useEffect)(() => {
|
|
126209
|
+
if (!open || snapshot.mode === "memory") return void 0;
|
|
126210
|
+
const controller = new AbortController();
|
|
126211
|
+
fetchSettingsHealth(controller.signal).then((value) => {
|
|
126212
|
+
if (!controller.signal.aborted) setHealth(value);
|
|
126213
|
+
});
|
|
126214
|
+
return () => {
|
|
126215
|
+
controller.abort();
|
|
126216
|
+
};
|
|
126217
|
+
}, [
|
|
126218
|
+
open,
|
|
126219
|
+
snapshot.status,
|
|
126220
|
+
snapshot.mode
|
|
126221
|
+
]);
|
|
125764
126222
|
(0, react.useEffect)(() => {
|
|
125765
126223
|
return props.locale?.subscribe?.(() => {
|
|
125766
126224
|
setLang(props.locale?.getSnapshot?.()?.active?.startsWith("en") ? "en" : "zh");
|
|
@@ -125912,7 +126370,17 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
125912
126370
|
if (params) for (const [k, v] of Object.entries(params)) text = text.replace(`{${k}}`, v);
|
|
125913
126371
|
return text;
|
|
125914
126372
|
};
|
|
125915
|
-
const
|
|
126373
|
+
const settingsMessage = state === "ready" ? void 0 : t({
|
|
126374
|
+
loading: "settingsLoading",
|
|
126375
|
+
remote: "settingsRemote",
|
|
126376
|
+
unavailable: "settingsUnavailable",
|
|
126377
|
+
readOnly: "settingsReadOnly",
|
|
126378
|
+
incompatible: "settingsIncompatible"
|
|
126379
|
+
}[state]);
|
|
126380
|
+
const saveSetting = async (field, value) => {
|
|
126381
|
+
if (settingsMessage !== void 0) throw new Error(settingsMessage);
|
|
126382
|
+
await writeSetting(props.scope, field, value, t("settingsWriteRejected"));
|
|
126383
|
+
};
|
|
125916
126384
|
const providerLabels = {
|
|
125917
126385
|
google: t("providerGoogle"),
|
|
125918
126386
|
openai: t("providerOpenAI"),
|
|
@@ -126058,25 +126526,21 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126058
126526
|
await saveSetting("comfyuiTimeoutMs", Math.max(1, Math.round(row.timeoutSeconds)) * 1e3);
|
|
126059
126527
|
} else if (isSubscriptionProvider(provider)) await Promise.resolve();
|
|
126060
126528
|
else {
|
|
126061
|
-
|
|
126062
|
-
|
|
126063
|
-
|
|
126064
|
-
|
|
126065
|
-
let parsed;
|
|
126066
|
-
try {
|
|
126067
|
-
parsed = JSON.parse(extraText);
|
|
126068
|
-
} catch {
|
|
126069
|
-
throw new Error(t("editExtraInvalid"));
|
|
126070
|
-
}
|
|
126071
|
-
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new Error(t("editExtraInvalid"));
|
|
126072
|
-
editExtra = parsed;
|
|
126073
|
-
}
|
|
126074
|
-
}
|
|
126529
|
+
const editExtra = provider === "openai-compat" ? parseExtraFields(row.editExtraText, t("editExtraInvalid")) : {};
|
|
126530
|
+
const sizeTable = provider === "openai" || provider === "openai-compat" ? parseSizeTable(row.sizeTableText, t("sizeTableInvalid")) : {};
|
|
126531
|
+
const generateExtra = provider === "openai-compat" ? parseExtraFields(row.generateExtraText, t("editExtraInvalid")) : {};
|
|
126532
|
+
if (provider === "openai") for (const tiers of Object.values(sizeTable)) for (const size of Object.values(tiers)) validateOfficialSize(row.model, size);
|
|
126075
126533
|
await saveSetting(modelFieldOf(provider), row.model);
|
|
126076
126534
|
await saveSetting(baseURLFieldOf(provider), row.baseURL);
|
|
126535
|
+
if (provider === "openai") await saveSetting("openaiSizes", sizeTable);
|
|
126077
126536
|
if (provider === "openai-compat") {
|
|
126078
126537
|
await saveSetting("openaiCompatEditFormat", row.editFormat);
|
|
126079
126538
|
await saveSetting("openaiCompatEditExtra", editExtra);
|
|
126539
|
+
await saveSetting("openaiCompatSizes", sizeTable);
|
|
126540
|
+
await saveSetting("openaiCompatQuality", row.generationQuality.trim());
|
|
126541
|
+
await saveSetting("openaiCompatQualityOptions", [...new Set(row.qualityOptionsText.split(",").map((value) => value.trim()).filter(Boolean))]);
|
|
126542
|
+
await saveSetting("openaiCompatExtraBody", generateExtra);
|
|
126543
|
+
await saveSetting("openaiCompatEditSizeMode", row.editSizeMode);
|
|
126080
126544
|
}
|
|
126081
126545
|
if (provider === "seedream") {
|
|
126082
126546
|
await saveSetting("seedreamOutputFormat", row.outputFormat);
|
|
@@ -126418,6 +126882,12 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126418
126882
|
};
|
|
126419
126883
|
const renderCloudBody = (provider) => {
|
|
126420
126884
|
const row = rows[provider];
|
|
126885
|
+
const officialEditFormat = provider === "openai-compat" ? compatEditFormat({
|
|
126886
|
+
openaiCompatBaseURL: row.baseURL,
|
|
126887
|
+
openaiCompatModel: row.model
|
|
126888
|
+
}) : "multipart";
|
|
126889
|
+
const automaticEditFormat = officialEditFormat !== "multipart";
|
|
126890
|
+
const editFormat = automaticEditFormat ? officialEditFormat : row.editFormat;
|
|
126421
126891
|
const keyRef = cloudCredentialRef(provider) ?? "";
|
|
126422
126892
|
const keyReadOnly = row.keyInfo?.writable === false;
|
|
126423
126893
|
const keyUnavailable = !credentialsAvailable();
|
|
@@ -126445,7 +126915,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126445
126915
|
updateRow(provider, { keyInput: event.target.value });
|
|
126446
126916
|
},
|
|
126447
126917
|
placeholder: row.keyStatus === "configured" ? t("apiKeyPlaceholder") : "",
|
|
126448
|
-
disabled: !
|
|
126918
|
+
disabled: !settingsWritable || keyReadOnly || keyUnavailable
|
|
126449
126919
|
}),
|
|
126450
126920
|
(0, react_jsx_runtime.jsx)("span", {
|
|
126451
126921
|
className: "dsh-ig-hint",
|
|
@@ -126470,7 +126940,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126470
126940
|
updateRow(provider, { baseURL: event.target.value });
|
|
126471
126941
|
},
|
|
126472
126942
|
required: true,
|
|
126473
|
-
disabled: !
|
|
126943
|
+
disabled: !settingsWritable
|
|
126474
126944
|
}), provider !== "openai-compat" ? (0, react_jsx_runtime.jsx)("button", {
|
|
126475
126945
|
type: "button",
|
|
126476
126946
|
className: "dsh-ig-btn-reset",
|
|
@@ -126478,7 +126948,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126478
126948
|
onClick: () => {
|
|
126479
126949
|
updateRow(provider, { baseURL: DEFAULT_BASE_URLS[provider] });
|
|
126480
126950
|
},
|
|
126481
|
-
disabled: !
|
|
126951
|
+
disabled: !settingsWritable,
|
|
126482
126952
|
children: t("reset")
|
|
126483
126953
|
}) : null]
|
|
126484
126954
|
}),
|
|
@@ -126506,7 +126976,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126506
126976
|
},
|
|
126507
126977
|
list: `dsh-ig-${provider}-model-options`,
|
|
126508
126978
|
required: provider !== "openai-compat",
|
|
126509
|
-
disabled: !
|
|
126979
|
+
disabled: !settingsWritable
|
|
126510
126980
|
}),
|
|
126511
126981
|
(0, react_jsx_runtime.jsx)("datalist", {
|
|
126512
126982
|
id: `dsh-ig-${provider}-model-options`,
|
|
@@ -126515,7 +126985,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126515
126985
|
(0, react_jsx_runtime.jsx)("button", {
|
|
126516
126986
|
type: "button",
|
|
126517
126987
|
className: "dsh-ig-btn-secondary",
|
|
126518
|
-
disabled: row.fetchingModels || row.saving || !
|
|
126988
|
+
disabled: row.fetchingModels || row.saving || !settingsWritable,
|
|
126519
126989
|
onClick: () => {
|
|
126520
126990
|
fetchProviderModels(provider);
|
|
126521
126991
|
},
|
|
@@ -126529,7 +126999,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126529
126999
|
updateRow(provider, { model: event.target.value });
|
|
126530
127000
|
},
|
|
126531
127001
|
required: true,
|
|
126532
|
-
disabled: !
|
|
127002
|
+
disabled: !settingsWritable
|
|
126533
127003
|
}),
|
|
126534
127004
|
modelPullSupported(provider) ? row.modelFetchMessage.length > 0 ? (0, react_jsx_runtime.jsx)("span", {
|
|
126535
127005
|
className: `dsh-ig-hint${row.modelFetchIsError ? " dsh-ig-hint-error" : ""}`,
|
|
@@ -126550,12 +127020,16 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126550
127020
|
}),
|
|
126551
127021
|
(0, react_jsx_runtime.jsxs)("select", {
|
|
126552
127022
|
className: "dsh-ig-input",
|
|
126553
|
-
value: row.editFormat,
|
|
127023
|
+
value: automaticEditFormat ? "__official__" : row.editFormat,
|
|
126554
127024
|
onChange: (event) => {
|
|
126555
127025
|
updateRow(provider, { editFormat: parseEditFormat(event.target.value) });
|
|
126556
127026
|
},
|
|
126557
|
-
disabled: !
|
|
127027
|
+
disabled: !settingsWritable || automaticEditFormat,
|
|
126558
127028
|
children: [
|
|
127029
|
+
automaticEditFormat ? (0, react_jsx_runtime.jsx)("option", {
|
|
127030
|
+
value: "__official__",
|
|
127031
|
+
children: t("editFormatAutomatic")
|
|
127032
|
+
}) : null,
|
|
126559
127033
|
(0, react_jsx_runtime.jsx)("option", {
|
|
126560
127034
|
value: "multipart",
|
|
126561
127035
|
children: t("editFormatMultipart")
|
|
@@ -126590,7 +127064,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126590
127064
|
onChange: (event) => {
|
|
126591
127065
|
updateRow(provider, { outputFormat: event.target.value === "png" ? "png" : "jpeg" });
|
|
126592
127066
|
},
|
|
126593
|
-
disabled: !
|
|
127067
|
+
disabled: !settingsWritable,
|
|
126594
127068
|
children: [(0, react_jsx_runtime.jsx)("option", {
|
|
126595
127069
|
value: "jpeg",
|
|
126596
127070
|
children: t("arkOutputFormatJpeg")
|
|
@@ -126618,7 +127092,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126618
127092
|
onChange: (event) => {
|
|
126619
127093
|
updateRow(provider, { watermark: event.target.value === "on" });
|
|
126620
127094
|
},
|
|
126621
|
-
disabled: !
|
|
127095
|
+
disabled: !settingsWritable,
|
|
126622
127096
|
children: [(0, react_jsx_runtime.jsx)("option", {
|
|
126623
127097
|
value: "on",
|
|
126624
127098
|
children: t("arkWatermarkOn")
|
|
@@ -126646,7 +127120,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126646
127120
|
onChange: (event) => {
|
|
126647
127121
|
updateRow(provider, { background: event.target.value === "transparent" ? "transparent" : "opaque" });
|
|
126648
127122
|
},
|
|
126649
|
-
disabled: !
|
|
127123
|
+
disabled: !settingsWritable,
|
|
126650
127124
|
children: [(0, react_jsx_runtime.jsx)("option", {
|
|
126651
127125
|
value: "opaque",
|
|
126652
127126
|
children: t("arkBackgroundOpaque")
|
|
@@ -126662,7 +127136,110 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126662
127136
|
]
|
|
126663
127137
|
})
|
|
126664
127138
|
] }) : null,
|
|
126665
|
-
provider === "openai
|
|
127139
|
+
provider === "openai" || provider === "openai-compat" ? (0, react_jsx_runtime.jsxs)("label", {
|
|
127140
|
+
className: "dsh-ig-field",
|
|
127141
|
+
children: [
|
|
127142
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
127143
|
+
className: "dsh-ig-label",
|
|
127144
|
+
children: t("sizeTable")
|
|
127145
|
+
}),
|
|
127146
|
+
(0, react_jsx_runtime.jsx)("textarea", {
|
|
127147
|
+
className: "dsh-ig-input dsh-ig-textarea",
|
|
127148
|
+
value: row.sizeTableText,
|
|
127149
|
+
onChange: (event) => {
|
|
127150
|
+
updateRow(provider, { sizeTableText: event.target.value });
|
|
127151
|
+
},
|
|
127152
|
+
rows: 3,
|
|
127153
|
+
disabled: !settingsWritable
|
|
127154
|
+
}),
|
|
127155
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
127156
|
+
className: "dsh-ig-hint",
|
|
127157
|
+
children: t("sizeTableHint")
|
|
127158
|
+
})
|
|
127159
|
+
]
|
|
127160
|
+
}) : null,
|
|
127161
|
+
provider === "openai-compat" ? (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
127162
|
+
(0, react_jsx_runtime.jsxs)("label", {
|
|
127163
|
+
className: "dsh-ig-field",
|
|
127164
|
+
children: [
|
|
127165
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
127166
|
+
className: "dsh-ig-label",
|
|
127167
|
+
children: t("defaultQuality")
|
|
127168
|
+
}),
|
|
127169
|
+
(0, react_jsx_runtime.jsx)("input", {
|
|
127170
|
+
className: "dsh-ig-input",
|
|
127171
|
+
value: row.generationQuality,
|
|
127172
|
+
onChange: (event) => {
|
|
127173
|
+
updateRow(provider, { generationQuality: event.target.value });
|
|
127174
|
+
},
|
|
127175
|
+
placeholder: "high",
|
|
127176
|
+
disabled: !settingsWritable
|
|
127177
|
+
}),
|
|
127178
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
127179
|
+
className: "dsh-ig-hint",
|
|
127180
|
+
children: t("defaultQualityHint")
|
|
127181
|
+
})
|
|
127182
|
+
]
|
|
127183
|
+
}),
|
|
127184
|
+
(0, react_jsx_runtime.jsxs)("label", {
|
|
127185
|
+
className: "dsh-ig-field",
|
|
127186
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
127187
|
+
className: "dsh-ig-label",
|
|
127188
|
+
children: t("qualityOptions")
|
|
127189
|
+
}), (0, react_jsx_runtime.jsx)("input", {
|
|
127190
|
+
className: "dsh-ig-input",
|
|
127191
|
+
value: row.qualityOptionsText,
|
|
127192
|
+
onChange: (event) => {
|
|
127193
|
+
updateRow(provider, { qualityOptionsText: event.target.value });
|
|
127194
|
+
},
|
|
127195
|
+
disabled: !settingsWritable
|
|
127196
|
+
})]
|
|
127197
|
+
}),
|
|
127198
|
+
(0, react_jsx_runtime.jsxs)("label", {
|
|
127199
|
+
className: "dsh-ig-field",
|
|
127200
|
+
children: [
|
|
127201
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
127202
|
+
className: "dsh-ig-label",
|
|
127203
|
+
children: t("generateExtra")
|
|
127204
|
+
}),
|
|
127205
|
+
(0, react_jsx_runtime.jsx)("textarea", {
|
|
127206
|
+
className: "dsh-ig-input dsh-ig-textarea",
|
|
127207
|
+
value: row.generateExtraText,
|
|
127208
|
+
onChange: (event) => {
|
|
127209
|
+
updateRow(provider, { generateExtraText: event.target.value });
|
|
127210
|
+
},
|
|
127211
|
+
placeholder: "{\"watermark\":false}",
|
|
127212
|
+
rows: 2,
|
|
127213
|
+
disabled: !settingsWritable
|
|
127214
|
+
}),
|
|
127215
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
127216
|
+
className: "dsh-ig-hint",
|
|
127217
|
+
children: t("generateExtraHint")
|
|
127218
|
+
})
|
|
127219
|
+
]
|
|
127220
|
+
})
|
|
127221
|
+
] }) : null,
|
|
127222
|
+
provider === "openai-compat" && (editFormat === "jsonImageUrlArray" || editFormat === "qwenJson") ? (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [editFormat === "jsonImageUrlArray" ? (0, react_jsx_runtime.jsxs)("label", {
|
|
127223
|
+
className: "dsh-ig-field",
|
|
127224
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
127225
|
+
className: "dsh-ig-label",
|
|
127226
|
+
children: t("editSizeMode")
|
|
127227
|
+
}), (0, react_jsx_runtime.jsxs)("select", {
|
|
127228
|
+
className: "dsh-ig-input",
|
|
127229
|
+
value: row.editSizeMode,
|
|
127230
|
+
onChange: (event) => {
|
|
127231
|
+
updateRow(provider, { editSizeMode: event.target.value === "selected" ? "selected" : "auto" });
|
|
127232
|
+
},
|
|
127233
|
+
disabled: !settingsWritable,
|
|
127234
|
+
children: [(0, react_jsx_runtime.jsx)("option", {
|
|
127235
|
+
value: "auto",
|
|
127236
|
+
children: t("editSizeAuto")
|
|
127237
|
+
}), (0, react_jsx_runtime.jsx)("option", {
|
|
127238
|
+
value: "selected",
|
|
127239
|
+
children: t("editSizeSelected")
|
|
127240
|
+
})]
|
|
127241
|
+
})]
|
|
127242
|
+
}) : null, (0, react_jsx_runtime.jsxs)("label", {
|
|
126666
127243
|
className: "dsh-ig-field",
|
|
126667
127244
|
children: [
|
|
126668
127245
|
(0, react_jsx_runtime.jsx)("span", {
|
|
@@ -126677,14 +127254,14 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126677
127254
|
},
|
|
126678
127255
|
placeholder: t("editExtraPlaceholder"),
|
|
126679
127256
|
rows: 2,
|
|
126680
|
-
disabled: !
|
|
127257
|
+
disabled: !settingsWritable
|
|
126681
127258
|
}),
|
|
126682
127259
|
(0, react_jsx_runtime.jsx)("span", {
|
|
126683
127260
|
className: "dsh-ig-hint",
|
|
126684
127261
|
children: t("editExtraHint")
|
|
126685
127262
|
})
|
|
126686
127263
|
]
|
|
126687
|
-
}) : null,
|
|
127264
|
+
})] }) : null,
|
|
126688
127265
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
126689
127266
|
className: "dsh-ig-row-actions",
|
|
126690
127267
|
children: [(0, react_jsx_runtime.jsx)("p", {
|
|
@@ -126715,7 +127292,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126715
127292
|
(0, react_jsx_runtime.jsx)("button", {
|
|
126716
127293
|
className: "dsh-ig-save",
|
|
126717
127294
|
type: "submit",
|
|
126718
|
-
disabled: row.saving || row.testing || row.fetchingModels || !
|
|
127295
|
+
disabled: row.saving || row.testing || row.fetchingModels || !settingsWritable,
|
|
126719
127296
|
children: row.saving ? t("saving") : t("save")
|
|
126720
127297
|
})
|
|
126721
127298
|
]
|
|
@@ -126752,7 +127329,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126752
127329
|
updateRow("comfyui", { baseURL: event.target.value });
|
|
126753
127330
|
},
|
|
126754
127331
|
required: true,
|
|
126755
|
-
disabled: !
|
|
127332
|
+
disabled: !settingsWritable
|
|
126756
127333
|
}), (0, react_jsx_runtime.jsx)("button", {
|
|
126757
127334
|
type: "button",
|
|
126758
127335
|
className: "dsh-ig-btn-reset",
|
|
@@ -126760,7 +127337,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126760
127337
|
onClick: () => {
|
|
126761
127338
|
updateRow("comfyui", { baseURL: DEFAULT_BASE_URLS.comfyui });
|
|
126762
127339
|
},
|
|
126763
|
-
disabled: !
|
|
127340
|
+
disabled: !settingsWritable,
|
|
126764
127341
|
children: t("reset")
|
|
126765
127342
|
})]
|
|
126766
127343
|
}),
|
|
@@ -126866,7 +127443,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126866
127443
|
updateRow("comfyui", { timeoutSeconds: Number(event.target.value) });
|
|
126867
127444
|
},
|
|
126868
127445
|
required: true,
|
|
126869
|
-
disabled: !
|
|
127446
|
+
disabled: !settingsWritable
|
|
126870
127447
|
}),
|
|
126871
127448
|
(0, react_jsx_runtime.jsx)("span", {
|
|
126872
127449
|
className: "dsh-ig-hint",
|
|
@@ -126893,7 +127470,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
126893
127470
|
}), (0, react_jsx_runtime.jsx)("button", {
|
|
126894
127471
|
className: "dsh-ig-save",
|
|
126895
127472
|
type: "submit",
|
|
126896
|
-
disabled: row.saving || !
|
|
127473
|
+
disabled: row.saving || !settingsWritable || row.workflows.length === 0,
|
|
126897
127474
|
children: row.saving ? t("saving") : t("save")
|
|
126898
127475
|
})]
|
|
126899
127476
|
})]
|
|
@@ -127014,7 +127591,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
127014
127591
|
}), (0, react_jsx_runtime.jsx)("button", {
|
|
127015
127592
|
className: "dsh-ig-save",
|
|
127016
127593
|
type: "submit",
|
|
127017
|
-
disabled: row.saving || !
|
|
127594
|
+
disabled: row.saving || !settingsWritable,
|
|
127018
127595
|
children: row.saving ? t("saving") : t("save")
|
|
127019
127596
|
})]
|
|
127020
127597
|
})]
|
|
@@ -127103,10 +127680,10 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
127103
127680
|
}), open ? (0, react_jsx_runtime.jsxs)("div", {
|
|
127104
127681
|
className: "dsh-ig-body",
|
|
127105
127682
|
children: [
|
|
127106
|
-
|
|
127683
|
+
settingsMessage !== void 0 ? (0, react_jsx_runtime.jsx)("p", {
|
|
127107
127684
|
className: "dsh-ig-status dsh-ig-status-readonly",
|
|
127108
127685
|
role: "note",
|
|
127109
|
-
children:
|
|
127686
|
+
children: settingsMessage
|
|
127110
127687
|
}) : null,
|
|
127111
127688
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
127112
127689
|
className: "dsh-ig-field",
|
|
@@ -127128,7 +127705,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
127128
127705
|
onChange: () => {
|
|
127129
127706
|
selectDefaultProvider(provider);
|
|
127130
127707
|
},
|
|
127131
|
-
disabled: !
|
|
127708
|
+
disabled: !settingsWritable
|
|
127132
127709
|
}), providerLabels[provider]]
|
|
127133
127710
|
}, provider))
|
|
127134
127711
|
}),
|
|
@@ -127164,7 +127741,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
127164
127741
|
onChange: (event) => {
|
|
127165
127742
|
toggleSaveToWorkspace(event.target.checked);
|
|
127166
127743
|
},
|
|
127167
|
-
disabled: !
|
|
127744
|
+
disabled: !settingsWritable
|
|
127168
127745
|
}), (0, react_jsx_runtime.jsx)("span", {
|
|
127169
127746
|
className: "dsh-ig-label",
|
|
127170
127747
|
children: t("saveToWorkspace")
|
|
@@ -127194,7 +127771,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
127194
127771
|
if (event.key === "Enter") commitWorkspaceFolder();
|
|
127195
127772
|
},
|
|
127196
127773
|
placeholder: "dsh-image-gen",
|
|
127197
|
-
disabled: !
|
|
127774
|
+
disabled: !settingsWritable
|
|
127198
127775
|
}),
|
|
127199
127776
|
(0, react_jsx_runtime.jsx)("span", {
|
|
127200
127777
|
className: "dsh-ig-hint",
|
|
@@ -127225,7 +127802,7 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
127225
127802
|
onChange: (event) => {
|
|
127226
127803
|
toggleShowPill(event.target.checked);
|
|
127227
127804
|
},
|
|
127228
|
-
disabled: !
|
|
127805
|
+
disabled: !settingsWritable
|
|
127229
127806
|
}), (0, react_jsx_runtime.jsx)("span", {
|
|
127230
127807
|
className: "dsh-ig-label",
|
|
127231
127808
|
children: t("showPill")
|
|
@@ -127460,7 +128037,10 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
127460
128037
|
try {
|
|
127461
128038
|
const request = conversationRegenerateRequest(activeResult, regeneratePrompt, selectedRevision === void 0 ? void 0 : {
|
|
127462
128039
|
ratio: selectedRevision.ratio,
|
|
127463
|
-
quality: selectedRevision.quality
|
|
128040
|
+
quality: selectedRevision.quality,
|
|
128041
|
+
resolution: selectedRevision.resolution,
|
|
128042
|
+
generationQuality: selectedRevision.generationQuality,
|
|
128043
|
+
watermark: selectedRevision.watermark
|
|
127464
128044
|
});
|
|
127465
128045
|
const response = await fetch(STUDIO_ROUTE, {
|
|
127466
128046
|
method: "POST",
|
|
@@ -127479,7 +128059,10 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
127479
128059
|
output: payload.output,
|
|
127480
128060
|
createdAt: payload.createdAt,
|
|
127481
128061
|
ratio: request.ratio,
|
|
127482
|
-
quality: request.quality
|
|
128062
|
+
quality: request.quality,
|
|
128063
|
+
...request.resolution === void 0 ? {} : { resolution: request.resolution },
|
|
128064
|
+
...request.generationQuality === void 0 ? {} : { generationQuality: request.generationQuality },
|
|
128065
|
+
...request.watermark === void 0 ? {} : { watermark: request.watermark }
|
|
127483
128066
|
};
|
|
127484
128067
|
const savedOk = await saveGalleryItem({
|
|
127485
128068
|
id: String(revision.attachment.attachmentId),
|
|
@@ -127490,6 +128073,9 @@ body[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a
|
|
|
127490
128073
|
createdAt: revision.createdAt,
|
|
127491
128074
|
aspectRatio: revision.ratio,
|
|
127492
128075
|
imageSize: revision.quality,
|
|
128076
|
+
resolution: revision.resolution,
|
|
128077
|
+
generationQuality: revision.generationQuality,
|
|
128078
|
+
watermark: revision.watermark,
|
|
127493
128079
|
output: revision.output,
|
|
127494
128080
|
...savedTo ? { savedTo } : {},
|
|
127495
128081
|
...sessionId ? { sessionId } : {}
|