23 lines
451 B
TypeScript
23 lines
451 B
TypeScript
|
|
import { post } from './client'
|
||
|
|
|
||
|
|
export interface EditImageRequest {
|
||
|
|
image: string // base64 编码
|
||
|
|
prompt: string
|
||
|
|
count?: number
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface EditAssetResponse {
|
||
|
|
data: string // base64 编码
|
||
|
|
format: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface EditImageResponse {
|
||
|
|
assets: EditAssetResponse[]
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function editImage(
|
||
|
|
req: EditImageRequest,
|
||
|
|
): Promise<EditImageResponse> {
|
||
|
|
return post<EditImageResponse>('/api/v1/images/edit', req)
|
||
|
|
}
|