You've already forked Nano-Banana-AI-Image-Editor
新增 生成过程中可以中断;
新增 生成结果上传到OSS; 新增 历史记录使用上传后的图片;
This commit is contained in:
@@ -34,8 +34,8 @@ export const PromptComposer: React.FC = () => {
|
||||
clearBrushStrokes,
|
||||
} = useAppStore();
|
||||
|
||||
const { generate } = useImageGeneration();
|
||||
const { edit } = useImageEditing();
|
||||
const { generate, cancelGeneration } = useImageGeneration();
|
||||
const { edit, cancelEdit } = useImageEditing();
|
||||
const [showAdvanced, setShowAdvanced] = useState(false);
|
||||
const [showClearConfirm, setShowClearConfirm] = useState(false);
|
||||
const [showHintsModal, setShowHintsModal] = useState(false);
|
||||
@@ -327,23 +327,26 @@ export const PromptComposer: React.FC = () => {
|
||||
|
||||
|
||||
{/* 生成按钮 */}
|
||||
<Button
|
||||
onClick={handleGenerate}
|
||||
disabled={isGenerating || !currentPrompt.trim()}
|
||||
className="w-full h-14 text-base font-medium"
|
||||
>
|
||||
{isGenerating ? (
|
||||
<>
|
||||
{isGenerating ? (
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
onClick={() => selectedTool === 'generate' ? cancelGeneration() : cancelEdit()}
|
||||
className="flex-1 h-14 text-base font-medium bg-red-500 hover:bg-red-600"
|
||||
>
|
||||
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-gray-900 mr-2" />
|
||||
生成中...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Wand2 className="h-4 w-4 mr-2" />
|
||||
{selectedTool === 'generate' ? '生成' : '应用编辑'}
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
中断
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<Button
|
||||
onClick={handleGenerate}
|
||||
disabled={!currentPrompt.trim()}
|
||||
className="w-full h-14 text-base font-medium"
|
||||
>
|
||||
<Wand2 className="h-4 w-4 mr-2" />
|
||||
{selectedTool === 'generate' ? '生成' : '应用编辑'}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{/* 高级控制 */}
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user