From 6c2aa98c9b08e1c5af53098b7a87271212ea44f4 Mon Sep 17 00:00:00 2001
From: hit-cxf <2024111082@stu.hit.edu.cn>
Date: Thu, 30 Apr 2026 10:26:05 +0800
Subject: [PATCH] 优化静态短视频pipeline的提示词

---
 aigc-director/aigc-claw/backend/prompts/pipelines/standard_image_prompt_generation_en.txt |   67 ++++++++++++++++++++++
 aigc-director/aigc-claw/frontend/components/pipelines/PipelinePage.tsx                    |   59 +++++++++++++++++++
 2 files changed, 124 insertions(+), 2 deletions(-)

diff --git a/aigc-director/aigc-claw/backend/prompts/pipelines/standard_image_prompt_generation_en.txt b/aigc-director/aigc-claw/backend/prompts/pipelines/standard_image_prompt_generation_en.txt
new file mode 100644
index 0000000..88cce6e
--- /dev/null
+++ b/aigc-director/aigc-claw/backend/prompts/pipelines/standard_image_prompt_generation_en.txt
@@ -0,0 +1,67 @@
+# Role Definition
+You are a professional visual creative designer, skilled at creating expressive and symbolic image prompts for video scripts, transforming abstract concepts into concrete visual scenes.
+
+# Core Task
+Based on the existing video script, create corresponding **English** image prompts for each storyboard's "narration content", ensuring visual scenes perfectly match the narrative content and enhance audience understanding and memory.
+
+**Important: The input contains {narrations_count} narrations. You must generate one corresponding image prompt for each narration, totaling {narrations_count} image prompts.**
+
+# Input Content
+{narrations_json}
+
+# Output Requirements
+
+## Image Prompt Specifications
+- Language: **Must use English** (for AI image generation models)
+- Description structure: scene + character action + emotion + symbolic elements
+- Description length: Ensure clear, complete, and creative descriptions (recommended 50-100 English words)
+
+## Visual Creative Requirements
+- Each image must accurately reflect the specific content and emotion of the corresponding narration
+- Use symbolic techniques to visualize abstract concepts (e.g., use paths to represent life choices, chains to represent constraints, etc.)
+- Scenes should express rich emotions and actions to enhance visual impact
+- Highlight themes through composition and element arrangement, avoid overly literal representations
+
+## Key English Vocabulary Reference
+- Symbolic elements: symbolic elements
+- Expression: expression / facial expression
+- Action: action / gesture / movement
+- Scene: scene / setting
+- Atmosphere: atmosphere / mood
+
+## Visual and Copy Coordination Principles
+- Images should serve the copy, becoming a visual extension of the copy content
+- Avoid visual elements unrelated to or contradicting the copy content
+- Choose visual presentation methods that best enhance the persuasiveness of the copy
+- Ensure the audience can quickly understand the core viewpoint of the copy through images
+
+## Creative Guidance
+1. **Phenomenon Description Copy**: Use intuitive scenes to represent social phenomena
+2. **Cause Analysis Copy**: Use visual metaphors of cause-and-effect relationships to represent internal logic
+3. **Impact Argumentation Copy**: Use consequence scenes or contrast techniques to represent the degree of impact
+4. **In-depth Discussion Copy**: Use concretization of abstract concepts to represent deep thinking
+5. **Conclusion Inspiration Copy**: Use open-ended scenes or guiding elements to represent inspiration
+
+# Output Format
+Strictly output in the following JSON format, **image prompts must be in English**:
+
+```json
+{{
+  "image_prompts": [
+    "[detailed English image prompt following the style requirements]",
+    "[detailed English image prompt following the style requirements]"
+  ]
+}}
+```
+
+# Important Reminders
+1. Only output JSON format content, do not add any explanations
+2. Ensure JSON format is strictly correct and can be directly parsed by the program
+3. Input is {{"narrations": [narration array]}} format, output is {{"image_prompts": [image prompt array]}} format
+4. **The output image_prompts array must contain exactly {narrations_count} elements, corresponding one-to-one with the input narrations array**
+5. **Image prompts must use English** (for AI image generation models)
+6. Image prompts must accurately reflect the specific content and emotion of the corresponding narration
+7. Each image must be creative and visually impactful, avoid being monotonous
+8. Ensure visual scenes can enhance the persuasiveness of the copy and audience understanding
+
+Now, please create {narrations_count} corresponding **English** image prompts for the above {narrations_count} narrations. Only output JSON, no other content.
diff --git a/aigc-director/aigc-claw/frontend/components/pipelines/PipelinePage.tsx b/aigc-director/aigc-claw/frontend/components/pipelines/PipelinePage.tsx
index 8183072..3fe6c70 100644
--- a/aigc-director/aigc-claw/frontend/components/pipelines/PipelinePage.tsx
+++ b/aigc-director/aigc-claw/frontend/components/pipelines/PipelinePage.tsx
@@ -4,14 +4,17 @@
 import {
   ArrowRight,
   CheckCircle,
+  Clapperboard,
   Clock,
   Image as ImageIcon,
   Loader2,
   Play,
   RefreshCw,
+  Repeat2,
   Settings2,
   SlidersHorizontal,
   Upload,
+  UserRound,
   Video,
   Volume2,
   X,
@@ -40,6 +43,7 @@
   VIDEO_RATIOS,
   type ProviderGroup,
 } from '@/config/models';
+import BrandHeader from '@/components/BrandHeader';
 
 type PipelineId = 'standard' | 'action_transfer' | 'digital_human';
 
@@ -64,6 +68,12 @@
   running: 'bg-blue-50 text-blue-600',
   completed: 'bg-green-50 text-green-600',
   failed: 'bg-red-50 text-red-600',
+};
+
+const PIPELINE_TITLE_ICONS = {
+  standard: Clapperboard,
+  action_transfer: Repeat2,
+  digital_human: UserRound,
 };
 
 function SelectField({
@@ -297,6 +307,35 @@
   return input.title || input.goods_title || input.text || input.prompt_text || input.goods_text || task.task_id;
 }
 
+type PipelineArtifact = NonNullable<PipelineTask['artifacts']>[number];
+
+function isFinalVideoArtifact(item: PipelineArtifact) {
+  if (item.kind !== 'video') return false;
+  const name = (item.name || '').toLowerCase();
+  const path = (item.path || '').toLowerCase();
+  return name === 'final' || path.endsWith('/final.mp4') || path.endsWith('\\final.mp4');
+}
+
+function FinalVideoResult({ item }: { item?: PipelineArtifact }) {
+  return (
+    <section className="mb-4 rounded-xl border border-blue-100 bg-blue-50/40 p-3">
+      <div className="mb-2 flex items-center gap-2">
+        <Video className="w-4 h-4 text-blue-600" />
+        <h3 className="text-sm font-semibold text-gray-800">最终视频</h3>
+      </div>
+      {item ? (
+        <div className="overflow-hidden rounded-lg border border-gray-200 bg-black">
+          <video src={assetHref(item.path)} controls className="w-full max-h-72 object-contain" />
+        </div>
+      ) : (
+        <div className="h-36 rounded-lg border border-dashed border-blue-200 bg-white/60 flex items-center justify-center text-sm text-gray-400">
+          最终视频生成后显示
+        </div>
+      )}
+    </section>
+  );
+}
+
 function TaskResult({ task }: { task: PipelineTask | null }) {
   const progress = Math.max(0, Math.min(100, task?.progress || 0));
 
@@ -321,9 +360,11 @@
   }
 
   const artifacts = task.artifacts || [];
+  const finalVideoArtifact = artifacts.find(isFinalVideoArtifact);
   const mediaArtifacts = artifacts
     .map((item, index) => ({ ...item, orderIndex: index }))
     .filter(item => ['audio', 'image', 'video'].includes(item.kind))
+    .filter(item => !isFinalVideoArtifact(item))
     .sort((a, b) => {
       const aTime = a.created_at ? Date.parse(a.created_at) : Number.NaN;
       const bTime = b.created_at ? Date.parse(b.created_at) : Number.NaN;
@@ -363,8 +404,14 @@
         />
       </div>
 
+      <FinalVideoResult item={finalVideoArtifact} />
+
       {mediaArtifacts.length > 0 ? (
         <div className="max-h-[28rem] overflow-y-auto pr-1">
+          <div className="mb-2 flex items-center gap-2">
+            <SlidersHorizontal className="w-4 h-4 text-gray-400" />
+            <h3 className="text-sm font-semibold text-gray-700">中间产物</h3>
+          </div>
           <div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
             {mediaArtifacts.map((item, index) => (
               <div
@@ -518,6 +565,7 @@
 }
 
 export default function PipelinePage({ pipeline, title, subtitle }: PipelinePageProps) {
+  const TitleIcon = PIPELINE_TITLE_ICONS[pipeline];
   const [showSettings, setShowSettings] = useState(false);
   const [running, setRunning] = useState(false);
   const [error, setError] = useState('');
@@ -528,6 +576,7 @@
   const [text, setText] = useState('');
   const [standardMode, setStandardMode] = useState<'inspiration' | 'copy'>('inspiration');
   const [titleValue, setTitleValue] = useState('');
+  const [standardSegmentCount, setStandardSegmentCount] = useState(6);
   const [enableSubtitles, setEnableSubtitles] = useState(false);
   const [promptText, setPromptText] = useState('');
   const [imagePath, setImagePath] = useState('');
@@ -645,6 +694,7 @@
             tts_voice: ttsVoice,
             tts_speed: ttsSpeed,
             style_control: negativePrompt || undefined,
+            segment_count: standardMode === 'inspiration' ? standardSegmentCount : undefined,
           })
         : pipeline === 'action_transfer'
           ? await startActionTransferPipeline({
@@ -677,10 +727,12 @@
 
   return (
     <div className="min-h-screen bg-gray-50/50 overflow-y-auto">
-      <div className="w-full max-w-6xl mx-auto px-6 pt-16 pb-8">
+      <BrandHeader />
+
+      <div className="w-full max-w-6xl mx-auto px-6 pt-10 pb-8">
         <div className="text-center mb-10">
           <div className="inline-flex items-center gap-2 mb-3">
-            <Play className="w-7 h-7 text-blue-500" />
+            <TitleIcon className="w-7 h-7 text-blue-500" />
             <h1 className="text-2xl font-bold text-gray-800">{title}</h1>
           </div>
           <p className="text-sm text-gray-500">{subtitle}</p>
@@ -712,6 +764,9 @@
                 />
                 <div className="grid grid-cols-1 md:grid-cols-2 gap-3">
                   <TextInput label="标题" value={titleValue} onChange={setTitleValue} placeholder="可选,留空时由llm生成" />
+                  {standardMode === 'inspiration' && (
+                    <NumberField label="片段数量" value={standardSegmentCount} onChange={setStandardSegmentCount} min={1} max={20} />
+                  )}
                 </div>
               </div>
             )}

--
Gitblit v1.8.0