feat(图像生成): 修改提示词模板以支持主题和详情参数
将图像生成的提示词模板从单一prompt参数改为支持topic和detail两个参数 更新中英文语言文件中的提示词模板,改为写实摄影风格要求
This commit is contained in:
@@ -655,6 +655,8 @@ export function useThinkFlow({ t, locale }: { t: Translate; locale: Ref<string>
|
||||
const finalApiKey = apiConfig.mode === 'default' ? useConfig.apiKey || API_KEY : useConfig.apiKey
|
||||
|
||||
try {
|
||||
const topic = node.data.label || prompt
|
||||
const detail = node.data.description || ''
|
||||
const response = await fetch(useConfig.baseUrl, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -663,7 +665,7 @@ export function useThinkFlow({ t, locale }: { t: Translate; locale: Ref<string>
|
||||
},
|
||||
body: JSON.stringify({
|
||||
model: useConfig.model,
|
||||
prompt: t('prompts.image', { prompt })
|
||||
prompt: t('prompts.image', { topic, detail })
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
},
|
||||
"prompts": {
|
||||
"system": "You are a mind-mapping assistant that helps users expand their ideas layer by layer into a thinking tree.\n\nWorkflow:\n1. User provides an initial idea (or selects an existing node).\n2. Understand user intent based on the [Thinking Context Path] (trace from root to current node).\n3. Generate 3-5 deeper or related sub-ideas.\n4. Each sub-idea includes a short name and a minimal description.\n\nResponse format must be strict JSON:\n{'{'}\n \"nodes\": [\n {'{'} \"text\": \"Sub-idea 1 Name\", \"description\": \"One-sentence description\" {'}'},\n {'{'} \"text\": \"Sub-idea 2 Name\", \"description\": \"One-sentence description\" {'}'}\n ]\n{'}'}\n\nNote: Return ONLY JSON, no explanation.",
|
||||
"image": "A beautiful book art illustration, theme: {prompt}. Style: Exquisite picture book aesthetic, warm tones, soft lighting, elegant and poetic composition that tells a story. Details: High-quality brushwork, minimalist yet decorative, suitable as a visual centerpiece for a mind map. STRICT REQUIREMENT: No text, letters, or characters in the image.",
|
||||
"image": "A high-quality photorealistic, camera-like image. Subject/Concept: {topic}. Details/Traits: {detail}. Requirements: realistic materials and fine details, correct perspective and proportions, natural or cinematic lighting, clean background, premium composition, restrained color palette—suitable as a visual centerpiece for a mind map. Quality: ultra sharp, high resolution, natural depth of field. STRICTLY FORBIDDEN: any text/watermark/logo; cartoon/illustration/picture-book style, hand-drawn, anime, 3D render look, heavy filters, distortion, blur, low-res.",
|
||||
"continue": "Please continue exploring",
|
||||
"coreIdeaPrefix": "Core Idea",
|
||||
"contextPath": "Thinking Context Path",
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
},
|
||||
"prompts": {
|
||||
"system": "你是一个思维发散助手,帮助用户将想法逐层展开,构建思维树。\n\n工作流程:\n1. 用户给出一个初始想法(或选择一个已有节点继续追问)。\n2. 你需要根据【思考上下文路径】(即从根节点到当前节点的思考链路)来理解用户的意图。\n3. 生成 3-5 个更深层或相关维度的子想法。\n4. 每个子想法包含简短名称和极简描述。\n\n返回格式必须为严格 JSON:\n{'{'}\n \"nodes\": [\n {'{'} \"text\": \"子想法1名称\", \"description\": \"一句话描述\" {'}'},\n {'{'} \"text\": \"子想法2名称\", \"description\": \"一句话描述\" {'}'}\n ]\n{'}'}\n\n注意:只返回 JSON,不附加解释。",
|
||||
"image": "这是一张精美的艺术插画,主题是:{prompt}。风格要求:具有精致的绘本感,构图优美且富有诗意,像是在讲述一个故事。细节要求:高质量的笔触,极简主义与装饰艺术结合,适合作为思维导图的视觉核心。严禁:图片中不得出现任何文字、字母或字符。",
|
||||
"image": "这是一张高质量写实摄影风格的图片。主体/概念:{topic}。详情/特征:{detail}。画面要求:真实材质与细节、准确透视与比例、自然光或电影级布光、干净背景与高级构图、色彩克制,适合作为思维导图的视觉核心。质量:超清、锐利、噪点控制自然、层次分明的景深。严禁:任何文字/水印/Logo;卡通、插画、绘本、手绘、漫画、动漫、3D 渲染感、过度滤镜、变形、模糊、低清。",
|
||||
"continue": "请继续深入发散",
|
||||
"coreIdeaPrefix": "核心想法",
|
||||
"contextPath": "思考上下文路径",
|
||||
|
||||
Reference in New Issue
Block a user