Skip to content

Commit

Permalink
Removed the random "image purpose" aspect, since it was creating too …
Browse files Browse the repository at this point in the history
…much craziness.
  • Loading branch information
btfranklin committed Oct 29, 2024
1 parent 38644d1 commit 9a9911e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@

## System Message

You are an expert storyteller. You will be provided with a summary of the story concept, as well as the narrative of the story up to this point, and the purpose of the next image in the story. Your task is to generate a description of the next image that will be used in the story.
You are an expert storyteller. You will be provided with a summary of the story concept, as well as the narrative of the story up to this point. Your task is to generate a description of an image that shows the next major event in the story.

Focus on the key elements, emotions, and any noticeable details or themes present in the image. Your description should be vivid and comprehensive but remain concise enough to capture the essence of the image without unnecessary elaboration.

The image should not illustrate what has already happened, but rather what will happen next. The image should be as creative, imaginative, and interesting as possible.
The image should not illustrate what has already happened, but rather what will happen next. The image should be as creative, imaginative, and interesting as possible. Don't be afraid to go off the rails and include some unexpected elements or themes.

DO NOT write any narratives or story elements. Just describe the image visually, with a literal and purely visual description of exactly what it depicts. Do not include any character names, plot points, or any other story elements, since these are not visual language elements.

However, the image should reflect the purpose of the next moment in the story, as provided.

Be concise and direct. Keep your description to one or two sentences.

## Conversation

**User:**
Story concept: {story_concept}
Story narrative so far: {story_narrative}
Purpose: {image_purpose}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

from spooklight.model import Story
from spooklight.settings import Settings
from spooklight.stepgeneration.select_random_purpose import (
select_random_purpose,
)


def generate_next_image_description(llm_client: OpenAI, story: Story) -> str:
Expand All @@ -21,18 +18,13 @@ def generate_next_image_description(llm_client: OpenAI, story: Story) -> str:
for step in story.steps:
story_narrative += step.narrative

# Randomly select the next image's purpose for the story
image_purpose = select_random_purpose()
print(Fore.BLUE + "Image purpose: " + Fore.YELLOW + image_purpose)

structured_prompt = StructuredPrompt.from_package_resource(
package="spooklight.stepgeneration",
resource_name="generate_next_image_description.prompt.md",
)
template_values = {
"story_concept": story.concept,
"story_narrative": story_narrative,
"image_purpose": image_purpose,
}
structured_prompt.apply_template_values(template_values)
messages = structured_prompt.to_chat_completion_messages()
Expand Down
27 changes: 0 additions & 27 deletions src/spooklight/stepgeneration/select_random_purpose.py

This file was deleted.

0 comments on commit 9a9911e

Please sign in to comment.