mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-31 00:10:22 +08:00
fix: aihubmix provider generate image logic (#8478)
fix: aihubmix provider generate image Co-authored-by: zhaochenxue <zhaochenxue@bixin.cn>
This commit is contained in:
parent
eef20e399c
commit
1a4d64595c
@ -170,6 +170,10 @@ export default class AiProvider {
|
||||
}
|
||||
|
||||
public async generateImage(params: GenerateImageParams): Promise<string[]> {
|
||||
if (this.apiClient instanceof AihubmixAPIClient) {
|
||||
const client = this.apiClient.getClientForModel({ id: params.model } as Model)
|
||||
return client.generateImage(params)
|
||||
}
|
||||
return this.apiClient.generateImage(params)
|
||||
}
|
||||
|
||||
|
||||
@ -187,7 +187,7 @@ const AihubmixPage: FC<{ Options: string[] }> = ({ Options }) => {
|
||||
prompt,
|
||||
model: painting.model,
|
||||
imageSize: painting.aspectRatio?.replace('ASPECT_', '').replace('_', ':') || '1:1',
|
||||
batchSize: painting.model.startsWith('imagen-4.0-ultra-generate-exp') ? 1 : painting.numberOfImages || 1,
|
||||
batchSize: painting.model.startsWith('imagen-4.0-ultra-generate') ? 1 : painting.numberOfImages || 1,
|
||||
personGeneration: painting.personGeneration
|
||||
})
|
||||
if (base64s?.length > 0) {
|
||||
|
||||
@ -72,9 +72,8 @@ export const createModeConfigs = (): Record<AihubmixMode, ConfigItem[]> => {
|
||||
label: 'Gemini',
|
||||
title: 'Gemini',
|
||||
options: [
|
||||
{ label: 'imagen-4.0-preview', value: 'imagen-4.0-generate-preview-05-20' },
|
||||
{ label: 'imagen-4.0-ultra-exp', value: 'imagen-4.0-ultra-generate-exp-05-20' },
|
||||
{ label: 'imagen-3.0', value: 'imagen-3.0-generate-001' }
|
||||
{ label: 'imagen-4.0-preview', value: 'imagen-4.0-generate-preview-06-06' },
|
||||
{ label: 'imagen-4.0-ultra', value: 'imagen-4.0-ultra-generate-preview-06-06' }
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -206,7 +205,7 @@ export const createModeConfigs = (): Record<AihubmixMode, ConfigItem[]> => {
|
||||
max: 4,
|
||||
initialValue: 4,
|
||||
condition: (painting) =>
|
||||
Boolean(painting.model?.startsWith('imagen-') && painting.model !== 'imagen-4.0-ultra-generate-exp-05-20')
|
||||
Boolean(painting.model?.startsWith('imagen-') && painting.model !== 'imagen-4.0-ultra-generate-preview-06-06')
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user