habib926653 commited on
Commit
00a24f4
·
verified ·
1 Parent(s): 28f3522

updating prompt

Browse files
Files changed (1) hide show
  1. utils.py +34 -28
utils.py CHANGED
@@ -58,34 +58,40 @@ def get_image_prompts(text_input : List, summary):
58
  chunks_count = len(text_input)
59
  chunks = "chunk: " + "\nchunk: ".join(text_input)
60
  prompt = f"""
61
-
62
- ROLE: You are a Highly Experienced Image Prompt Sythesizer
63
-
64
- SYSTEM PROMPT: Given the Overall Summary and All Chunks of the Text
65
- 1. Use Summary and Combined context of all chunks because if you read all chunks in a sequence it is the script
66
- 3. **Identify the theme** and setting of the complete text
67
- 4. For each chunk read the chunk and its summary, then create a simple, focused Context-aware image prompt based on key visual elements from both
68
- 5. Keep Image Style as 3D (MUST BE FOLLOWED)
69
- 6. Negatives: Hyper-Realistic, Real Life Human
70
- 7. Ensure that concsistent theme follows over the whole script
71
-
72
-
73
- ### Example
74
- summary: this text is a story of guy who went to jungle and a lion
75
- **Chunks**:
76
- 1. A guy went to the jungle.
77
- 2. He saw a lion.
78
-
79
- **Combined Context**:
80
- "A man ventured into a jungle and encountered a lion."
81
-
82
- **Prompts**:
83
- - **Chunk 1**: "[style: 3D| theme: dark jungle] A man walking into a dense, green jungle, with tall trees and sunlight filtering through the leaves."
84
- - **Chunk 2**: "[style: 3D| theme: dark jungle] In a jungle clearing, a lion stands majestically, its golden mane glowing in the soft sunlight as it watches the man silently."
85
-
86
- NOTE: Never write a prompt that can generate NSFW images, or any other explicit content, use safe and appropriate prompts
87
-
88
- TASK: Here is the summary: {summary}\n\n and \n\n Total of {chunks_count} chunks, Generate an Image Prompt Each per chunk\n\n {chunks}"""
 
 
 
 
 
 
89
  result = extractor.extract(prompt)
90
  return result.model_dump() # returns dictionary version pydantic model
91
 
 
58
  chunks_count = len(text_input)
59
  chunks = "chunk: " + "\nchunk: ".join(text_input)
60
  prompt = f"""
61
+ ROLE: You are a Highly Experienced Image Prompt Synthesizer
62
+ SYSTEM PROMPT: Given the Overall Summary and All Chunks of the Text:
63
+ 1. Read the summary and the combined context of all chunks (the entire script).
64
+ 2. **Identify the central theme and setting** of the complete text.
65
+ 3. For each chunk, examine both the chunk and its summary, then create a **focused, context-aware image prompt** based on key visual elements.
66
+ 4. **Ensure thematic consistency across all chunks:**
67
+ - The environment, mood, and lighting must remain true to the established theme (e.g., a dark, eerie jungle remains consistently dark and mysterious throughout).
68
+ 5. **Keep the image style as 3D (this MUST be followed).**
69
+ 6. **Negatives:** Do not include hyper-realistic elements or real-life human depictions, and avoid any out-of-context settings (e.g., a park in a jungle story).
70
+ 7. **Use mood-specific lighting and color palettes:**
71
+ - For example, if the theme is a dark jungle, use deep greens, blacks, misty blues, and dim moonlight.
72
+ - Ensure that all visual elements (fog, shadows, expressions) support the horror/suspense atmosphere.
73
+ 8. NEVER generate prompts that could lead to NSFW images or any explicit content. Use safe and appropriate descriptions.
74
+
75
+ ### Example:
76
+ **Summary:**
77
+ This text is a story of a man who ventured into a dark jungle and encountered a mysterious lion.
78
+
79
+ **Chunks:**
80
+ 1. A man enters the dark jungle, mist swirling around him.
81
+ 2. He comes face-to-face with a majestic yet eerie lion.
82
+
83
+ **Combined Context:**
84
+ "A man ventures into a dense, eerie jungle and unexpectedly meets a mysterious lion."
85
+
86
+ **Generated Prompts:**
87
+ - **Chunk 1:**
88
+ "[style: 3D | theme: dark jungle] A lone man steps into a dense, eerie jungle at twilight. Thick mist swirls around his feet as towering, twisted trees loom overhead. Dim, bluish moonlight filters through the foliage, casting long, haunting shadows."
89
+
90
+ - **Chunk 2:**
91
+ "[style: 3D | theme: dark jungle] In a clearing within the jungle, a majestic lion appears with an unsettling aura. Its eyes glow faintly in the dim light, and the surrounding trees seem to lean in, enhancing the mysterious tension."
92
+
93
+ TASK: Here is the summary: {summary}\n\n and \n\n Total of {chunks_count} chunks, generate an Image Prompt for each chunk\n\n {chunks}
94
+ """
95
  result = extractor.extract(prompt)
96
  return result.model_dump() # returns dictionary version pydantic model
97