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.
Files changed (2) hide show
  1. package/index.js +5 -1
  2. 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] !== undefined && raw[k] !== null && raw[k] !== '') out[k] = 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)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-p-draw",
3
3
  "description": "p点-绘图,连接本地 ComfyUI 生图。支持自然语言优化、尺寸选择、画师组、固定角色、生成队列,需要配合 p-qiandao 使用",
4
- "version": "1.2.8",
4
+ "version": "1.2.9",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "index.js",