koishi-plugin-p-draw 1.2.3 → 1.2.5

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 +8 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -578,8 +578,8 @@ function animaStyleI2IWorkflow(cfg, prompt, negativePrompt, width, height, steps
578
578
  '11': { class_type: 'CLIPTextEncode', inputs: { text: prompt, clip: ['45', 0] } },
579
579
  '12': { class_type: 'CLIPTextEncode', inputs: { text: negativePrompt, clip: ['45', 0] } },
580
580
  '70': { class_type: 'Canny', inputs: { image: ['13', 0], low_threshold: 0.4, high_threshold: 0.8 } },
581
- '71': { class_type: 'ControlNetLoader', inputs: { controlnet_name: controlNetModel } },
582
- '72': { class_type: 'ControlNetApplyAdvanced', inputs: { positive: ['11', 0], negative: ['12', 0], control_net: ['71', 0], image: ['70', 0], strength: controlNetStrength, start_percent: 0, end_percent: 1 } },
581
+ '71': { class_type: 'ControlNetLoader', inputs: { control_net_name: controlNetModel } },
582
+ '72': { class_type: 'ControlNetApplyAdvanced', inputs: { positive: ['11', 0], negative: ['12', 0], control_net: ['71', 0], image: ['70', 0], vae: ['15', 0], strength: controlNetStrength, start_percent: 0, end_percent: 1 } },
583
583
  '19': {
584
584
  class_type: 'KSampler',
585
585
  inputs: {
@@ -1643,7 +1643,12 @@ exports.apply = async function apply(ctx, cfg) {
1643
1643
 
1644
1644
  const status = history.status || {}
1645
1645
  if (status.status_str && status.status_str !== 'success') {
1646
- return { ok: false, message: `ComfyUI 工作流执行失败:${JSON.stringify(status).slice(0, 400)}` }
1646
+ const execErr = status.messages && status.messages.find((m) => Array.isArray(m) && m[0] === 'execution_error' && m[1])
1647
+ const errData = execErr && execErr[1]
1648
+ const errText = errData
1649
+ ? `[${errData.node_id} ${errData.node_type}] ${errData.exception_type || ''} ${errData.exception_message || ''}`.trim()
1650
+ : ''
1651
+ return { ok: false, message: `ComfyUI 工作流执行失败:${JSON.stringify(status).slice(0, 400)}${errText ? `\n异常:${errText}` : ''}` }
1647
1652
  }
1648
1653
 
1649
1654
  const images = outputImages(history)
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.3",
4
+ "version": "1.2.5",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "index.js",