update
This commit is contained in:
@@ -34,7 +34,7 @@ export const app = useContextKey('app', new App());
|
||||
|
||||
export const ai = useContextKey('ai', new Kevisual({
|
||||
apiKey: config.KEVISUAL_NEW_API_KEY,
|
||||
model: 'qwen-turbo',
|
||||
model: 'qwen-plus',
|
||||
}));
|
||||
|
||||
export const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
|
||||
@@ -35,6 +35,7 @@ export interface ImageCreatorJobData {
|
||||
export interface ImageGenerateJobData {
|
||||
itemId: string;
|
||||
prompt: string;
|
||||
ratio?: string;
|
||||
collectionName?: string;
|
||||
}
|
||||
|
||||
@@ -173,7 +174,7 @@ export async function runImageGenerateWorker(): Promise<void> {
|
||||
const worker = new Worker(
|
||||
IMAGE_GENERATE_JOB,
|
||||
async (job: Job<ImageGenerateJobData>) => {
|
||||
const { itemId, prompt } = job.data;
|
||||
const { itemId, prompt, ratio = '9:16' } = job.data;
|
||||
const attemptsMade = job.attemptsMade;
|
||||
console.log(`[ImageGenerate] Processing item: ${itemId}, attempt: ${attemptsMade + 1}/${GENERATE_MAX_RETRIES}`);
|
||||
|
||||
@@ -181,7 +182,7 @@ export async function runImageGenerateWorker(): Promise<void> {
|
||||
// 调用 jimeng API 生成图片
|
||||
const result = await jimengService.generateImage({
|
||||
prompt,
|
||||
ratio: '9:16',
|
||||
ratio: ratio,
|
||||
});
|
||||
|
||||
if (result.code !== 200 || !result.data?.data?.length) {
|
||||
|
||||
Reference in New Issue
Block a user