StoryVerseWeaver / prompts /image_style_prompts.py
mgbam's picture
Rename prompts/system_prompts.py to prompts/image_style_prompts.py
46e90a1 verified
# storyverse_weaver/prompts/image_style_prompts.py
# These are more like keywords or modifiers than full prompts for the image model
# The main image prompt will come from the user's scene description or the LLM's narrative.
DEFAULT_IMAGE_PROMPT_PREFIX = "cinematic still, "
DEFAULT_IMAGE_PROMPT_SUFFIX = ", 4k, highly detailed, sharp focus"
# Example style presets (keywords to append to the main content prompt)
STYLE_PRESETS = {
"Default": "",
"Photorealistic": "photorealistic, hyperrealistic, photography, ",
"Cinematic Film": "cinematic film still, dramatic lighting, anamorphic lens, film grain, ",
"Anime / Manga": "anime style, manga art, vibrant colors, dynamic lines, cel shading, ",
"Studio Ghibli Inspired": "Studio Ghibli style, pastoral, whimsical, hand-drawn look, lush nature, soft lighting, ",
"Cyberpunk": "cyberpunk art, neon lights, futuristic city, dystopian, rain, high tech low life, ",
"Fantasy Art": "fantasy illustration, epic, detailed, magical, D&D art style, ",
"Watercolor Painting": "watercolor painting, soft edges, flowing colors, textured paper, ",
"Oil Painting": "oil painting, classic, textured brush strokes, rich colors, ",
"Pixel Art": "pixel art, retro, 8-bit, 16-bit, sprite, ",
"Concept Art": "concept art, matte painting, environment design, character design sketch, ",
"Low Poly": "low poly 3D render, geometric, minimalist, "
}
# Example negative prompts often useful for image generation
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))"
def get_image_style_keywords(style_name: str) -> str:
return STYLE_PRESETS.get(style_name, "")
def format_image_generation_prompt(base_content_prompt: str, style_name: str = "Default", artist_inspiration: str = None) -> str:
style_keywords = get_image_style_keywords(style_name)
artist_str = f", in the style of {artist_inspiration}" if artist_inspiration and artist_inspiration.strip() else ""
# Ensure base_content_prompt is descriptive enough
if len(base_content_prompt.split()) < 5: # If very short, add more generic terms
base_content_prompt += ", visually interesting scene"
return f"{DEFAULT_IMAGE_PROMPT_PREFIX}{base_content_prompt}{artist_str}, {style_keywords}{DEFAULT_IMAGE_PROMPT_SUFFIX}"
print("DEBUG: prompts.image_style_prompts (for StoryVerseWeaver) - Module defined.")