From eee26c35db87f903cb78d43ffe1d1a35fb4fda4d Mon Sep 17 00:00:00 2001 From: gongchengtu <1817063960@qq.com> Date: Fri, 6 Mar 2026 15:00:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(batch-image-generation):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=89=B9=E9=87=8F=E7=94=9F=E5=9B=BE=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=B0=BA=E5=AF=B8=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #123 --- .../src/components/ttd-dialog/batch-image-generation.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/drawnix/src/components/ttd-dialog/batch-image-generation.tsx b/packages/drawnix/src/components/ttd-dialog/batch-image-generation.tsx index 18bbe9b0..54fe2ed1 100644 --- a/packages/drawnix/src/components/ttd-dialog/batch-image-generation.tsx +++ b/packages/drawnix/src/components/ttd-dialog/batch-image-generation.tsx @@ -1362,6 +1362,10 @@ const BatchImageGeneration: React.FC = ({ onSwitchToS for (const { task, rowIndex } of validTasks) { const generateCount = task.count || 1; const batchId = `batch_${task.id}_${globalBatchTimestamp}`; + const normalizedAspectRatio = task.size || defaultModelSize; + const normalizedSize = normalizedAspectRatio === 'auto' + ? undefined + : normalizedAspectRatio; const uploadedImages = task.images.map((url, index) => ({ type: 'url', @@ -1376,7 +1380,8 @@ const BatchImageGeneration: React.FC = ({ onSwitchToS const taskParams = { prompt: task.prompt.trim(), - aspectRatio: task.size, + aspectRatio: normalizedAspectRatio, + size: normalizedSize, model: selectedModel || settings.imageModelName || 'gemini-2.5-flash-image-vip', uploadedImages, batchId, @@ -1417,7 +1422,7 @@ const BatchImageGeneration: React.FC = ({ onSwitchToS : `Submitted ${submittedCount} tasks to queue` ); } - }, [createTask, language, selectedModel, setTasks, setEditingCell, setActiveCell]); + }, [createTask, defaultModelSize, language, selectedModel, setTasks, setEditingCell, setActiveCell]); // 提交到任务队列 - 只提交选中的行 const submitToQueue = useCallback(async () => {