"use client"; import { Box, Globe2, Loader2, RefreshCw, Zap } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, } from "@/components/ui/dialog"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Textarea } from "@/components/ui/textarea"; interface ThreeDModelOption { id: string; displayName: string; description?: string | null; } type ThreeDGenerationDialogMode = "model" | "world" | null; interface PromptRegenerateDialogProps { isProcessing: boolean; nodeId: string; onConfirm: () => void; onOpenChange: (open: boolean) => void; onPromptChange: (value: string) => void; open: boolean; prompt: string; } interface ThreeDGenerationDialogProps { costLabel?: string; costShortLabel?: string | null; isProcessing: boolean; mode: ThreeDGenerationDialogMode; onConfirm: () => void; onModeChange: (mode: ThreeDGenerationDialogMode) => void; onTripoModelChange: (value: string) => void; onWorldModelChange: (value: string) => void; selectedTripoModelEntry?: ThreeDModelOption | null; selectedTripoModelVersion: string; selectedWorldModelEntry?: ThreeDModelOption | null; selectedWorldModelVersion: string; tripoModelOptions: ThreeDModelOption[]; worldModelOptions: ThreeDModelOption[]; } export function PromptRegenerateDialog({ isProcessing, nodeId, onConfirm, onOpenChange, onPromptChange, open, prompt, }: PromptRegenerateDialogProps) { return ( 提示词重绘 在保留当前图片主体的基础上,用新提示词生成一张新图。原图不会被覆盖。 新提示词 onPromptChange(event.target.value)} placeholder="例如:保持主体不变,把背景改成黄昏海边,氛围光影更柔和,细节更丰富" rows={6} value={prompt} /> onOpenChange(false)} variant="outline"> 取消 {isProcessing ? ( ) : ( )} 开始重绘 ); } export function ThreeDGenerationDialog({ costLabel, costShortLabel, isProcessing, mode, onConfirm, onModeChange, onTripoModelChange, onWorldModelChange, selectedTripoModelEntry, selectedTripoModelVersion, selectedWorldModelEntry, selectedWorldModelVersion, tripoModelOptions, worldModelOptions, }: ThreeDGenerationDialogProps) { const isWorldMode = mode === "world"; const selectedEntry = isWorldMode ? selectedWorldModelEntry : selectedTripoModelEntry; const options = isWorldMode ? worldModelOptions : tripoModelOptions; return ( { if (!open) { onModeChange(null); } }} open={mode !== null} > {isWorldMode ? ( ) : ( )} {isWorldMode ? "选择 3D 世界模型" : "选择 3D 模型"} {isWorldMode ? "先选择用于图生世界的生成质量,再开始创建 3D 世界任务。" : "先选择用于图生 3D 的模型版本,再开始创建 3D 模型任务。"} {isWorldMode ? "世界模型" : "模型版本"} { if (isWorldMode) { onWorldModelChange(value); return; } onTripoModelChange(value); }} value={ isWorldMode ? selectedWorldModelVersion : selectedTripoModelVersion } > {options.map((option) => ( {option.displayName} ))} {selectedEntry?.displayName || "未选择模型"} {selectedEntry?.description || "当前模型暂无说明。"} {costLabel ? ( {costLabel} ) : null} onModeChange(null)} variant="outline"> 取消 void onConfirm()} > {isProcessing ? ( ) : isWorldMode ? ( ) : ( )} 开始生成 {costShortLabel ? ( {costShortLabel} ) : null} ); }
在保留当前图片主体的基础上,用新提示词生成一张新图。原图不会被覆盖。
{isWorldMode ? "先选择用于图生世界的生成质量,再开始创建 3D 世界任务。" : "先选择用于图生 3D 的模型版本,再开始创建 3D 模型任务。"}