Spaces:
Running
Running
feat: update image handling in node_player_step for improved scene transitions
Browse files- src/agent/llm_graph.py +5 -1
src/agent/llm_graph.py
CHANGED
@@ -95,11 +95,15 @@ async def node_player_step(state: GraphState) -> GraphState:
|
|
95 |
}
|
96 |
)
|
97 |
change_scene = await generate_image_prompt(next_scene["description"], state.user_hash)
|
|
|
|
|
|
|
|
|
98 |
image_task = generate_scene_image.ainvoke(
|
99 |
{
|
100 |
"user_hash": state.user_hash,
|
101 |
"scene_id": next_scene["scene_id"],
|
102 |
-
"current_image":
|
103 |
"change_scene": change_scene,
|
104 |
}
|
105 |
)
|
|
|
95 |
}
|
96 |
)
|
97 |
change_scene = await generate_image_prompt(next_scene["description"], state.user_hash)
|
98 |
+
current_image = None
|
99 |
+
if scene_id and scene_id in user_state.scenes:
|
100 |
+
current_image = user_state.scenes[scene_id].image
|
101 |
+
|
102 |
image_task = generate_scene_image.ainvoke(
|
103 |
{
|
104 |
"user_hash": state.user_hash,
|
105 |
"scene_id": next_scene["scene_id"],
|
106 |
+
"current_image": current_image,
|
107 |
"change_scene": change_scene,
|
108 |
}
|
109 |
)
|