From 0cce95fd610aec4b36d7830e74358e7686355e27 Mon Sep 17 00:00:00 2001
From: Xinfan Chen <2024111082@stu.hit.edu.cn>
Date: Mon, 30 Mar 2026 23:43:56 +0800
Subject: [PATCH] Fixed the issue where visual cues could not be modified during the reference image generation and video generation phases

---
 aigc-director/aigc-claw/frontend/components/stages/ReferenceStage.tsx |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/aigc-director/aigc-claw/frontend/components/stages/ReferenceStage.tsx b/aigc-director/aigc-claw/frontend/components/stages/ReferenceStage.tsx
index 05d8943..96a5887 100644
--- a/aigc-director/aigc-claw/frontend/components/stages/ReferenceStage.tsx
+++ b/aigc-director/aigc-claw/frontend/components/stages/ReferenceStage.tsx
@@ -343,7 +343,7 @@
     setSavingIds(prev => new Set(prev).add(sceneId));
     try {
       // 调用后端 API 保存提示词
-      const response = await fetch(`/api/project/${sessionId}/artifact/storyboard`, {
+      const response = await fetch(`/api/project/${sessionId}/artifact/reference_generation`, {
         method: 'PATCH',
         headers: { 'Content-Type': 'application/json' },
         body: JSON.stringify({
@@ -362,6 +362,13 @@
         });
         // 更新本地状态,使用保存后的值
         setEditDescs(prev => ({ ...prev, [sceneId]: newPrompt }));
+        // 同步更新 artifact 以便后续阶段能获取最新的提示词
+        if (onUpdateArtifact && state.artifact?.scenes) {
+          const updatedScenes = state.artifact.scenes.map((s: SceneItem) =>
+            s.id === sceneId ? { ...s, description: newPrompt } : s
+          );
+          onUpdateArtifact({ scenes: updatedScenes });
+        }
       }
     } catch (error) {
       console.error('保存提示词失败:', error);

--
Gitblit v1.8.0