-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprompt_orchestrator.py
More file actions
1124 lines (980 loc) · 59.1 KB
/
Copy pathprompt_orchestrator.py
File metadata and controls
1124 lines (980 loc) · 59.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
Image Prompt Orchestration System
Automated text input manipulation for image generation variations
"""
from typing import List, Dict, Optional, Callable
from dataclasses import dataclass
from enum import Enum
class ModifierCategory(Enum):
"""Categories for lighting/environment modifiers"""
DRY = "dry"
WET = "wet"
@dataclass
class LightingModifier:
"""Represents a lighting/time-of-day modifier"""
id: int
description: str
category: ModifierCategory
tags: List[str]
@dataclass
class SeasonalModifier:
"""Represents a seasonal variation modifier"""
id: int
description: str
category: ModifierCategory
tags: List[str]
@dataclass
class LocationModifier:
"""Represents a location/environment modifier"""
id: int
description: str
tags: List[str]
@dataclass
class WeatherModifier:
"""Represents a weather condition modifier"""
id: int
description: str
category: ModifierCategory
tags: List[str]
@dataclass
class MoodModifier:
"""Represents a mood/atmosphere modifier"""
id: int
description: str
tags: List[str]
@dataclass
class CameraModifier:
"""Represents a camera/photography technique modifier"""
id: int
description: str
tags: List[str]
@dataclass
class ColorGradingModifier:
"""Represents a color grading modifier"""
id: int
description: str
tags: List[str]
@dataclass
class ActionModifier:
"""Represents an action/activity state modifier"""
id: int
description: str
tags: List[str]
@dataclass
class EraModifier:
"""Represents a time period/era modifier"""
id: int
description: str
tags: List[str]
@dataclass
class DetailModifier:
"""Represents a detail/focus control modifier"""
id: int
description: str
tags: List[str]
@dataclass
class CompositionModifier:
"""Represents a composition technique modifier"""
id: int
description: str
tags: List[str]
class PromptOrchestrator:
"""
Main orchestration class for image prompt variation automation.
Handles text input manipulation and modifier application.
"""
# 20 plug-and-play LIGHTING MODIFIERS (anchor-agnostic)
MODIFIERS = [
# DRY (universal, no location assumptions)
LightingModifier(1, "sunrise, car-friendly side-light, clear sky", ModifierCategory.DRY,
["sunrise", "morning", "side-light", "clear"]),
LightingModifier(2, "early morning, subtle back-light along the road axis, clear sky", ModifierCategory.DRY,
["early-morning", "back-light", "clear"]),
LightingModifier(3, "late morning, high-sun hard light for crisp body lines, clear sky", ModifierCategory.DRY,
["late-morning", "hard-light", "crisp", "clear"]),
LightingModifier(4, "midday, crisp hard sunlight, clear sky", ModifierCategory.DRY,
["midday", "hard-light", "clear"]),
LightingModifier(5, "early afternoon, gentle side-light, clear sky", ModifierCategory.DRY,
["afternoon", "side-light", "clear"]),
LightingModifier(6, "late afternoon, long shadow geometry, clear sky", ModifierCategory.DRY,
["afternoon", "shadows", "clear"]),
LightingModifier(7, "golden hour, warm low-angle side-light, clear sky", ModifierCategory.DRY,
["golden-hour", "warm", "side-light", "clear"]),
LightingModifier(8, "sunset, soft rim-lit edges, clear sky", ModifierCategory.DRY,
["sunset", "rim-light", "clear"]),
LightingModifier(9, "twilight, residual glow, clear sky", ModifierCategory.DRY,
["twilight", "glow", "clear"]),
LightingModifier(10, "blue hour, deep clear sky", ModifierCategory.DRY,
["blue-hour", "clear"]),
LightingModifier(11, "night, clear sky with clean highlights", ModifierCategory.DRY,
["night", "clear", "highlights"]),
LightingModifier(12, "moonlit night, clear sky", ModifierCategory.DRY,
["night", "moonlit", "clear"]),
LightingModifier(13, "early morning, three-quarter back-light, clear sky", ModifierCategory.DRY,
["morning", "back-light", "clear"]),
LightingModifier(14, "late afternoon, subtle back-light along the road axis, clear sky", ModifierCategory.DRY,
["afternoon", "back-light", "clear"]),
LightingModifier(15, "evening, car-friendly side-light, clear sky", ModifierCategory.DRY,
["evening", "side-light", "clear"]),
LightingModifier(16, "dawn, clean low-haze air, clear sky", ModifierCategory.DRY,
["dawn", "haze", "clear"]),
# WET (low-light only; triggers wet mode)
LightingModifier(17, "predawn blue hour, wet road, subtle back-light along the road axis", ModifierCategory.WET,
["predawn", "blue-hour", "wet", "back-light"]),
LightingModifier(18, "blue hour, wet road, car-friendly side-light", ModifierCategory.WET,
["blue-hour", "wet", "side-light"]),
LightingModifier(19, "twilight, wet road, residual glow, clear sky", ModifierCategory.WET,
["twilight", "wet", "glow"]),
LightingModifier(20, "night, wet street, clear sky (buildings visible → warm interior lights glowing)", ModifierCategory.WET,
["night", "wet", "interior-lights"]),
]
# 20 SEASONAL MODIFIERS (covering all seasons with wet/dry allocation)
SEASONAL_MODIFIERS = [
# SPRING - Fresh, renewal, mixed conditions (DRY: 1-4, WET: 5)
SeasonalModifier(1, "early spring, fresh green foliage emerging, mild temperature, clear atmosphere", ModifierCategory.DRY,
["spring", "early", "fresh", "green", "clear"]),
SeasonalModifier(2, "mid spring, blooming flowers, vibrant colors, crisp air", ModifierCategory.DRY,
["spring", "blooming", "flowers", "vibrant"]),
SeasonalModifier(3, "late spring, lush vegetation, warm days, clear skies", ModifierCategory.DRY,
["spring", "lush", "warm", "clear"]),
SeasonalModifier(4, "spring morning, dew-laden grass, soft diffused light", ModifierCategory.DRY,
["spring", "morning", "dew", "soft-light"]),
SeasonalModifier(5, "spring rain aftermath, wet surfaces, fresh clean air, glistening foliage", ModifierCategory.WET,
["spring", "rain", "wet", "fresh", "glistening"]),
# SUMMER - Bright, warm, energetic (DRY: 6-10)
SeasonalModifier(6, "early summer, bright sunlight, vivid colors, warm atmosphere", ModifierCategory.DRY,
["summer", "bright", "sunlight", "warm", "vivid"]),
SeasonalModifier(7, "midsummer, intense heat haze, strong contrast, clear sky", ModifierCategory.DRY,
["summer", "heat-haze", "intense", "contrast"]),
SeasonalModifier(8, "late summer, golden afternoon light, dry atmosphere, rich tones", ModifierCategory.DRY,
["summer", "golden", "afternoon", "dry", "rich"]),
SeasonalModifier(9, "summer evening, warm glow, long shadows, balmy air", ModifierCategory.DRY,
["summer", "evening", "glow", "shadows", "balmy"]),
SeasonalModifier(10, "summer twilight, lingering warmth, soft atmospheric haze", ModifierCategory.DRY,
["summer", "twilight", "warm", "haze"]),
# AUTUMN/FALL - Rich colors, changing conditions (DRY: 11-14, WET: 15)
SeasonalModifier(11, "early autumn, first color changes, crisp air, golden tones", ModifierCategory.DRY,
["autumn", "fall", "golden", "crisp"]),
SeasonalModifier(12, "mid autumn, peak foliage colors, amber lighting, clear atmosphere", ModifierCategory.DRY,
["autumn", "fall", "foliage", "amber", "clear"]),
SeasonalModifier(13, "late autumn, bare branches emerging, muted colors, cool air", ModifierCategory.DRY,
["autumn", "fall", "bare", "muted", "cool"]),
SeasonalModifier(14, "autumn sunset, warm backlighting through falling leaves", ModifierCategory.DRY,
["autumn", "fall", "sunset", "backlight", "leaves"]),
SeasonalModifier(15, "autumn rain, wet fallen leaves, reflective surfaces, moody atmosphere", ModifierCategory.WET,
["autumn", "fall", "rain", "wet", "leaves", "moody"]),
# WINTER - Cold, stark, dramatic (DRY: 16-17, WET: 18-20)
SeasonalModifier(16, "early winter, frost-touched surfaces, cold crisp air, pale light", ModifierCategory.DRY,
["winter", "frost", "cold", "crisp", "pale"]),
SeasonalModifier(17, "clear winter day, bright snow reflections, sharp shadows, cold atmosphere", ModifierCategory.DRY,
["winter", "snow", "bright", "sharp", "cold"]),
SeasonalModifier(18, "winter evening, fresh snowfall, wet streets, muted ambient light", ModifierCategory.WET,
["winter", "snow", "evening", "wet", "muted"]),
SeasonalModifier(19, "winter storm aftermath, ice-covered surfaces, wet reflections, dramatic clouds", ModifierCategory.WET,
["winter", "ice", "storm", "wet", "dramatic"]),
SeasonalModifier(20, "winter night, snow-covered ground, wet roads, cold blue tones", ModifierCategory.WET,
["winter", "night", "snow", "wet", "blue"]),
]
# 20 LOCATION MODIFIERS (generic categories, no specific cities/countries)
LOCATION_MODIFIERS = [
# URBAN - City/town environments (1-6)
LocationModifier(1, "downtown urban setting, tall buildings, modern architecture, city atmosphere",
["urban", "downtown", "city", "buildings", "modern"]),
LocationModifier(2, "industrial district, warehouse structures, utilitarian design, concrete surfaces",
["urban", "industrial", "warehouse", "concrete"]),
LocationModifier(3, "suburban residential area, tree-lined streets, houses visible, neighborhood setting",
["suburban", "residential", "neighborhood", "trees"]),
LocationModifier(4, "commercial zone, storefronts, retail architecture, urban planning",
["urban", "commercial", "retail", "storefronts"]),
LocationModifier(5, "urban parking structure, multi-level concrete, architectural lighting",
["urban", "parking", "structure", "concrete", "architectural"]),
LocationModifier(6, "city waterfront, urban meets water, harbor structures, maritime atmosphere",
["urban", "waterfront", "harbor", "maritime"]),
# RURAL/COUNTRY - Open landscapes (7-11)
LocationModifier(7, "open countryside, rural landscape, agricultural fields, expansive views",
["rural", "countryside", "agricultural", "open"]),
LocationModifier(8, "country road setting, farmland visible, pastoral atmosphere, rustic character",
["rural", "country", "farmland", "pastoral"]),
LocationModifier(9, "rural highway, rolling hills, open terrain, natural surroundings",
["rural", "highway", "hills", "natural"]),
LocationModifier(10, "farm setting, barn structures, agricultural equipment, working landscape",
["rural", "farm", "barn", "agricultural"]),
LocationModifier(11, "vineyard landscape, cultivated rows, estate setting, agricultural elegance",
["rural", "vineyard", "cultivated", "estate"]),
# INTERIOR - Indoor settings (12-15)
LocationModifier(12, "showroom interior, polished floors, controlled lighting, display setting",
["interior", "showroom", "polished", "display"]),
LocationModifier(13, "private garage setting, enclosed space, workshop atmosphere, personal storage",
["interior", "garage", "workshop", "enclosed"]),
LocationModifier(14, "studio environment, professional lighting, clean backdrop, controlled setting",
["interior", "studio", "professional", "controlled"]),
LocationModifier(15, "museum gallery interior, exhibition space, artistic setting, cultural atmosphere",
["interior", "museum", "gallery", "exhibition"]),
# OTHER ENVIRONMENTS - Diverse natural/special settings (16-20)
LocationModifier(16, "coastal setting, ocean views, seaside atmosphere, maritime environment",
["coastal", "ocean", "seaside", "maritime"]),
LocationModifier(17, "desert landscape, arid terrain, sand formations, stark environment",
["desert", "arid", "sand", "stark"]),
LocationModifier(18, "forest setting, dense trees, natural canopy, woodland atmosphere",
["forest", "trees", "woodland", "natural"]),
LocationModifier(19, "mountain terrain, elevated views, alpine atmosphere, dramatic landscape",
["mountain", "alpine", "elevated", "dramatic"]),
LocationModifier(20, "bridge structure setting, architectural span, engineering showcase, transitional space",
["bridge", "structure", "architectural", "engineering"]),
]
# 20 WEATHER MODIFIERS (atmospheric conditions beyond wet/dry)
WEATHER_MODIFIERS = [
# CLEAR/FAIR WEATHER (1-4) - DRY
WeatherModifier(1, "perfectly clear conditions, unlimited visibility, crisp air", ModifierCategory.DRY,
["clear", "visibility", "crisp"]),
WeatherModifier(2, "high pressure system, stable atmosphere, pristine clarity", ModifierCategory.DRY,
["high-pressure", "stable", "clarity"]),
WeatherModifier(3, "light breeze, gentle air movement, pleasant conditions", ModifierCategory.DRY,
["breeze", "gentle", "pleasant"]),
WeatherModifier(4, "calm air, still atmosphere, peaceful weather", ModifierCategory.DRY,
["calm", "still", "peaceful"]),
# CLOUDY/OVERCAST (5-8) - WET
WeatherModifier(5, "partially cloudy, scattered clouds, variable light", ModifierCategory.WET,
["cloudy", "scattered", "variable"]),
WeatherModifier(6, "overcast sky, diffused light, soft shadows", ModifierCategory.WET,
["overcast", "diffused", "soft"]),
WeatherModifier(7, "heavy cloud cover, muted atmosphere, even lighting", ModifierCategory.WET,
["clouds", "muted", "even"]),
WeatherModifier(8, "dramatic cloud formations, textured sky, dynamic conditions", ModifierCategory.WET,
["dramatic", "textured", "dynamic"]),
# PRECIPITATION (9-13) - WET
WeatherModifier(9, "light drizzle, fine mist, gentle precipitation", ModifierCategory.WET,
["drizzle", "mist", "precipitation"]),
WeatherModifier(10, "steady rain, wet surfaces, rainfall atmosphere", ModifierCategory.WET,
["rain", "wet", "rainfall"]),
WeatherModifier(11, "heavy downpour, intense rain, dramatic weather", ModifierCategory.WET,
["downpour", "intense", "dramatic"]),
WeatherModifier(12, "light snow, gentle flakes, winter precipitation", ModifierCategory.WET,
["snow", "flakes", "winter"]),
WeatherModifier(13, "heavy snowfall, reduced visibility, winter storm", ModifierCategory.WET,
["snowfall", "storm", "reduced-visibility"]),
# ATMOSPHERIC EFFECTS (14-20) - MIXED
WeatherModifier(14, "morning mist, ground fog, ethereal atmosphere", ModifierCategory.DRY,
["mist", "fog", "ethereal"]),
WeatherModifier(15, "dense fog, limited visibility, mysterious ambiance", ModifierCategory.WET,
["fog", "limited-visibility", "mysterious"]),
WeatherModifier(16, "heat shimmer, rising thermals, intense warmth", ModifierCategory.DRY,
["heat", "shimmer", "warm"]),
WeatherModifier(17, "dust haze, reduced clarity, atmospheric particles", ModifierCategory.DRY,
["dust", "haze", "particles"]),
WeatherModifier(18, "post-storm clearing, breaking clouds, dramatic light", ModifierCategory.WET,
["post-storm", "clearing", "dramatic"]),
WeatherModifier(19, "wind-swept conditions, strong gusts, dynamic atmosphere", ModifierCategory.WET,
["wind", "gusts", "dynamic"]),
WeatherModifier(20, "stormy conditions, dramatic clouds, threatening weather", ModifierCategory.WET,
["storm", "threatening", "dramatic"]),
]
# 20 MOOD/ATMOSPHERE MODIFIERS (emotional and psychological tone)
MOOD_MODIFIERS = [
# ENERGETIC/DYNAMIC (1-4)
MoodModifier(1, "vibrant energy, exciting atmosphere, dynamic presence",
["vibrant", "energetic", "exciting", "dynamic"]),
MoodModifier(2, "bold and confident, striking impression, powerful mood",
["bold", "confident", "striking", "powerful"]),
MoodModifier(3, "dramatic tension, intense atmosphere, impactful scene",
["dramatic", "tension", "intense", "impactful"]),
MoodModifier(4, "action-oriented, kinetic energy, movement implied",
["action", "kinetic", "movement", "dynamic"]),
# CALM/SERENE (5-8)
MoodModifier(5, "peaceful tranquility, calm atmosphere, serene mood",
["peaceful", "tranquil", "calm", "serene"]),
MoodModifier(6, "gentle and soft, subtle presence, quiet elegance",
["gentle", "soft", "subtle", "elegant"]),
MoodModifier(7, "meditative stillness, contemplative atmosphere, zen-like",
["meditative", "stillness", "contemplative", "zen"]),
MoodModifier(8, "harmonious balance, perfect equilibrium, restful scene",
["harmonious", "balance", "equilibrium", "restful"]),
# MYSTERIOUS/ENIGMATIC (9-12)
MoodModifier(9, "mysterious ambiance, intriguing atmosphere, enigmatic presence",
["mysterious", "intriguing", "enigmatic"]),
MoodModifier(10, "subtle mystery, hidden depths, layered complexity",
["mystery", "hidden", "complex", "layered"]),
MoodModifier(11, "cinematic suspense, anticipatory mood, tension building",
["suspense", "anticipatory", "cinematic", "tension"]),
MoodModifier(12, "noir atmosphere, shadowy intrigue, detective mood",
["noir", "shadowy", "intrigue", "detective"]),
# LUXURIOUS/PREMIUM (13-16)
MoodModifier(13, "luxurious elegance, premium quality, sophisticated presence",
["luxurious", "elegant", "premium", "sophisticated"]),
MoodModifier(14, "exclusive refinement, high-end atmosphere, elite setting",
["exclusive", "refined", "high-end", "elite"]),
MoodModifier(15, "timeless class, enduring elegance, distinguished character",
["timeless", "classic", "enduring", "distinguished"]),
MoodModifier(16, "aspirational quality, desire-inducing, premium appeal",
["aspirational", "desire", "appeal", "premium"]),
# EPIC/HEROIC (17-20)
MoodModifier(17, "epic grandeur, heroic scale, legendary presence",
["epic", "grandeur", "heroic", "legendary"]),
MoodModifier(18, "cinematic majesty, awe-inspiring, spectacular scene",
["cinematic", "majestic", "awe-inspiring", "spectacular"]),
MoodModifier(19, "triumphant mood, victorious atmosphere, celebratory tone",
["triumphant", "victorious", "celebratory"]),
MoodModifier(20, "inspirational quality, aspirational mood, uplifting scene",
["inspirational", "aspirational", "uplifting"]),
]
# 20 CAMERA/PHOTOGRAPHY MODIFIERS (technical and artistic camera techniques)
CAMERA_MODIFIERS = [
# LENS/FOCAL LENGTH (1-5)
CameraModifier(1, "wide angle perspective, expansive view, environmental context",
["wide-angle", "expansive", "environmental"]),
CameraModifier(2, "ultra-wide dramatic perspective, distorted edges, immersive view",
["ultra-wide", "dramatic", "immersive", "distorted"]),
CameraModifier(3, "standard focal length, natural perspective, balanced view",
["standard", "natural", "balanced"]),
CameraModifier(4, "portrait focal length, flattering compression, subject isolation",
["portrait", "compression", "isolation"]),
CameraModifier(5, "telephoto compression, compressed perspective, distant vantage",
["telephoto", "compressed", "distant"]),
# SHOOTING ANGLES (6-10)
CameraModifier(6, "eye-level perspective, natural viewpoint, direct engagement",
["eye-level", "natural", "direct"]),
CameraModifier(7, "low angle shot, dramatic upward perspective, heroic view",
["low-angle", "upward", "heroic", "dramatic"]),
CameraModifier(8, "high angle shot, overhead perspective, contextual view",
["high-angle", "overhead", "contextual"]),
CameraModifier(9, "bird's eye view, directly overhead, plan view",
["birds-eye", "overhead", "aerial"]),
CameraModifier(10, "Dutch angle, tilted horizon, dynamic tension",
["dutch-angle", "tilted", "dynamic"]),
# SHOT TYPES (11-15)
CameraModifier(11, "extreme close-up, macro detail, intimate perspective",
["close-up", "macro", "detail", "intimate"]),
CameraModifier(12, "close-up framing, detailed view, focused attention",
["close-up", "detailed", "focused"]),
CameraModifier(13, "medium shot, balanced composition, narrative framing",
["medium-shot", "balanced", "narrative"]),
CameraModifier(14, "full shot, complete view, environmental context",
["full-shot", "complete", "environmental"]),
CameraModifier(15, "establishing shot, wide context, scene-setting perspective",
["establishing", "wide", "scene-setting"]),
# CAMERA MOVEMENT/STYLE (16-20)
CameraModifier(16, "static composition, locked-off camera, stable framing",
["static", "stable", "locked"]),
CameraModifier(17, "tracking shot implied, dynamic movement, following motion",
["tracking", "movement", "dynamic"]),
CameraModifier(18, "shallow depth of field, bokeh background, subject isolation",
["shallow-dof", "bokeh", "isolation"]),
CameraModifier(19, "deep focus, everything sharp, maximum detail throughout",
["deep-focus", "sharp", "detail"]),
CameraModifier(20, "tilt-shift perspective, miniature effect, selective focus plane",
["tilt-shift", "miniature", "selective"]),
]
# 20 COLOR GRADING MODIFIERS (color palette and tonal adjustments)
COLOR_GRADING_MODIFIERS = [
# WARM TONES (1-4)
ColorGradingModifier(1, "warm golden tones, amber highlights, sunset palette",
["warm", "golden", "amber", "sunset"]),
ColorGradingModifier(2, "rich orange glow, copper accents, autumn warmth",
["orange", "copper", "warm", "autumn"]),
ColorGradingModifier(3, "subtle warmth, honey tones, gentle golden cast",
["subtle", "honey", "golden", "gentle"]),
ColorGradingModifier(4, "intense heat palette, vibrant warm colors, fiery tones",
["intense", "heat", "vibrant", "fiery"]),
# COOL TONES (5-8)
ColorGradingModifier(5, "cool blue tones, cyan shadows, winter palette",
["cool", "blue", "cyan", "winter"]),
ColorGradingModifier(6, "teal and turquoise, aquatic colors, oceanic mood",
["teal", "turquoise", "aquatic", "oceanic"]),
ColorGradingModifier(7, "steel blue grading, metallic cool, modern palette",
["steel", "blue", "metallic", "modern"]),
ColorGradingModifier(8, "deep cool shadows, indigo depths, night palette",
["deep", "cool", "indigo", "night"]),
# DESATURATED/MUTED (9-12)
ColorGradingModifier(9, "desaturated palette, muted colors, subtle tones",
["desaturated", "muted", "subtle"]),
ColorGradingModifier(10, "near monochrome, minimal color, almost black and white",
["monochrome", "minimal", "black-white"]),
ColorGradingModifier(11, "bleach bypass look, reduced saturation, contrasty muted",
["bleach-bypass", "reduced-saturation", "contrast"]),
ColorGradingModifier(12, "faded vintage colors, washed tones, nostalgic palette",
["faded", "vintage", "washed", "nostalgic"]),
# VIBRANT/SATURATED (13-16)
ColorGradingModifier(13, "highly saturated, vibrant colors, intense palette",
["saturated", "vibrant", "intense"]),
ColorGradingModifier(14, "neon-infused, electric colors, punchy saturation",
["neon", "electric", "punchy"]),
ColorGradingModifier(15, "technicolor richness, maximum color, bold palette",
["technicolor", "rich", "maximum", "bold"]),
ColorGradingModifier(16, "HDR toning, enhanced colors, vivid detail",
["hdr", "enhanced", "vivid"]),
# CINEMATIC GRADES (17-20)
ColorGradingModifier(17, "teal and orange, cinematic standard, Hollywood grade",
["teal-orange", "cinematic", "hollywood"]),
ColorGradingModifier(18, "film noir contrast, dramatic blacks, high contrast grade",
["noir", "contrast", "dramatic", "blacks"]),
ColorGradingModifier(19, "sepia toning, classic warmth, vintage film look",
["sepia", "classic", "vintage", "film"]),
ColorGradingModifier(20, "cross-processed look, shifted colors, analog aesthetic",
["cross-processed", "shifted", "analog"]),
]
# 20 ACTION/ACTIVITY MODIFIERS (dynamic states and narrative contexts)
ACTION_MODIFIERS = [
# MOTION STATES (1-5)
ActionModifier(1, "in motion, dynamic movement, kinetic energy captured",
["motion", "dynamic", "kinetic", "movement"]),
ActionModifier(2, "arriving/entering, transitional moment, coming into frame",
["arriving", "entering", "transitional"]),
ActionModifier(3, "departing/exiting, leaving scene, motion away",
["departing", "exiting", "leaving"]),
ActionModifier(4, "stationary display, static presentation, parked positioning",
["stationary", "static", "parked", "display"]),
ActionModifier(5, "suspended motion, frozen moment, peak action captured",
["suspended", "frozen", "peak-action"]),
# ACTIVE SCENARIOS (6-10)
ActionModifier(6, "being driven, in use, active operation",
["driven", "in-use", "active", "operation"]),
ActionModifier(7, "racing/competing, high speed action, competitive scene",
["racing", "competing", "high-speed", "competitive"]),
ActionModifier(8, "cruising leisurely, relaxed motion, casual movement",
["cruising", "leisurely", "relaxed", "casual"]),
ActionModifier(9, "performance driving, skilled operation, dynamic maneuvers",
["performance", "skilled", "maneuvers"]),
ActionModifier(10, "emerging/revealing, dramatic entrance, unveiling moment",
["emerging", "revealing", "dramatic", "unveiling"]),
# ENVIRONMENTAL INTERACTION (11-15)
ActionModifier(11, "navigating terrain, environmental challenge, landscape interaction",
["navigating", "terrain", "challenge", "interaction"]),
ActionModifier(12, "weathering conditions, environmental exposure, elements interaction",
["weathering", "exposure", "elements"]),
ActionModifier(13, "reflecting surroundings, mirror effects, environmental reflection",
["reflecting", "mirror", "reflection"]),
ActionModifier(14, "dominating scene, commanding presence, focal dominance",
["dominating", "commanding", "dominance"]),
ActionModifier(15, "integrated naturally, harmonious placement, scene cohesion",
["integrated", "harmonious", "cohesion"]),
# PRESENTATION CONTEXTS (16-20)
ActionModifier(16, "being photographed, photo shoot context, camera awareness",
["photographed", "photo-shoot", "camera-aware"]),
ActionModifier(17, "on display, exhibition context, showcase presentation",
["display", "exhibition", "showcase"]),
ActionModifier(18, "being admired, viewer presence implied, appreciation scene",
["admired", "viewer-presence", "appreciation"]),
ActionModifier(19, "professional shoot, commercial context, styled presentation",
["professional", "commercial", "styled"]),
ActionModifier(20, "documentary capture, candid moment, authentic scene",
["documentary", "candid", "authentic"]),
]
# 20 ERA/TIME PERIOD MODIFIERS (temporal and historical context)
ERA_MODIFIERS = [
# HISTORICAL PERIODS (1-6)
EraModifier(1, "1920s Art Deco era, jazz age aesthetic, roaring twenties style",
["1920s", "art-deco", "jazz-age", "twenties"]),
EraModifier(2, "1950s post-war, mid-century modern, classic era",
["1950s", "post-war", "mid-century", "classic"]),
EraModifier(3, "1960s mod era, space age design, revolutionary period",
["1960s", "mod", "space-age", "revolutionary"]),
EraModifier(4, "1970s aesthetic, disco era, vintage charm",
["1970s", "disco", "vintage"]),
EraModifier(5, "1980s style, neon decade, retro-futuristic look",
["1980s", "neon", "retro-futuristic"]),
EraModifier(6, "1990s aesthetic, late 20th century, pre-digital era",
["1990s", "late-century", "pre-digital"]),
# MODERN PERIODS (7-11)
EraModifier(7, "early 2000s, Y2K aesthetic, millennium style",
["2000s", "y2k", "millennium"]),
EraModifier(8, "2010s contemporary, modern classic, recent past",
["2010s", "contemporary", "modern"]),
EraModifier(9, "current/present day, contemporary cutting edge, now",
["current", "present", "contemporary", "now"]),
EraModifier(10, "near future, next-gen design, tomorrow's aesthetic",
["near-future", "next-gen", "tomorrow"]),
EraModifier(11, "timeless design, era-transcendent, eternal style",
["timeless", "transcendent", "eternal"]),
# FUTURISTIC VISIONS (12-16)
EraModifier(12, "near future, 2030s vision, next decade aesthetic",
["2030s", "near-future", "next-decade"]),
EraModifier(13, "mid-future, 2050s concept, advanced technology",
["2050s", "mid-future", "advanced"]),
EraModifier(14, "far future, 2100s vision, distant tomorrow",
["2100s", "far-future", "distant"]),
EraModifier(15, "cyberpunk future, dystopian high-tech, dark tomorrow",
["cyberpunk", "dystopian", "high-tech"]),
EraModifier(16, "utopian future, idealized tomorrow, optimistic vision",
["utopian", "idealized", "optimistic"]),
# FANTASY/ALTERNATE (17-20)
EraModifier(17, "steampunk alternate, Victorian machinery, brass and steam",
["steampunk", "victorian", "brass", "steam"]),
EraModifier(18, "dieselpunk aesthetic, 1940s alternate, retro-future",
["dieselpunk", "1940s", "retro-future"]),
EraModifier(19, "retrofuturism, 1950s vision of future, atomic age dreams",
["retrofuturism", "atomic-age", "retro"]),
EraModifier(20, "anachronistic fusion, time-blended, temporal collision",
["anachronistic", "fusion", "time-blended"]),
]
# 20 DETAIL/FOCUS MODIFIERS (control of detail level and emphasis)
DETAIL_MODIFIERS = [
# DETAIL LEVEL (1-5)
DetailModifier(1, "ultra-detailed, maximum resolution, every nuance visible",
["ultra-detailed", "maximum", "nuance"]),
DetailModifier(2, "high detail, crisp clarity, sharp precision",
["high-detail", "crisp", "sharp", "precision"]),
DetailModifier(3, "balanced detail, appropriate clarity, natural level",
["balanced", "appropriate", "natural"]),
DetailModifier(4, "soft detail, gentle rendering, subtle definition",
["soft", "gentle", "subtle"]),
DetailModifier(5, "minimal detail, essential only, simplified rendering",
["minimal", "essential", "simplified"]),
# FOCUS DISTRIBUTION (6-10)
DetailModifier(6, "single point focus, one clear subject, everything else secondary",
["single-focus", "clear-subject", "secondary"]),
DetailModifier(7, "dual focus, two subjects sharp, hierarchical attention",
["dual-focus", "two-subjects", "hierarchical"]),
DetailModifier(8, "foreground emphasis, front of frame primary, depth implied",
["foreground", "emphasis", "depth"]),
DetailModifier(9, "background context, environmental detail, setting emphasized",
["background", "context", "environmental"]),
DetailModifier(10, "uniform focus, all elements equal, democratic attention",
["uniform", "equal", "democratic"]),
# EMPHASIS TECHNIQUES (11-15)
DetailModifier(11, "subject isolation, maximum separation, clear hero object",
["isolation", "separation", "hero-object"]),
DetailModifier(12, "contextual integration, subject and environment balanced",
["integration", "balanced", "contextual"]),
DetailModifier(13, "environmental storytelling, setting tells story, subject in context",
["storytelling", "setting", "narrative"]),
DetailModifier(14, "dramatic highlighting, spotlight effect, theatrical emphasis",
["dramatic", "spotlight", "theatrical"]),
DetailModifier(15, "subtle presence, understated emphasis, quiet confidence",
["subtle", "understated", "quiet"]),
# RENDERING STYLE (16-20)
DetailModifier(16, "photo-realistic detail, maximum realism, true-to-life",
["photorealistic", "realism", "true-to-life"]),
DetailModifier(17, "painterly rendering, artistic interpretation, hand-crafted feel",
["painterly", "artistic", "hand-crafted"]),
DetailModifier(18, "technical illustration, blueprint precision, analytical detail",
["technical", "blueprint", "analytical"]),
DetailModifier(19, "impressionistic suggestion, atmospheric essence, mood over detail",
["impressionistic", "atmospheric", "essence"]),
DetailModifier(20, "hyperreal enhancement, beyond reality, idealized perfection",
["hyperreal", "enhanced", "idealized"]),
]
# 20 COMPOSITION MODIFIERS (framing and compositional techniques)
COMPOSITION_MODIFIERS = [
# CLASSICAL RULES (1-5)
CompositionModifier(1, "rule of thirds, balanced placement, classic composition",
["rule-of-thirds", "balanced", "classic"]),
CompositionModifier(2, "golden ratio, Fibonacci spiral, mathematical beauty",
["golden-ratio", "fibonacci", "mathematical"]),
CompositionModifier(3, "symmetrical composition, mirror balance, formal structure",
["symmetrical", "mirror", "formal"]),
CompositionModifier(4, "centered composition, bull's eye framing, direct focus",
["centered", "bulls-eye", "direct"]),
CompositionModifier(5, "frame within frame, layered composition, depth structure",
["frame-within-frame", "layered", "depth"]),
# DYNAMIC COMPOSITIONS (6-10)
CompositionModifier(6, "diagonal lines, dynamic energy, movement implied",
["diagonal", "dynamic", "movement"]),
CompositionModifier(7, "leading lines, eye guidance, directional flow",
["leading-lines", "guidance", "flow"]),
CompositionModifier(8, "vanishing point, perspective depth, convergence",
["vanishing-point", "perspective", "convergence"]),
CompositionModifier(9, "S-curve composition, flowing grace, elegant path",
["s-curve", "flowing", "elegant"]),
CompositionModifier(10, "triangle composition, stable base, pyramidal structure",
["triangle", "stable", "pyramidal"]),
# NEGATIVE SPACE (11-15)
CompositionModifier(11, "minimalist negative space, breathing room, isolated subject",
["negative-space", "minimalist", "isolated"]),
CompositionModifier(12, "dramatic sky space, overhead emptiness, floating subject",
["sky-space", "overhead", "floating"]),
CompositionModifier(13, "foreground negative space, leading room, directional void",
["foreground-space", "leading-room", "directional"]),
CompositionModifier(14, "surrounding emptiness, 360 space, complete isolation",
["surrounding", "emptiness", "isolation"]),
CompositionModifier(15, "balanced negative/positive, yin-yang space, equilibrium",
["balanced", "yin-yang", "equilibrium"]),
# ADVANCED TECHNIQUES (16-20)
CompositionModifier(16, "layered depth, multiple planes, spatial complexity",
["layered", "depth", "planes", "complexity"]),
CompositionModifier(17, "pattern disruption, break in rhythm, visual surprise",
["pattern", "disruption", "surprise"]),
CompositionModifier(18, "juxtaposition, contrasting elements, tension creation",
["juxtaposition", "contrast", "tension"]),
CompositionModifier(19, "repeating elements, rhythmic pattern, visual echo",
["repeating", "rhythmic", "echo"]),
CompositionModifier(20, "breaking the rules, intentional violation, artistic rebellion",
["breaking-rules", "intentional", "rebellion"]),
]
def __init__(self):
LocationModifier(20, "bridge structure setting, architectural span, engineering showcase, transitional space",
["bridge", "structure", "architectural", "engineering"]),
]
# 20 WEATHER MODIFIERS (atmospheric conditions beyond wet/dry)
WEATHER_MODIFIERS = [
# CLEAR/FAIR WEATHER (1-4) - DRY
WeatherModifier(1, "perfectly clear conditions, unlimited visibility, crisp air", ModifierCategory.DRY,
["clear", "visibility", "crisp"]),
WeatherModifier(2, "high pressure system, stable atmosphere, pristine clarity", ModifierCategory.DRY,
["high-pressure", "stable", "clarity"]),
WeatherModifier(3, "light breeze, gentle air movement, pleasant conditions", ModifierCategory.DRY,
["breeze", "gentle", "pleasant"]),
WeatherModifier(4, "calm air, still atmosphere, peaceful weather", ModifierCategory.DRY,
["calm", "still", "peaceful"]),
# CLOUDY/OVERCAST (5-8) - WET
WeatherModifier(5, "partially cloudy, scattered clouds, variable light", ModifierCategory.WET,
["cloudy", "scattered", "variable"]),
WeatherModifier(6, "overcast sky, diffused light, soft shadows", ModifierCategory.WET,
["overcast", "diffused", "soft"]),
WeatherModifier(7, "heavy cloud cover, muted atmosphere, even lighting", ModifierCategory.WET,
["clouds", "muted", "even"]),
WeatherModifier(8, "dramatic cloud formations, textured sky, dynamic conditions", ModifierCategory.WET,
["dramatic", "textured", "dynamic"]),
# PRECIPITATION (9-13) - WET
WeatherModifier(9, "light drizzle, fine mist, gentle precipitation", ModifierCategory.WET,
["drizzle", "mist", "precipitation"]),
WeatherModifier(10, "steady rain, wet surfaces, rainfall atmosphere", ModifierCategory.WET,
["rain", "wet", "rainfall"]),
WeatherModifier(11, "heavy downpour, intense rain, dramatic weather", ModifierCategory.WET,
["downpour", "intense", "dramatic"]),
WeatherModifier(12, "light snow, gentle flakes, winter precipitation", ModifierCategory.WET,
["snow", "flakes", "winter"]),
WeatherModifier(13, "heavy snowfall, reduced visibility, winter storm", ModifierCategory.WET,
["snowfall", "storm", "reduced-visibility"]),
# ATMOSPHERIC EFFECTS (14-20) - MIXED
WeatherModifier(14, "morning mist, ground fog, ethereal atmosphere", ModifierCategory.DRY,
["mist", "fog", "ethereal"]),
WeatherModifier(15, "dense fog, limited visibility, mysterious ambiance", ModifierCategory.WET,
["fog", "limited-visibility", "mysterious"]),
WeatherModifier(16, "heat shimmer, rising thermals, intense warmth", ModifierCategory.DRY,
["heat", "shimmer", "warm"]),
WeatherModifier(17, "dust haze, reduced clarity, atmospheric particles", ModifierCategory.DRY,
["dust", "haze", "particles"]),
WeatherModifier(18, "post-storm clearing, breaking clouds, dramatic light", ModifierCategory.WET,
["post-storm", "clearing", "dramatic"]),
WeatherModifier(19, "wind-swept conditions, strong gusts, dynamic atmosphere", ModifierCategory.WET,
["wind", "gusts", "dynamic"]),
WeatherModifier(20, "stormy conditions, dramatic clouds
"""Initialize the orchestrator with default modifiers"""
self.modifiers = {m.id: m for m in self.MODIFIERS}
self.seasonal_modifiers = {m.id: m for m in self.SEASONAL_MODIFIERS}
self.location_modifiers = {m.id: m for m in self.LOCATION_MODIFIERS}
self.custom_style_templates = self._load_style_templates()
def _load_style_templates(self) -> Dict[str, str]:
"""Load predefined style transformation templates"""
return {
"pop_art_1960s": "1960s pop art style with bright colors, bold graphics, and commercial aesthetics",
"bauhaus": "Bauhaus style with geometric forms, primary colors, and modernist principles",
"art_deco": "Art Deco style with geometric patterns, luxurious details, and streamlined forms",
"cyberpunk": "cyberpunk aesthetic with neon lights, high-tech elements, and dystopian atmosphere",
"minimalist": "minimalist style with clean lines, negative space, and essential elements only",
"impressionist": "impressionist painting style with visible brushstrokes and emphasis on light",
"noir": "film noir style with dramatic shadows, high contrast, and moody atmosphere",
"futuristic": "futuristic design with sleek forms, advanced materials, and sci-fi elements",
"vintage": "vintage aesthetic with retro colors, grain, and nostalgic atmosphere",
"brutalist": "brutalist architecture style with raw concrete, geometric forms, and bold structure",
}
def apply_lighting_modifier(self, base_prompt: str, modifier_id: int,
preserve_base: bool = True) -> str:
"""
Apply a lighting modifier to a base prompt.
Args:
base_prompt: The original prompt text
modifier_id: ID of the modifier to apply (1-20)
preserve_base: If True, append modifier; if False, replace lighting info
Returns:
Modified prompt string
"""
if modifier_id not in self.modifiers:
raise ValueError(f"Invalid modifier_id: {modifier_id}. Must be 1-20.")
modifier = self.modifiers[modifier_id]
if preserve_base:
# Append the modifier to maintain original composition
return f"{base_prompt}, {modifier.description}"
else:
# Replace lighting-related content
cleaned_prompt = self._strip_lighting_keywords(base_prompt)
return f"{cleaned_prompt}, {modifier.description}"
def apply_seasonal_modifier(self, base_prompt: str, modifier_id: int,
preserve_base: bool = True) -> str:
"""
Apply a seasonal modifier to a base prompt.
Args:
base_prompt: The original prompt text
modifier_id: ID of the seasonal modifier to apply (1-20)
preserve_base: If True, append modifier; if False, replace seasonal info
Returns:
Modified prompt string
"""
if modifier_id not in self.seasonal_modifiers:
raise ValueError(f"Invalid modifier_id: {modifier_id}. Must be 1-20.")
modifier = self.seasonal_modifiers[modifier_id]
if preserve_base:
# Append the modifier to maintain original composition
return f"{base_prompt}, {modifier.description}"
else:
# Replace seasonal-related content
cleaned_prompt = self._strip_seasonal_keywords(base_prompt)
return f"{cleaned_prompt}, {modifier.description}"
def apply_location_modifier(self, base_prompt: str, modifier_id: int,
preserve_base: bool = True) -> str:
"""
Apply a location modifier to a base prompt.
Args:
base_prompt: The original prompt text
modifier_id: ID of the location modifier to apply (1-20)
preserve_base: If True, append modifier; if False, replace location info
Returns:
Modified prompt string
"""
if modifier_id not in self.location_modifiers:
raise ValueError(f"Invalid modifier_id: {modifier_id}. Must be 1-20.")
modifier = self.location_modifiers[modifier_id]
if preserve_base:
# Append the modifier to maintain original composition
return f"{base_prompt}, {modifier.description}"
else:
# Replace location-related content
cleaned_prompt = self._strip_location_keywords(base_prompt)
return f"{cleaned_prompt}, {modifier.description}"
def _strip_lighting_keywords(self, prompt: str) -> str:
"""Remove common lighting/time-of-day keywords from prompt"""
lighting_keywords = [
"sunrise", "sunset", "morning", "afternoon", "evening", "night", "twilight",
"blue hour", "golden hour", "dawn", "dusk", "midday", "noon",
"clear sky", "cloudy", "overcast", "back-light", "side-light", "rim-light",
"wet road", "wet street", "dry", "moonlit", "sunlit"
]
cleaned = prompt
for keyword in lighting_keywords:
# Case-insensitive removal
cleaned = cleaned.replace(keyword, "")
cleaned = cleaned.replace(keyword.title(), "")
cleaned = cleaned.replace(keyword.upper(), "")
# Clean up extra commas and spaces
cleaned = " ".join(cleaned.split())
cleaned = cleaned.replace(" ,", ",").replace(",,", ",")
cleaned = cleaned.strip(", ")
return cleaned
def _strip_seasonal_keywords(self, prompt: str) -> str:
"""Remove common seasonal keywords from prompt"""
seasonal_keywords = [
"spring", "summer", "autumn", "fall", "winter",
"blooming", "flowers", "foliage", "leaves", "snow", "frost", "ice",
"heat haze", "cold", "warm days", "crisp air"
]
cleaned = prompt
for keyword in seasonal_keywords:
# Case-insensitive removal
cleaned = cleaned.replace(keyword, "")
cleaned = cleaned.replace(keyword.title(), "")
cleaned = cleaned.replace(keyword.upper(), "")
# Clean up extra commas and spaces
cleaned = " ".join(cleaned.split())
cleaned = cleaned.replace(" ,", ",").replace(",,", ",")
cleaned = cleaned.strip(", ")
return cleaned
def _strip_location_keywords(self, prompt: str) -> str:
"""Remove common location keywords from prompt"""
location_keywords = [
"urban", "downtown", "city", "industrial", "suburban", "commercial",
"countryside", "rural", "farmland", "country road", "highway",
"interior", "showroom", "garage", "studio", "museum",
"coastal", "desert", "forest", "mountain", "bridge"
]
cleaned = prompt
for keyword in location_keywords:
# Case-insensitive removal
cleaned = cleaned.replace(keyword, "")
cleaned = cleaned.replace(keyword.title(), "")
cleaned = cleaned.replace(keyword.upper(), "")
# Clean up extra commas and spaces
cleaned = " ".join(cleaned.split())
cleaned = cleaned.replace(" ,", ",").replace(",,", ",")
cleaned = cleaned.strip(", ")
return cleaned
def apply_style_transformation(self, base_prompt: str, style: str,
maintain_composition: bool = True) -> str:
"""
Apply a style transformation to a prompt.
Args:
base_prompt: The original prompt text
style: Style name (from templates) or custom style description
maintain_composition: Whether to explicitly state composition preservation
Returns:
Style-transformed prompt string
"""
# Check if it's a predefined style
if style.lower().replace(" ", "_") in self.custom_style_templates:
style_desc = self.custom_style_templates[style.lower().replace(" ", "_")]
else:
style_desc = style
if maintain_composition:
return f"Transform to {style_desc} while maintaining the original composition. Base scene: {base_prompt}"
else:
return f"{base_prompt}, {style_desc}"
def generate_variation_batch(self, base_prompt: str,
modifier_ids: Optional[List[int]] = None,
include_styles: Optional[List[str]] = None) -> List[Dict[str, str]]:
"""
Generate a batch of prompt variations.
Args:
base_prompt: The original prompt text
modifier_ids: List of modifier IDs to apply (None = all 20)
include_styles: List of style transformations to include (None = none)
Returns:
List of dictionaries with 'id', 'type', 'description', and 'prompt' keys
"""
variations = []
# Generate lighting variations
if modifier_ids is None:
modifier_ids = list(range(1, 21))
for mod_id in modifier_ids:
modifier = self.modifiers[mod_id]
prompt = self.apply_lighting_modifier(base_prompt, mod_id)
variations.append({
"id": f"lighting_{mod_id}",
"type": "lighting",
"category": modifier.category.value,
"description": modifier.description,
"prompt": prompt
})
# Generate style variations
if include_styles:
for idx, style in enumerate(include_styles, 1):
prompt = self.apply_style_transformation(base_prompt, style)
variations.append({
"id": f"style_{idx}",
"type": "style",
"category": "transformation",
"description": style,
"prompt": prompt
})
return variations
def get_modifiers_by_category(self, category: ModifierCategory) -> List[LightingModifier]:
"""Get all modifiers of a specific category (DRY/WET)"""
return [m for m in self.modifiers.values() if m.category == category]
def get_modifiers_by_tags(self, tags: List[str]) -> List[LightingModifier]:
"""Get modifiers that match any of the specified tags"""
return [m for m in self.modifiers.values()
if any(tag in m.tags for tag in tags)]
def create_custom_pipeline(self, base_prompt: str,
transformations: List[Callable]) -> str:
"""
Apply a custom sequence of transformations to a prompt.
Args:
base_prompt: The original prompt text
transformations: List of transformation functions to apply in sequence
Returns:
Final transformed prompt string
"""
result = base_prompt
for transform in transformations:
result = transform(result)
return result
def export_variations(self, variations: List[Dict[str, str]],
format: str = "txt") -> str:
"""
Export variations to a formatted string.
Args:
variations: List of variation dictionaries
format: Export format ('txt', 'json', 'csv')
Returns:
Formatted string representation