refactor: 同步独立选角与默认人物基线
This commit is contained in:
@@ -130,7 +130,8 @@ function chooseAnchor(imageId: string) {
|
||||
</div>
|
||||
<p class="alert mt-5 text-xs">
|
||||
Character 现在需要依次完成身份文本、选角候选、确认演员并锁定
|
||||
Identity,之后首帧才能就绪。场景和道具仍使用普通身份母版流程;旧形态图、首帧与视频不会因母版切换自动更新。
|
||||
Identity,之后首帧才能就绪。未明确人物背景时,AI
|
||||
默认以中国人物作为选角基线;项目和角色的明确事实始终优先。场景和道具仍使用普通身份母版流程。
|
||||
</p>
|
||||
<p
|
||||
v-if="catalog.error.value || styleQuery.error.value || castingQuery.error.value"
|
||||
@@ -154,7 +155,8 @@ function chooseAnchor(imageId: string) {
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold">角色选角</h3>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">
|
||||
只处理 Character。候选图不会自动成为演员,确认选择时才会同时切换 Anchor 并锁定 Identity。
|
||||
只处理 Character。每张候选都从 Identity 独立生成,不复用旧 Anchor;确认选择时才会同时切换
|
||||
Anchor 并锁定 Identity。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -221,7 +223,7 @@ function chooseAnchor(imageId: string) {
|
||||
castingBlocked || !hasStyle || !batchValid || !candidateLimitValid || !casting.missingAnchor
|
||||
"
|
||||
acknowledgement
|
||||
description="最多按本批上限为缺少 Anchor 的 Character 调用 Seedream,各生成一张停用的 primary 候选。已有候选、已有母版或已完成选角的角色不会重复处理。"
|
||||
description="最多按本批上限为缺少 Anchor 的 Character 调用 Seedream,各自独立生成一张停用的 primary 候选,不复用旧身份母版。已有候选、已有母版或已完成选角的角色不会重复处理。"
|
||||
@confirm="generateCastingCandidates"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { AppDialog } from '../../../components/ui'
|
||||
import { validImageSize } from '../../subject-images/model'
|
||||
import type { GenerateCastingCandidateInput } from '../types'
|
||||
|
||||
/** Character 选角候选表单固定使用 primary,且不会自动选择演员。 */
|
||||
/** Character 选角候选表单固定使用 primary,每次独立生成且不会自动选择演员。 */
|
||||
const props = defineProps<{ subjectId: string; subjectName: string; disabled: boolean }>()
|
||||
const open = defineModel<boolean>('open', { default: false })
|
||||
const emit = defineEmits<{ generate: [input: GenerateCastingCandidateInput] }>()
|
||||
@@ -39,8 +39,8 @@ function submit() {
|
||||
<AppDialog v-model:open="open" title="生成角色选角候选" :description="`${subjectName} · 候选不会自动成为身份母版`">
|
||||
<form class="mt-5 space-y-4" @submit.prevent="submit">
|
||||
<p class="alert text-xs">
|
||||
后端会依据角色 Identity、项目视觉风格和默认选角约束生成一张 primary
|
||||
候选。生成完成后仍需人工点击“确认选角”。
|
||||
后端会依据角色 Identity、项目视觉风格和默认选角约束独立生成一张 primary
|
||||
候选,不会复用当前身份母版。生成完成后仍需人工点击“确认选角”。
|
||||
</p>
|
||||
<label class="block">
|
||||
<span class="field-label">覆盖本次完整提示词(可选)</span>
|
||||
@@ -48,7 +48,7 @@ function submit() {
|
||||
id="casting-candidate-prompt"
|
||||
v-model="prompt"
|
||||
class="input min-h-24"
|
||||
placeholder="建议留空,使用后端编译的稳定身份和选角约束"
|
||||
placeholder="建议留空,使用后端编译的稳定身份和选角约束;未明确人物背景时默认中国人物"
|
||||
/>
|
||||
</label>
|
||||
<p v-if="prompt.trim()" class="text-xs text-danger">
|
||||
|
||||
@@ -199,6 +199,7 @@ describe('身份图与母版契约', () => {
|
||||
props: { open: true, subjectId: 'subject-1', subjectName: '林夏', disabled: false }
|
||||
})
|
||||
await flushPromises()
|
||||
expect(document.body.textContent).toContain('不会复用当前身份母版')
|
||||
document.querySelector<HTMLInputElement>('#casting-candidate-cost')!.click()
|
||||
await flushPromises()
|
||||
button('确认生成候选').click()
|
||||
|
||||
@@ -54,7 +54,7 @@ export interface GenerateIdentityImageInput {
|
||||
height?: number
|
||||
}
|
||||
|
||||
/** Character 选角候选固定生成 primary,且不会自动成为 Anchor。 */
|
||||
/** Character 选角候选固定独立生成 primary,不复用旧 Anchor,也不会自动成为新 Anchor。 */
|
||||
export interface GenerateCastingCandidateInput {
|
||||
provider: 'seedream'
|
||||
prompt?: string
|
||||
|
||||
@@ -212,7 +212,7 @@ export function useSubjectIdentity() {
|
||||
await detail.refresh()
|
||||
}
|
||||
|
||||
/** 单角色候选图固定为 primary,生成成功后仍需人工确认选角。 */
|
||||
/** 单角色候选图固定为独立 primary,不复用旧 Anchor,生成成功后仍需人工确认选角。 */
|
||||
async function generateCastingCandidate(input: GenerateCastingCandidateInput) {
|
||||
if (!canGenerateCandidate.value || !subject.value || !identity.value) return
|
||||
const id = subject.value.id
|
||||
|
||||
@@ -115,7 +115,8 @@ function removeImage(image: VisualStyleImage) {
|
||||
有未保存修改,AI 重生成暂不可用。自动刷新不会覆盖编辑内容;离开页面不会自动保存。
|
||||
</p>
|
||||
<p class="alert mb-5 text-xs">
|
||||
修改风格只影响之后的相关生成。已有主体身份、形态图片和视频提示词不会自动更新,请按需要逐步重生成。
|
||||
AI
|
||||
生成时,若项目和世界观没有明确其它人物背景,人物风格默认采用中国人物选角基线;人工填写的人物背景和角色事实优先。修改风格只影响之后的生成,旧资产不会自动更新。
|
||||
</p>
|
||||
<StyleEditor
|
||||
v-if="query.data.value"
|
||||
|
||||
@@ -81,8 +81,12 @@ function save() {
|
||||
</label>
|
||||
<div class="grid gap-5 lg:grid-cols-3">
|
||||
<label
|
||||
><span class="field-label">人物风格补充</span
|
||||
><textarea v-model="form.characterPrompt" class="input min-h-32" />
|
||||
><span class="field-label">人物风格与选角背景</span
|
||||
><textarea
|
||||
v-model="form.characterPrompt"
|
||||
class="input min-h-32"
|
||||
placeholder="人物质感、妆造与默认选角背景;留空时 AI 默认采用中国人物基线"
|
||||
/>
|
||||
</label>
|
||||
<label
|
||||
><span class="field-label">场景风格补充</span
|
||||
|
||||
@@ -245,6 +245,8 @@ describe('视觉风格与主体身份工作区', () => {
|
||||
vi.stubGlobal('fetch', fetcher)
|
||||
await mountAssets('style')
|
||||
expect(wrapper!.text()).toContain('尚未创建')
|
||||
expect(wrapper!.text()).toContain('默认采用中国人物选角基线')
|
||||
expect(wrapper!.text()).toContain('人物风格与选角背景')
|
||||
await wrapper!.get('#style-constraints').setValue('{"不应静默丢弃":true}')
|
||||
expect(button('保存视觉风格').disabled).toBe(true)
|
||||
await wrapper!.get('#style-constraints').setValue('["真人写实"]')
|
||||
|
||||
Reference in New Issue
Block a user