habib926653
commited on
updating prompt
Browse files
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 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
5. Keep
|
69 |
-
6. Negatives
|
70 |
-
7.
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
**
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|