feat: Add image generation and image-to-prompt features, integrate Telegram for generation results, and enhance asset management.
This commit is contained in:
@@ -41,5 +41,27 @@ export const dataService = {
|
||||
}
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
generatePromptFromImage: async (files, prompt) => {
|
||||
const formData = new FormData()
|
||||
|
||||
// Handle single or multiple files
|
||||
const fileArray = Array.isArray(files) ? files : [files]
|
||||
fileArray.forEach(file => {
|
||||
formData.append('images', file)
|
||||
})
|
||||
|
||||
if (prompt) {
|
||||
formData.append('prompt', prompt)
|
||||
}
|
||||
|
||||
const response = await api.post('/generations/prompt-from-image', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
|
||||
return response.data.prompt
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user