mgbam commited on
Commit
46e90a1
·
verified ·
1 Parent(s): b8af44f

Rename prompts/system_prompts.py to prompts/image_style_prompts.py

Browse files
prompts/image_style_prompts.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # storyverse_weaver/prompts/image_style_prompts.py
2
+
3
+ # These are more like keywords or modifiers than full prompts for the image model
4
+ # The main image prompt will come from the user's scene description or the LLM's narrative.
5
+
6
+ DEFAULT_IMAGE_PROMPT_PREFIX = "cinematic still, "
7
+ DEFAULT_IMAGE_PROMPT_SUFFIX = ", 4k, highly detailed, sharp focus"
8
+
9
+ # Example style presets (keywords to append to the main content prompt)
10
+ STYLE_PRESETS = {
11
+ "Default": "",
12
+ "Photorealistic": "photorealistic, hyperrealistic, photography, ",
13
+ "Cinematic Film": "cinematic film still, dramatic lighting, anamorphic lens, film grain, ",
14
+ "Anime / Manga": "anime style, manga art, vibrant colors, dynamic lines, cel shading, ",
15
+ "Studio Ghibli Inspired": "Studio Ghibli style, pastoral, whimsical, hand-drawn look, lush nature, soft lighting, ",
16
+ "Cyberpunk": "cyberpunk art, neon lights, futuristic city, dystopian, rain, high tech low life, ",
17
+ "Fantasy Art": "fantasy illustration, epic, detailed, magical, D&D art style, ",
18
+ "Watercolor Painting": "watercolor painting, soft edges, flowing colors, textured paper, ",
19
+ "Oil Painting": "oil painting, classic, textured brush strokes, rich colors, ",
20
+ "Pixel Art": "pixel art, retro, 8-bit, 16-bit, sprite, ",
21
+ "Concept Art": "concept art, matte painting, environment design, character design sketch, ",
22
+ "Low Poly": "low poly 3D render, geometric, minimalist, "
23
+ }
24
+
25
+ # Example negative prompts often useful for image generation
26
+ COMMON_NEGATIVE_PROMPTS = "ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, deformed, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft, text, words, simple background, boring, ((deformed hands))"
27
+
28
+ def get_image_style_keywords(style_name: str) -> str:
29
+ return STYLE_PRESETS.get(style_name, "")
30
+
31
+ def format_image_generation_prompt(base_content_prompt: str, style_name: str = "Default", artist_inspiration: str = None) -> str:
32
+ style_keywords = get_image_style_keywords(style_name)
33
+ artist_str = f", in the style of {artist_inspiration}" if artist_inspiration and artist_inspiration.strip() else ""
34
+
35
+ # Ensure base_content_prompt is descriptive enough
36
+ if len(base_content_prompt.split()) < 5: # If very short, add more generic terms
37
+ base_content_prompt += ", visually interesting scene"
38
+
39
+ return f"{DEFAULT_IMAGE_PROMPT_PREFIX}{base_content_prompt}{artist_str}, {style_keywords}{DEFAULT_IMAGE_PROMPT_SUFFIX}"
40
+
41
+ print("DEBUG: prompts.image_style_prompts (for StoryVerseWeaver) - Module defined.")
prompts/system_prompts.py DELETED
@@ -1,48 +0,0 @@
1
- # algoforge_prime/prompts/system_prompts.py
2
-
3
- PROMPTS_CONFIG = {
4
- # ... (genesis_general, genesis_python, critique_general remain the same as before)
5
- "genesis_general": {
6
- "description": "For generating diverse algorithmic ideas.",
7
- "content": ("You are an exceptionally creative AI Algorithm Inventor...") # Full content
8
- },
9
- "genesis_python": {
10
- "description": "For generating Python code solutions.",
11
- "content": ("You are an expert Python Programmer... Output only the Python code block...") # Full content
12
- },
13
- "critique_general": {
14
- "description": "For evaluating algorithmic solutions with scoring.",
15
- "content": ("You are a meticulous, impartial AI Algorithm Quality Assurance Engine... **YOU MUST provide this score in the exact format 'Score: X/10' where X is an integer from 1 (very poor) to 10 (excellent).** ...") # Full content
16
- },
17
- "evolution_general": { # Updated to be more directive about fixing tests
18
- "description": "For refining and improving existing solutions based on critique AND EXECUTION FEEDBACK.",
19
- "content": (
20
- "You are an AI Master Algorithm Refiner, Debugger, and Optimizer. You are given an existing solution, its original score, and a detailed comprehensive evaluation which includes LLM critique AND crucial feedback from automated test execution (pass/fail status, error messages). "
21
- "Your objective is to evolve this solution into a demonstrably superior version. This means: "
22
- "1. **PRIORITY ONE: DEBUGGING & TEST PASSING:** Directly address and fix any execution errors or failed unit tests reported in the evaluation. Your evolved code *must* aim to pass these tests. "
23
- "2. **ADDRESSING CRITIQUE:** Incorporate feedback from the qualitative LLM critique regarding efficiency, clarity, robustness, or completeness. "
24
- "3. **ENHANCING STRENGTHS:** If the code was good but had minor issues, make it excellent. "
25
- "Your output should be ONLY the *complete, raw, evolved Python code block*. "
26
- "Follow this with a separate, concise explanation (after the code block, perhaps marked `## Evolution Explanation:`) detailing the key changes you made, SPECIFICALLY how you addressed any test failures or execution issues, and any other improvements."
27
- )
28
- },
29
- "code_execution_explainer": { # For analyzing test results of the *final* evolved code
30
- "description": "For explaining unit test results of generated code.",
31
- "content": ( # Slightly more directive
32
- "You are an AI Code Analysis Assistant. You will be given Python code, a set of unit tests (assert statements), and a summary of the test execution results (e.g., number passed/failed, any error messages). "
33
- "Your task is to provide a concise, insightful analysis of these test results in relation to the provided code. "
34
- "If tests failed, clearly explain the likely reasons for each failure by referencing specific parts of the code and the failing assertions. "
35
- "If tests passed, confirm what this implies about the code's behavior regarding those assertions. "
36
- "Focus on being helpful, diagnostic, and pinpointing potential bugs or areas for improvement based *only* on the code and test results."
37
- )
38
- }
39
- }
40
-
41
- def get_system_prompt(key_name: str, problem_type: str = None) -> str:
42
- # ... (same as your last working version)
43
- if key_name == "genesis" and problem_type and "python" in problem_type.lower(): key_to_use = "genesis_python"
44
- else: key_to_use = key_name
45
- prompt_data = PROMPTS_CONFIG.get(key_to_use)
46
- if prompt_data: return prompt_data["content"]
47
- print(f"WARNING: system_prompts.py - System prompt key '{key_name}' not found. Returning empty.")
48
- return ""