feat(canvas): 文本生成 - 独立文本份数 textCount(不再误用生图数量)
- metadata 新增 textCount - 执行器不再复用餐 count,文本份数独立默认 1 - 配置节点与文本节点面板增加「文本份数」入口(1-15)
This commit is contained in:
1 parent
a95ff6f0d0
commit
e4c0f8f585
4 files changed
+26
-6
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useMemo, useRef, useState, type CSSProperties, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent, type ReactNode } from "react";
|
||||
import { ArrowUp, AtSign, Boxes, ChevronDown, FileText, ImageIcon, ImagePlus, Maximize2, Music2, Pencil, SlidersHorizontal, Square, UserRound, Video } from "lucide-react";
|
||||
import { Button, Image as AntImage, Modal, Tooltip } from "antd";
|
||||
import { Button, Image as AntImage, InputNumber, Modal, Tooltip } from "antd";
|
||||
|
||||
import { ModelPicker } from "@/components/model-picker";
|
||||
import { defaultConfig, modelOptionName, resolveModelChannel, useEffectiveConfig, type AiConfig } from "@/stores/use-config-store";
|
||||
@@ -261,7 +261,19 @@ export function CanvasNodePromptPanel({ node, isRunning, onPromptChange, onConfi
|
||||
/>
|
||||
</div>
|
||||
<div className="ml-auto flex min-w-0 shrink-0 items-center gap-1">
|
||||
{mode === "image" ? (
|
||||
{mode === "text" ? (
|
||||
<Tooltip title={`文本生成份数(默认 1,可在生成配置中调整)`}>
|
||||
<InputNumber
|
||||
size="small"
|
||||
min={1}
|
||||
max={15}
|
||||
value={Math.max(1, Math.min(15, Math.floor(Math.abs(Number(node.metadata?.textCount) || 1))))}
|
||||
onChange={(value) => onConfigChange(node.id, { textCount: Math.max(1, Math.min(15, Math.floor(Math.abs(Number(value)) || 1))) })}
|
||||
aria-label="文本生成份数"
|
||||
className="!w-14 !h-7 [&_.ant-input-number-input]:!text-[var(--fs-tiny)]"
|
||||
/>
|
||||
</Tooltip>
|
||||
) : mode === "image" ? (
|
||||
<CanvasImageSettingsPopover
|
||||
config={config}
|
||||
placement={expanded ? "topRight" : "topLeft"}
|
||||
|
||||
Reference in new issue
Block a user