feat: 同步角色选角与首帧身份约束
This commit is contained in:
1 parent
aeb3ce2986
commit
53917268d3
20 files changed
+940
-112
No files matched your search
@@ -6,7 +6,13 @@ import { currentAnchor, identityViewLabels } from '../model'
|
||||
import type { GenerateIdentityImageInput, IdentityImage, IdentityViewType } from '../types'
|
||||
|
||||
/** 身份图生成配置;默认自动引用母版,不提供后端不存在的“忽略母版”开关。 */
|
||||
const props = defineProps<{ subjectId: string; subjectName: string; images: IdentityImage[]; disabled: boolean }>()
|
||||
const props = defineProps<{
|
||||
subjectId: string
|
||||
subjectName: string
|
||||
module?: string
|
||||
images: IdentityImage[]
|
||||
disabled: boolean
|
||||
}>()
|
||||
const open = defineModel<boolean>('open', { default: false })
|
||||
const emit = defineEmits<{ generate: [input: GenerateIdentityImageInput] }>()
|
||||
const viewType = ref<IdentityViewType>('primary')
|
||||
@@ -16,6 +22,9 @@ const width = ref<number | ''>('')
|
||||
const height = ref<number | ''>('')
|
||||
const acknowledged = ref(false)
|
||||
const anchor = computed(() => currentAnchor(props.images))
|
||||
const allowedViews = computed(() =>
|
||||
Object.entries(identityViewLabels).filter(([value]) => props.module !== 'character' || value !== 'primary')
|
||||
)
|
||||
const references = computed(() => props.images.filter(image => image.status === 'completed' && image.imageUrl))
|
||||
const valid = computed(
|
||||
() =>
|
||||
@@ -25,13 +34,14 @@ const valid = computed(
|
||||
watch(
|
||||
() => [open.value, props.subjectId],
|
||||
() => {
|
||||
viewType.value = 'primary'
|
||||
viewType.value = props.module === 'character' ? 'front' : 'primary'
|
||||
referenceImageId.value = ''
|
||||
prompt.value = ''
|
||||
width.value = ''
|
||||
height.value = ''
|
||||
acknowledged.value = false
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
/** 提交显式的 Seedream 参数;省略空参考 ID 以保留后端自动选择逻辑。 */
|
||||
@@ -58,7 +68,7 @@ function submit() {
|
||||
<label class="block"
|
||||
><span class="field-label">参考视角</span
|
||||
><select id="identity-view" v-model="viewType" class="input">
|
||||
<option v-for="(label, value) in identityViewLabels" :key="value" :value="value">
|
||||
<option v-for="[value, label] in allowedViews" :key="value" :value="value">
|
||||
{{ label }}({{ value }})
|
||||
</option>
|
||||
</select></label
|
||||
|
||||
Reference in new issue
Block a user