koishi-plugin-p-draw 1.2.8 → 1.2.9
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/index.js +5 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1623,7 +1623,8 @@ exports.apply = async function apply(ctx, cfg) {
|
|
|
1623
1623
|
if (!raw || typeof raw !== 'object') return {}
|
|
1624
1624
|
const out = {}
|
|
1625
1625
|
for (const k of MODEL_OVERRIDE_KEYS) {
|
|
1626
|
-
if (raw[k]
|
|
1626
|
+
if (raw[k] === undefined || raw[k] === null || raw[k] === '') continue
|
|
1627
|
+
out[k] = typeof raw[k] === 'string' ? raw[k].trim() : raw[k]
|
|
1627
1628
|
}
|
|
1628
1629
|
return out
|
|
1629
1630
|
}
|
|
@@ -1653,6 +1654,9 @@ exports.apply = async function apply(ctx, cfg) {
|
|
|
1653
1654
|
// 应用该模型的独立参数覆盖(modelParams),再叠加命令级 overrides(overrides.steps/cfg 优先于模型级)
|
|
1654
1655
|
const modelSpecific = resolveModelParams(unetName)
|
|
1655
1656
|
const workCfg = Object.assign({}, cfg, modelSpecific, { unetName })
|
|
1657
|
+
// 防御:sampler/scheduler 配置若带尾随空格会导致 ComfyUI 报 "Value not in list",统一 trim
|
|
1658
|
+
if (typeof workCfg.samplerName === 'string') workCfg.samplerName = workCfg.samplerName.trim()
|
|
1659
|
+
if (typeof workCfg.scheduler === 'string') workCfg.scheduler = workCfg.scheduler.trim()
|
|
1656
1660
|
const width = Math.round(Number(requestedWidth) || workCfg.width)
|
|
1657
1661
|
const height = Math.round(Number(requestedHeight) || workCfg.height)
|
|
1658
1662
|
const steps = Math.round(Number(overrides.steps) || workCfg.steps)
|