feat(P1): Add align-prompt feature for better text-image relevance
This commit is contained in:
@@ -197,6 +197,31 @@ class EditorApiClient {
|
||||
return response.json()
|
||||
}
|
||||
|
||||
/**
|
||||
* Align image prompt with narration - regenerate prompt based on narration
|
||||
*/
|
||||
async alignPrompt(
|
||||
storyboardId: string,
|
||||
frameId: string,
|
||||
narration?: string
|
||||
): Promise<{ image_prompt: string; success: boolean }> {
|
||||
const response = await fetch(
|
||||
`${this.baseUrl}/editor/storyboard/${storyboardId}/frames/${frameId}/align-prompt`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ narration }),
|
||||
}
|
||||
)
|
||||
|
||||
if (!response.ok) {
|
||||
const error = await response.json().catch(() => ({ detail: response.statusText }))
|
||||
throw new Error(error.detail || `Failed to align prompt: ${response.statusText}`)
|
||||
}
|
||||
|
||||
return response.json()
|
||||
}
|
||||
|
||||
/**
|
||||
* Inpaint (局部重绘) image for a frame
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user