koishi-plugin-p-draw 1.2.12 → 1.2.13

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 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1262,7 +1262,7 @@ function parseMultiPersonPlan(text) {
1262
1262
  function renderMultiPersonCharacter(character, opts = {}) {
1263
1263
  const {
1264
1264
  alias = '', resolvedIdentity = '', fixedTags = '', groupedContact = false,
1265
- explicitPositions = false, identityAnchors = [], includePose = true,
1265
+ explicitPositions = false, identityAnchors = [], includePose = true, asTagStream = false,
1266
1266
  } = opts
1267
1267
  let label = String(alias || character.visual_label || character.role || '').trim()
1268
1268
  if (explicitPositions && character.slot) label = `${character.slot} ${label}`
@@ -1283,6 +1283,7 @@ function renderMultiPersonCharacter(character, opts = {}) {
1283
1283
  if (includePose && character.pose) details.push(character.pose)
1284
1284
  if (character.props && character.props.length) details.push(...character.props)
1285
1285
  const joined = details.filter(Boolean).join(', ')
1286
+ if (asTagStream) return [label, joined].filter(Boolean).join(', ')
1286
1287
  return `${label}: ${joined}.`
1287
1288
  }
1288
1289
 
@@ -2125,7 +2126,7 @@ exports.apply = async function apply(ctx, cfg) {
2125
2126
  const aliases = ['Character A', 'Character B', 'Character C', 'Character D']
2126
2127
  const characterCount = plan.characters.length
2127
2128
  const characterRoles = []
2128
- const characterBlocks = []
2129
+ const characterTagStream = []
2129
2130
  const characterEntityNames = []
2130
2131
  let groupedContact = plan.spatial_mode === 'shared_contact'
2131
2132
  const explicitPositionRequested = /左边|右边|左侧|右侧|前景|后方|前后站位|\bon\s+the\s+(?:left|right)\b|\bforeground\b|\bbackground\b/i.test(prompt)
@@ -2193,7 +2194,7 @@ exports.apply = async function apply(ctx, cfg) {
2193
2194
  )
2194
2195
 
2195
2196
  characterEntityNames.push(new Set([character.name, character.danbooru_candidate, fixedName, resolvedIdentity].filter(Boolean)))
2196
- characterBlocks.push(renderMultiPersonCharacter(character, {
2197
+ characterTagStream.push(renderMultiPersonCharacter(character, {
2197
2198
  alias: visualLabel,
2198
2199
  resolvedIdentity,
2199
2200
  fixedTags: fixedName ? fixedTags : '',
@@ -2201,6 +2202,7 @@ exports.apply = async function apply(ctx, cfg) {
2201
2202
  explicitPositions: spatialMode === 'explicit_positions',
2202
2203
  identityAnchors: renderedIdentityTags,
2203
2204
  includePose: !groupedContact,
2205
+ asTagStream: true,
2204
2206
  }))
2205
2207
  }
2206
2208
 
@@ -2274,7 +2276,6 @@ exports.apply = async function apply(ctx, cfg) {
2274
2276
  return displayed
2275
2277
  })
2276
2278
 
2277
- const sceneGuard = 'The composition shows one shared continuous moment.'
2278
2279
  let relativePosition = ''
2279
2280
  if (spatialMode === 'explicit_positions' && characterCount === 2) {
2280
2281
  const slotAliases = {}
@@ -2286,9 +2287,9 @@ exports.apply = async function apply(ctx, cfg) {
2286
2287
  }
2287
2288
  }
2288
2289
 
2289
- const narrativeBlocks = [...characterBlocks, ...displayInteractions, relativePosition, sceneGuard].filter(Boolean)
2290
+ const narrativeBlocks = [...displayInteractions, relativePosition].filter(Boolean)
2290
2291
 
2291
- // 组装最终提示词:质量词 + 画师组 + content + narrative
2292
+ // 组装最终提示词:质量词 + 画师组 + tag 流(含角色外观)+ narrative 块(仅互动/站位)
2292
2293
  const contentClean = cleanContentTags(commonContent, 65, false, [], true)
2293
2294
  const parts = []
2294
2295
  if (cfg.qualityPrefix) parts.push(String(cfg.qualityPrefix).trim())
@@ -2302,6 +2303,7 @@ exports.apply = async function apply(ctx, cfg) {
2302
2303
  if (artistTags) parts.push(artistTags)
2303
2304
  if (cfg.styleTags) parts.push(String(cfg.styleTags).trim())
2304
2305
  parts.push(contentClean || commonContent)
2306
+ if (characterTagStream.length) parts.push(characterTagStream.join(', '))
2305
2307
  let finalPrompt = joinPromptParts(parts)
2306
2308
  if (narrativeBlocks.length) finalPrompt += '\n\n' + narrativeBlocks.join('\n\n')
2307
2309
  return { ok: true, prompt: finalPrompt }
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.12",
4
+ "version": "1.2.13",
5
5
  "main": "index.js",
6
6
  "files": [
7
7
  "index.js",