diff --git a/components/scene-fusion-dialog.tsx b/components/scene-fusion-dialog.tsx index 3ff76f9a2..f28b80066 100644 --- a/components/scene-fusion-dialog.tsx +++ b/components/scene-fusion-dialog.tsx @@ -18,7 +18,7 @@ interface SceneFusionDialogProps { export function SceneFusionDialog({ open, onOpenChange }: SceneFusionDialogProps) { return ( - + 批量处理 批量处理图片与场景裂变。 @@ -28,4 +28,3 @@ export function SceneFusionDialog({ open, onOpenChange }: SceneFusionDialogProps ); } - diff --git a/components/scene-fusion-view.tsx b/components/scene-fusion-view.tsx index 87408c18c..8cd680099 100644 --- a/components/scene-fusion-view.tsx +++ b/components/scene-fusion-view.tsx @@ -3,6 +3,7 @@ import React, { useEffect, useMemo, useRef, useState } from "react"; import useSWR from "swr"; import { + CheckCircle2, Download, Image as ImageIcon, Layers, @@ -13,6 +14,7 @@ import { Trash2, Upload, Wand2, + Eraser, } from "lucide-react"; import { toast } from "sonner"; import { requestLongTaskResult } from "@/lib/client/long-task"; @@ -73,12 +75,12 @@ const randomBackgroundStyles = [ "高端商业橱窗", ]; -const modeOptions: Array<{ id: BatchMode; label: string; description: string }> = [ - { id: "scene-fission", label: "裂变场景", description: "1张产品图 + 多张参考图" }, - { id: "random-bg", label: "随机换背景", description: "1张图随机生成多种背景" }, - { id: "rmbg", label: "批量抠图", description: "多图同步去背景" }, - { id: "enhance", label: "批量变清晰", description: "多图同步增强画质" }, - { id: "watermark", label: "批量去水印", description: "多图同步去除水印" }, +const modeOptions: Array<{ id: BatchMode; label: string; description: string; icon: React.ComponentType<{ className?: string }> }> = [ + { id: "scene-fission", label: "裂变场景", description: "1张产品图 + 多张参考图", icon: Layers }, + { id: "random-bg", label: "随机换背景", description: "1张图随机生成多种背景", icon: Wand2 }, + { id: "rmbg", label: "批量抠图", description: "多图同步去背景", icon: Eraser }, + { id: "enhance", label: "批量变清晰", description: "多图同步增强画质", icon: Sparkles }, + { id: "watermark", label: "批量去水印", description: "多图同步去除水印", icon: RefreshCw }, ]; function getModeActionLabel(mode: BatchMode, count: number) { @@ -699,7 +701,7 @@ export function SceneFusionView({ onBack, initialProductImage, initialProductNam return (
-
+
@@ -712,8 +714,8 @@ export function SceneFusionView({ onBack, initialProductImage, initialProductNam
- -
+
+
@@ -722,15 +724,29 @@ export function SceneFusionView({ onBack, initialProductImage, initialProductNam key={option.id} type="button" onClick={() => setMode(option.id)} + aria-pressed={mode === option.id} className={cn( - "rounded-lg border px-3 py-2 text-left transition-colors", + "rounded-lg border px-3 py-2 text-left transition-all duration-150 active:scale-[0.99]", mode === option.id - ? "border-primary bg-primary/10" - : "border-border bg-background hover:bg-muted/60" + ? "border-primary bg-primary/12 shadow-[0_0_0_1px_hsl(var(--primary)/0.35)]" + : "border-border bg-background hover:bg-muted/60 hover:border-primary/40" )} > -
{option.label}
-
{option.description}
+
+
+ +
+
{option.label}
+
{option.description}
+
+
+ {mode === option.id && } +
))}
@@ -1019,7 +1035,7 @@ export function SceneFusionView({ onBack, initialProductImage, initialProductNam
)}
- +
-
+

处理结果

{resultItems.some((item) => item.status === "completed") && (