Pixcribe / scene_prompts.py
DawnC's picture
Upload 22 files
6a3bd1f verified
from typing import Dict, List
class ScenePrompts:
"""
場景描述 Prompt 庫
提供多元化場景類型的詳細視覺描述
涵蓋:城市、自然、室內、食物、人物、產品等場景
"""
def __init__(self):
"""初始化場景詞彙庫"""
self.scene_vocabularies = {
# ===== 城市場景 Urban =====
'urban': {
'city_canyon': [
'urban canyon with towering skyscrapers lining both sides of street creating vertical corridor',
'metropolitan corridor formed by tall buildings with strong vertical emphasis and symmetrical composition',
'downtown street flanked by modern high-rise architecture creating canyon effect',
'city street with tall buildings on both sides creating narrow vertical perspective'
],
'street_level': [
'bustling city street with pedestrians and vehicles in urban environment',
'urban sidewalk scene with street furniture storefronts and mixed activity',
'downtown pedestrian area with commercial buildings and urban infrastructure',
'street view with urban architecture shops and people walking'
],
'skyline': [
'city skyline with skyscrapers silhouetted against sky',
'urban panorama showing downtown high-rise buildings and city sprawl',
'metropolitan skyline view from elevated vantage point',
'cityscape with distinctive tall buildings defining horizon line'
],
'plaza': [
'urban plaza with open public space and surrounding architecture',
'city square with pedestrians monuments and commercial buildings',
'downtown plaza featuring fountains sculptures and gathering spaces',
'public square with mixed use of recreational and commercial activities'
]
},
# ===== 自然風景 Nature =====
'nature': {
'mountain': [
'majestic mountain range with snow-capped peaks against blue sky',
'alpine landscape with rocky summits and glacial valleys',
'mountain vista with layered ridges fading into distance creating depth',
'dramatic mountain scenery with rugged peaks and alpine vegetation',
'mountainous terrain with steep slopes and varied elevation'
],
'beach': [
'serene beach with turquoise water and white sand shore',
'coastal scene with gentle waves lapping at sandy beach',
'tropical beach with clear water and palm tree shadows',
'beach landscape with ocean horizon and coastal features',
'seaside view with beach sand water and sky meeting at horizon'
],
'forest': [
'lush forest with dense canopy and dappled sunlight filtering through trees',
'woodland scene with tall trees and undergrowth vegetation',
'forest interior with tree trunks and leafy canopy overhead',
'dense forest landscape with natural vegetation and organic forms',
'wooded area with trees creating natural shade and green environment'
],
'lake': [
'tranquil lake with still water reflecting surrounding landscape',
'mountain lake with clear water and scenic backdrop',
'lakeside view with calm water and shoreline vegetation',
'peaceful lake scene with water sky and natural surroundings',
'alpine lake with pristine water and mountain reflections'
],
'desert': [
'desert landscape with sand dunes and arid terrain',
'sandy desert with undulating dunes and clear sky',
'arid desert scene with sparse vegetation and sandy ground',
'desert vista with sand formations and minimal vegetation',
'dry desert landscape with sand rock and desert plants'
],
'waterfall': [
'cascading waterfall with flowing water over rocks',
'waterfall scene with water spray and lush surrounding vegetation',
'natural waterfall with water rushing down cliff face',
'scenic waterfall with water pool and natural setting',
'tiered waterfall with multiple cascades and mist'
]
},
# ===== 室內場景 Indoor =====
'indoor': {
'cafe': [
'cozy cafe interior with warm ambient lighting and wooden furniture',
'modern coffee shop with industrial decor and minimalist design',
'rustic cafe setting with vintage decorations and soft lighting',
'contemporary cafe space with comfortable seating and artistic elements',
'intimate coffee shop with warm atmosphere and inviting ambiance'
],
'restaurant': [
'upscale restaurant interior with elegant table settings and refined decor',
'casual dining space with comfortable seating and welcoming atmosphere',
'fine dining restaurant with sophisticated lighting and premium furnishings',
'restaurant setting with tables chairs and ambient lighting',
'dining establishment with culinary presentation and service area'
],
'office': [
'modern office space with desks computers and professional workspace',
'contemporary work environment with ergonomic furniture and technology',
'office interior with cubicles meeting areas and work stations',
'professional office setting with business equipment and organized layout',
'corporate workspace with clean lines and functional design'
],
'home_living': [
'cozy living room with sofa comfortable seating and home decor',
'modern home interior with minimalist furniture and clean aesthetic',
'warm living space with personal touches and inviting atmosphere',
'residential interior with family room features and casual comfort',
'home living area with relaxation space and domestic furnishings'
],
'bedroom': [
'peaceful bedroom with bed nightstands and soft lighting',
'modern bedroom interior with minimalist design and calm atmosphere',
'cozy sleeping space with comfortable bedding and personal decor',
'bedroom setting with rest area and private sanctuary feel',
'sleeping quarters with bed furniture and restful ambiance'
],
'museum': [
'museum interior with exhibited artworks and gallery lighting',
'cultural institution space with display cases and visitor areas',
'art gallery with paintings sculptures and exhibition design',
'museum hall with artifacts and informational displays',
'exhibition space with curated collections and viewing areas'
]
},
# ===== 食物場景 Food =====
'food': {
'plated_dish': [
'gourmet plated dish with artistic presentation and fine dining aesthetics',
'restaurant plate with carefully arranged food components and garnishes',
'culinary creation with vibrant colors and professional plating',
'plated meal with balanced composition and appetizing appearance',
'food presentation with attention to visual detail and portion control',
'elegant dinner plate with sophisticated garnish and culinary artistry',
'fusion cuisine dish with innovative presentation and colorful elements',
'fine dining entree with sauce art and premium ingredients',
'contemporary plated food with geometric arrangement and edible flowers',
"chef's special with meticulous plating and restaurant-quality finish"
],
'street_food': [
'casual street food on wooden table or food truck setting',
'authentic street cuisine with rustic presentation and local character',
'food stall offering with simple plating and traditional preparation',
'street vendor food with casual serving style and cultural authenticity',
'local street eats with informal presentation and fresh ingredients',
'food truck meal with paper packaging and urban backdrop',
'market stall food with traditional cooking methods and local flavors',
'outdoor food stand offering with casual atmosphere and quick service',
'street-side cuisine with vibrant colors and authentic preparation',
'hawker food with cultural heritage and honest presentation'
],
'dessert': [
'elaborate dessert with decorative elements and sweet presentation',
'pastry or cake with artistic decoration and enticing appearance',
'sweet course with layered construction and visual appeal',
'dessert plate with confectionery artistry and color contrast',
'bakery creation with detailed finishing and appetizing styling',
'chocolate dessert with glossy ganache and elegant garnish',
'fruit tart with colorful berries and glazed finish',
'layered cake slice with frosting art and textured decoration',
'ice cream sundae with toppings drizzle and attractive presentation',
'patisserie item with delicate decoration and refined sweetness'
],
'ingredients': [
'fresh ingredients closeup shot with natural textures and vibrant colors',
'raw food components with organic forms and market-fresh appearance',
'culinary ingredients arranged with attention to color and composition',
'fresh produce with natural beauty and wholesome qualities',
'cooking ingredients with variety of textures and natural appeal',
'farmers market vegetables with rich colors and organic shapes',
'herb and spice arrangement with aromatic qualities and rustic charm',
'seafood display with ice and fresh-from-ocean appearance',
'butcher quality meat with marbling and premium cut presentation',
'artisan bread and grains with wholesome texture and natural crust'
],
'beverage': [
'artisan beverage with careful presentation and appealing pour',
'drink in glassware with garnish and professional service style',
'coffee or tea with latte art and aesthetic serving',
'refreshing beverage with ice garnish and attractive glass',
'drink presentation with attention to color and visual interest',
'craft cocktail with creative garnish and sophisticated glassware',
'specialty coffee with foam art and ceramic cup presentation',
'fresh juice with fruit garnish and vibrant natural color',
'tea service with elegant teapot and traditional ceremony aesthetic',
'smoothie bowl with fruit toppings and colorful healthy presentation'
],
'breakfast': [
'morning breakfast spread with eggs toast and fresh coffee',
'continental breakfast with pastries croissants and fruit arrangement',
'healthy breakfast bowl with granola yogurt and berries',
'pancake stack with maple syrup butter and powdered sugar',
'avocado toast with poached egg and microgreens on rustic plate',
'breakfast plate with bacon eggs and golden hash browns',
'brunch setting with mimosas fresh flowers and elegant tableware',
'oatmeal bowl with nuts fruits and honey drizzle',
'smoothie and acai bowl with tropical fruits and seeds',
'breakfast sandwich with melted cheese and morning sunlight'
],
'baked_goods': [
'fresh baked bread with golden crust and flour dusting',
'artisan pastries with flaky layers and butter sheen',
'homemade cookies with chocolate chips and rustic appearance',
'sourdough loaf with scoring pattern and crusty exterior',
'cinnamon rolls with cream cheese frosting and swirls',
'French baguette with crispy crust and airy crumb',
'croissants with laminated layers and golden brown color',
'muffins with crumb topping and fresh from oven warmth',
'bagels with sesame seeds and chewy texture',
'focaccia bread with herbs olive oil and dimpled surface'
]
},
# ===== 人物場景 People =====
'people': {
'portrait': [
'portrait photograph with shallow depth of field and subject focus',
'headshot with clean background and flattering lighting on face',
'personal portrait with emotional expression and eye contact',
'portrait composition with subject as primary visual element',
'close-up portrait with facial features and personality captured'
],
'candid': [
'candid street photography moment with natural unposed action',
'spontaneous capture of people in authentic situations and activities',
'documentary-style photograph of real-life moments and interactions',
'natural human behavior captured without staged positioning',
'unscripted moment showing genuine emotion and movement'
],
'group': [
'group photo with multiple people in organized composition',
'gathering of people with social interaction and shared activity',
'team or family portrait with coordinated positioning',
'group setting with people engaged in collective experience',
'multiple subjects arranged in harmonious group composition'
],
'activity': [
'people engaged in specific activity or recreational pursuit',
'action photograph showing physical movement and dynamic energy',
'sports or fitness activity with athletic performance captured',
'people participating in hobby or leisure activity',
'human subjects in motion demonstrating skill or exercise'
]
},
# ===== 產品場景 Product =====
'product': {
'studio_shot': [
'minimalist product photography on white background with clean lighting',
'commercial product shot with professional lighting and sharp detail',
'studio product photograph with controlled environment and even illumination',
'catalog-style product image with neutral background and clear presentation',
'product on white backdrop with shadow control and highlight management'
],
'lifestyle': [
'lifestyle product shot in natural setting with contextual environment',
'product in use showing real-world application and human interaction',
'environmental product photography with lifestyle context and atmosphere',
'product placed in authentic setting with relatable situation',
'contextual product image showing everyday use and practical application'
],
'flatlay': [
'overhead flatlay composition with products arranged on surface',
"bird's eye view of items arranged in artistic layout",
'top-down product styling with complementary objects and props',
'flatlay arrangement with balanced composition and visual harmony',
'aerial view of products styled with decorative elements'
]
},
# ===== 建築場景 Architecture =====
'architecture': {
'modern': [
'contemporary architecture with glass steel and minimalist design',
'modern building with clean lines geometric forms and innovative structure',
'architectural design featuring current aesthetic and building technology',
'present-day construction with progressive design and materials',
'modern structure with sleek surfaces and contemporary styling'
],
'historic': [
'historic architecture with traditional design and aged materials',
'heritage building with classical elements and period styling',
'old structure with architectural significance and historical character',
'traditional building with cultural importance and time-worn beauty',
'antique architecture showing craftsmanship of past eras'
],
'interior': [
'architectural interior space with designed environment and spatial quality',
'building interior showing layout flow and functional design',
'indoor architectural space with lighting surfaces and volumes',
'interior architecture with structural elements and finish materials',
'designed space interior with architectural features and spatial composition'
],
'detail': [
'architectural detail closeup showing construction method and materials',
'building element with decorative or functional architectural feature',
'structural detail revealing craftsmanship and design specifics',
'architectural component with unique design characteristic',
'close view of building feature showing texture pattern or ornamentation'
]
},
# ===== 光線描述 Lighting =====
'lighting': [
'soft diffused light creating even illumination without harsh shadows',
'natural daylight with bright ambient illumination and true colors',
'overcast atmosphere with diffused skylight and muted shadows',
'warm ambient light with golden tones and cozy feeling',
'evening light with low angle sun and long shadows',
'bright sunlight with strong contrast and crisp shadows',
'studio lighting with controlled illumination and professional quality',
'indoor natural light from windows creating gentle directional lighting',
'warm artificial lighting with incandescent glow and amber tones',
'cool artificial lighting with fluorescent or LED quality',
'soft indoor lighting with diffused sources and minimal shadows',
'dramatic lighting with strong contrast and defined shadows'
],
# ===== 氛圍描述 Mood =====
'mood': [
'calm and contemplative atmosphere with serene peaceful quality',
'bustling and energetic environment with dynamic active feeling',
'dramatic and imposing presence with powerful visual impact',
'cozy and intimate setting with warm welcoming ambiance',
'minimalist and clean aesthetic with simple uncluttered feel',
'vibrant and colorful scene with rich saturated hues',
'moody and atmospheric environment with evocative lighting',
'elegant and sophisticated setting with refined tasteful quality',
'rustic and natural atmosphere with organic earthy character',
'modern and sleek environment with contemporary styling'
]
}
# 場景標籤映射
self.scene_hashtags = {
'urban': {
'zh': ['城市', '都市', '城市風景', '街拍', '建築'],
'en': ['Urban', 'Cityscape', 'StreetPhotography', 'Architecture', 'City']
},
'nature': {
'zh': ['自然', '風景', '戶外', '大自然', '風景攝影'],
'en': ['Nature', 'Landscape', 'Outdoor', 'Scenery', 'NaturePhotography']
},
'indoor': {
'zh': ['室內', '室內設計', '空間', '居家'],
'en': ['Indoor', 'InteriorDesign', 'Interior', 'Home']
},
'food': {
'zh': ['美食', '食物', '料理', '美食攝影', '餐廳'],
'en': ['Food', 'Foodie', 'FoodPhotography', 'Cuisine', 'Dining']
},
'people': {
'zh': ['人像', '人物', '肖像', '街拍'],
'en': ['Portrait', 'People', 'PortraitPhotography', 'Candid']
},
'product': {
'zh': ['產品', '商品', '產品攝影', '商業攝影'],
'en': ['Product', 'ProductPhotography', 'Commercial', 'Flatlay']
},
'architecture': {
'zh': ['建築', '建築攝影', '建築設計', '空間'],
'en': ['Architecture', 'ArchitecturalPhotography', 'Building', 'Design']
}
}
print(f"✓ Scene Prompts initialized with {len(self.scene_vocabularies)} scene categories")
def get_prompts(self, scene_category: str, subcategory: str = None) -> List[str]:
"""
取得場景 prompts
Args:
scene_category: 場景類別 (如 'urban', 'nature')
subcategory: 子類別 (如 'city_canyon', 'mountain')
Returns:
Prompt 列表
"""
category_prompts = self.scene_vocabularies.get(scene_category, {})
if subcategory:
return category_prompts.get(subcategory, [])
else:
# 返回該類別的所有 prompts
all_prompts = []
for prompts in category_prompts.values():
if isinstance(prompts, list):
all_prompts.extend(prompts)
return all_prompts
def get_all_categories(self) -> List[str]:
"""取得所有場景類別"""
return list(self.scene_vocabularies.keys())
def get_subcategories(self, scene_category: str) -> List[str]:
"""取得特定類別的所有子類別"""
category = self.scene_vocabularies.get(scene_category, {})
return list(category.keys()) if isinstance(category, dict) else []
def get_hashtags(self, scene_category: str, language: str = 'zh') -> List[str]:
"""
取得場景的 hashtags
Args:
scene_category: 場景類別
language: 語言 ('zh', 'en', 或 'both')
Returns:
Hashtag 列表
"""
hashtags = self.scene_hashtags.get(scene_category, {})
if language == 'zh':
return hashtags.get('zh', [])
elif language == 'en':
return hashtags.get('en', [])
elif language == 'both' or language == 'zh-en':
zh_tags = hashtags.get('zh', [])
en_tags = hashtags.get('en', [])
return zh_tags + en_tags
else:
return hashtags.get('zh', [])
print("✓ ScenePrompts defined")