feat: 同步角色选角与首帧身份约束
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { request } from '../../lib/http'
|
||||
import type {
|
||||
CastingBatchResult,
|
||||
CharacterCastingReadiness,
|
||||
ConfirmCastingResult,
|
||||
GenerateCastingCandidateInput,
|
||||
GenerateCastingCandidatesInput,
|
||||
GenerateIdentityImageInput,
|
||||
IdentityBatchResult,
|
||||
IdentityImage,
|
||||
@@ -30,6 +35,27 @@ export const subjectIdentityApi = {
|
||||
body: input,
|
||||
timeoutMs: 0
|
||||
}),
|
||||
generateCharacters: (projectId: string, input: { force: boolean; concurrency: number }) =>
|
||||
request<IdentityBatchResult>(`/projects/${encodeURIComponent(projectId)}/character-identities/generate`, {
|
||||
method: 'POST',
|
||||
body: input,
|
||||
timeoutMs: 0
|
||||
}),
|
||||
castingReadiness: (projectId: string, signal?: AbortSignal) =>
|
||||
request<CharacterCastingReadiness>(`/projects/${encodeURIComponent(projectId)}/character-casting/readiness`, {
|
||||
signal
|
||||
}),
|
||||
generateCastingCandidate: (subjectId: string, input: GenerateCastingCandidateInput) =>
|
||||
request<IdentityImage>(`${identityPath(subjectId)}/casting-candidates`, {
|
||||
method: 'POST',
|
||||
body: input,
|
||||
timeoutMs: 0
|
||||
}),
|
||||
generateCastingCandidates: (projectId: string, input: GenerateCastingCandidatesInput) =>
|
||||
request<CastingBatchResult>(
|
||||
`/projects/${encodeURIComponent(projectId)}/character-casting/candidates/generate`,
|
||||
{ method: 'POST', body: input, timeoutMs: 0 }
|
||||
),
|
||||
listImages: (subjectId: string, signal?: AbortSignal) =>
|
||||
request<IdentityImage[]>(`${identityPath(subjectId)}/images`, { signal }),
|
||||
generateImage: (subjectId: string, input: GenerateIdentityImageInput) =>
|
||||
@@ -37,5 +63,9 @@ export const subjectIdentityApi = {
|
||||
setAnchor: (subjectId: string, imageId: string) =>
|
||||
request<IdentityImage>(`${identityPath(subjectId)}/images/${encodeURIComponent(imageId)}/anchor`, {
|
||||
method: 'PUT'
|
||||
}),
|
||||
confirmCasting: (subjectId: string, imageId: string) =>
|
||||
request<ConfirmCastingResult>(`${identityPath(subjectId)}/images/${encodeURIComponent(imageId)}/casting`, {
|
||||
method: 'PUT'
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user