Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -94,88 +94,89 @@ class HyperRealisticConfig:
|
|
| 94 |
"pose": "bending to polish banister"
|
| 95 |
}
|
| 96 |
]
|
| 97 |
-
|
| 98 |
EVERYDAY_MOMENTS = [
|
| 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 |
LACE_BIKINI_STYLES = [
|
| 180 |
"delicate black lace bikini with floral embroidery and sheer panels",
|
| 181 |
"sheer nude illusion bikini with scalloped lace edges and ribbon ties",
|
|
@@ -197,64 +198,66 @@ HOSIERY_STYLES = [
|
|
| 197 |
"stay-up stockings with French lace band and bow details",
|
| 198 |
"glossy finish stockings with sandalwood foot and sheer legs"
|
| 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 |
-
PHOTOGRAPHY_STYLES = [
|
| 246 |
-
"cinematic lighting with rim light and soft shadows",
|
| 247 |
-
"natural window light with lens flare and soft focus",
|
| 248 |
-
"studio softbox lighting with catchlights in eyes",
|
| 249 |
-
"golden hour backlighting with hair light effect",
|
| 250 |
-
"moody low-key lighting with dramatic contrasts",
|
| 251 |
-
"bright high-key lighting with minimal shadows",
|
| 252 |
-
"film noir inspired lighting with venetian blind patterns",
|
| 253 |
-
"ethereal foggy lighting with diffusion filter"
|
| 254 |
-
]
|
| 255 |
|
| 256 |
-
|
| 257 |
-
LENSES = ["85mm f/1.2", "50mm f/1.4", "24-70mm f/2.8", "100mm f/2.8 macro", "135mm f/1.8"]class HyperRealisticPromptGenerator:
|
| 258 |
def __init__(self):
|
| 259 |
self.config = HyperRealisticConfig()
|
| 260 |
self.history: List[Dict] = []
|
|
@@ -314,8 +317,7 @@ LENSES = ["85mm f/1.2", "50mm f/1.4", "24-70mm f/2.8", "100mm f/2.8 macro", "135
|
|
| 314 |
"timestamp": datetime.datetime.now().isoformat()
|
| 315 |
})
|
| 316 |
return prompt
|
| 317 |
-
|
| 318 |
-
def generate_moment_prompt(self, ethnicity: str, moment_name: str, nsfw_mode: bool = False) -> str:
|
| 319 |
moment = self._get_moment_by_name(moment_name)
|
| 320 |
body, skin, lace, hosiery, heels, hairstyle, makeup, lighting, photo_style, camera, lens = self._random_style()
|
| 321 |
|
|
@@ -348,9 +350,7 @@ LENSES = ["85mm f/1.2", "50mm f/1.4", "24-70mm f/2.8", "100mm f/2.8 macro", "135
|
|
| 348 |
"prompt": prompt,
|
| 349 |
"timestamp": datetime.datetime.now().isoformat()
|
| 350 |
})
|
| 351 |
-
return prompt
|
| 352 |
-
|
| 353 |
-
def generate_batch_prompts(self, count: int, prompt_type: str, nsfw_mode: bool = False) -> List[str]:
|
| 354 |
prompts = []
|
| 355 |
for _ in range(count):
|
| 356 |
ethnicity = random.choice(self.config.ETHNICITIES)
|
|
@@ -404,7 +404,9 @@ def export_history():
|
|
| 404 |
filename = f"prompt_history_{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}.json"
|
| 405 |
with open(filename, 'w', encoding='utf-8') as f:
|
| 406 |
json.dump(history, f, indent=2, ensure_ascii=False)
|
| 407 |
-
return f"History exported to {filename}"
|
|
|
|
|
|
|
| 408 |
with gr.Blocks(title="HyperRealistic Humanized Perfection Generator", theme=gr.themes.Soft(), css="""
|
| 409 |
.prompt-block {
|
| 410 |
border: 1px solid #e0e0e0;
|
|
@@ -672,4 +674,5 @@ if __name__ == "__main__":
|
|
| 672 |
share=True,
|
| 673 |
debug=True,
|
| 674 |
show_error=True
|
| 675 |
-
)
|
|
|
|
|
|
| 94 |
"pose": "bending to polish banister"
|
| 95 |
}
|
| 96 |
]
|
|
|
|
| 97 |
EVERYDAY_MOMENTS = [
|
| 98 |
+
{
|
| 99 |
+
"scene": "Morning Kitchen",
|
| 100 |
+
"action": "bending down to take something from the low oven causing shirt to rise",
|
| 101 |
+
"outfit": "oversized white t-shirt and cotton shorts with visible panty lines",
|
| 102 |
+
"setting": "sunlit kitchen with open window and morning light",
|
| 103 |
+
"accessories": "coffee mug on counter, apron hanging, fresh herbs",
|
| 104 |
+
"pose": "natural bending with back arched"
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
"scene": "Laundry Room",
|
| 108 |
+
"action": "bending over to take clothes from the dryer showing waistband",
|
| 109 |
+
"outfit": "sports top and fitted leggings with subtle sheer panels",
|
| 110 |
+
"setting": "laundry room with baskets and folding table",
|
| 111 |
+
"accessories": "basket of clean clothes, fabric softener",
|
| 112 |
+
"pose": "deep forward bend with legs straight"
|
| 113 |
+
},
|
| 114 |
+
{
|
| 115 |
+
"scene": "Gardening",
|
| 116 |
+
"action": "kneeling while planting flowers with shorts riding up",
|
| 117 |
+
"outfit": "light cotton sundress with thin straps and no bra lines",
|
| 118 |
+
"setting": "backyard garden with flower pots and watering system",
|
| 119 |
+
"accessories": "gardening gloves, watering can, trowel",
|
| 120 |
+
"pose": "kneeling with one leg forward"
|
| 121 |
+
},
|
| 122 |
+
{
|
| 123 |
+
"scene": "Home Yoga",
|
| 124 |
+
"action": "doing downward dog pose with leggings becoming translucent",
|
| 125 |
+
"outfit": "yoga leggings and crop top with sweat patches",
|
| 126 |
+
"setting": "living room with yoga mat and natural side lighting",
|
| 127 |
+
"accessories": "yoga block, water bottle, meditation app",
|
| 128 |
+
"pose": "inverted V-shape with head down"
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"scene": "Shelf Cleaning",
|
| 132 |
+
"action": "stretching on tiptoes to reach a book showing midriff",
|
| 133 |
+
"outfit": "loose t-shirt and pajama shorts with lace trim visible",
|
| 134 |
+
"setting": "personal library with small ladder and dust particles",
|
| 135 |
+
"accessories": "feather duster, stack of books, reading glasses",
|
| 136 |
+
"pose": "full body stretch on toes"
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"scene": "Dog Walk",
|
| 140 |
+
"action": "bending down to attach the leash with dress gaping",
|
| 141 |
+
"outfit": "floral summer dress with thin fabric blowing in wind",
|
| 142 |
+
"setting": "park at sunset with long shadows and golden hour",
|
| 143 |
+
"accessories": "leash, treat pouch, dog water bottle",
|
| 144 |
+
"pose": "squatting while holding excited dog"
|
| 145 |
+
},
|
| 146 |
+
{
|
| 147 |
+
"scene": "Terrace Coffee",
|
| 148 |
+
"action": "sitting with legs crossed, dropping a napkin and reaching",
|
| 149 |
+
"outfit": "silk blouse and pleated skirt that opens when seated",
|
| 150 |
+
"setting": "terrace with iron table and morning mist",
|
| 151 |
+
"accessories": "open book, tea cup, croissant",
|
| 152 |
+
"pose": "leaning forward from seated position"
|
| 153 |
+
},
|
| 154 |
+
{
|
| 155 |
+
"scene": "Climbing Stairs",
|
| 156 |
+
"action": "going up with shopping bags showing back view",
|
| 157 |
+
"outfit": "pencil skirt and fitted blouse with tension lines",
|
| 158 |
+
"setting": "spiral staircase in apartment with dramatic lighting",
|
| 159 |
+
"accessories": "shopping bags, keys in hand, mail",
|
| 160 |
+
"pose": "mid-step with weight on one leg"
|
| 161 |
+
},
|
| 162 |
+
{
|
| 163 |
+
"scene": "Changing Lightbulb",
|
| 164 |
+
"action": "standing on a chair with arms raised fully",
|
| 165 |
+
"outfit": "long t-shirt as dress with back lift when reaching",
|
| 166 |
+
"setting": "kitchen with pendant light and afternoon shadows",
|
| 167 |
+
"accessories": "new lightbulb, step stool, tool box",
|
| 168 |
+
"pose": "tiptoes on chair reaching upward"
|
| 169 |
+
},
|
| 170 |
+
{
|
| 171 |
+
"scene": "Post-Shower",
|
| 172 |
+
"action": "drying hair with towel that keeps slipping",
|
| 173 |
+
"outfit": "short towel wrapped tightly with damp edges",
|
| 174 |
+
"setting": "bathroom with foggy mirror and steam effect",
|
| 175 |
+
"accessories": "hairdryer, bathrobe on hook, skincare products",
|
| 176 |
+
"pose": "bent forward hair drying motion"
|
| 177 |
+
}
|
| 178 |
+
]
|
| 179 |
+
|
| 180 |
LACE_BIKINI_STYLES = [
|
| 181 |
"delicate black lace bikini with floral embroidery and sheer panels",
|
| 182 |
"sheer nude illusion bikini with scalloped lace edges and ribbon ties",
|
|
|
|
| 198 |
"stay-up stockings with French lace band and bow details",
|
| 199 |
"glossy finish stockings with sandalwood foot and sheer legs"
|
| 200 |
]
|
| 201 |
+
HEEL_STYLES = [
|
| 202 |
+
"black patent leather stilettos with pointed toe and slim heel",
|
| 203 |
+
"nude pumps with platform and ankle strap for stability",
|
| 204 |
+
"gold strappy sandals with multiple thin straps and high arch",
|
| 205 |
+
"black suede pointed-toe heels with cut-out details",
|
| 206 |
+
"red bottom Louboutin-style heels with glossy finish",
|
| 207 |
+
"clear PVC heels with geometric shapes and metallic accents",
|
| 208 |
+
"silver glitter block heels with ankle support and comfort pad",
|
| 209 |
+
"white leather slingbacks with kitten heel and bow detail"
|
| 210 |
+
]
|
| 211 |
|
| 212 |
+
HAIRSTYLES = [
|
| 213 |
+
"long wavy hair with natural volume and soft highlights",
|
| 214 |
+
"sleek straight hair with middle part and glossy finish",
|
| 215 |
+
"elegant updo with loose tendrils and pearl pins",
|
| 216 |
+
"beach waves with sun-kissed highlights and textured ends",
|
| 217 |
+
"high ponytail with smooth finish and subtle curls",
|
| 218 |
+
"braided crown with floral accents and soft flyaways",
|
| 219 |
+
"vintage Hollywood curls with deep side part",
|
| 220 |
+
"messy bun with face-framing strands and natural texture"
|
| 221 |
+
]
|
| 222 |
|
| 223 |
+
MAKEUP_STYLES = [
|
| 224 |
+
"natural glam with dewy skin, soft contour, and nude lips",
|
| 225 |
+
"smoky eye with winged liner and voluminous lashes",
|
| 226 |
+
"rosy cheeks with glossy lips and subtle highlighter",
|
| 227 |
+
"bold red lip with flawless matte foundation",
|
| 228 |
+
"bronzed goddess with shimmery eyeshadow and golden highlights",
|
| 229 |
+
"minimalist makeup with tinted moisturizer and mascara",
|
| 230 |
+
"vintage pin-up with defined brows and classic red lip",
|
| 231 |
+
"ethereal glow with iridescent highlighter and soft blush"
|
| 232 |
+
]
|
| 233 |
|
| 234 |
+
LIGHTING_DETAILS = [
|
| 235 |
+
"soft diffused lighting with a warm golden glow",
|
| 236 |
+
"dramatic chiaroscuro lighting with deep shadows",
|
| 237 |
+
"natural sunlight filtering through sheer curtains",
|
| 238 |
+
"studio lighting with a three-point setup for dimensionality",
|
| 239 |
+
"candlelit ambiance with flickering shadows",
|
| 240 |
+
"backlit silhouette with a soft halo effect",
|
| 241 |
+
"moody blue-toned lighting for a cinematic feel",
|
| 242 |
+
"sunset glow with lens flare and warm hues"
|
| 243 |
+
]
|
| 244 |
|
| 245 |
+
PHOTOGRAPHY_STYLES = [
|
| 246 |
+
"cinematic lighting with rim light and soft shadows",
|
| 247 |
+
"natural window light with lens flare and soft focus",
|
| 248 |
+
"studio softbox lighting with catchlights in eyes",
|
| 249 |
+
"golden hour backlighting with hair light effect",
|
| 250 |
+
"moody low-key lighting with dramatic contrasts",
|
| 251 |
+
"bright high-key lighting with minimal shadows",
|
| 252 |
+
"film noir inspired lighting with venetian blind patterns",
|
| 253 |
+
"ethereal foggy lighting with diffusion filter"
|
| 254 |
+
]
|
| 255 |
+
|
| 256 |
+
CAMERAS = ["Canon EOS R5", "Sony α7R V", "Nikon Z9", "Hasselblad X2D", "Phase One IQ4"]
|
| 257 |
+
LENSES = ["85mm f/1.2", "50mm f/1.4", "24-70mm f/2.8", "100mm f/2.8 macro", "135mm f/1.8"]
|
| 258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
|
| 260 |
+
class HyperRealisticPromptGenerator:
|
|
|
|
| 261 |
def __init__(self):
|
| 262 |
self.config = HyperRealisticConfig()
|
| 263 |
self.history: List[Dict] = []
|
|
|
|
| 317 |
"timestamp": datetime.datetime.now().isoformat()
|
| 318 |
})
|
| 319 |
return prompt
|
| 320 |
+
def generate_moment_prompt(self, ethnicity: str, moment_name: str, nsfw_mode: bool = False) -> str:
|
|
|
|
| 321 |
moment = self._get_moment_by_name(moment_name)
|
| 322 |
body, skin, lace, hosiery, heels, hairstyle, makeup, lighting, photo_style, camera, lens = self._random_style()
|
| 323 |
|
|
|
|
| 350 |
"prompt": prompt,
|
| 351 |
"timestamp": datetime.datetime.now().isoformat()
|
| 352 |
})
|
| 353 |
+
return prompt def generate_batch_prompts(self, count: int, prompt_type: str, nsfw_mode: bool = False) -> List[str]:
|
|
|
|
|
|
|
| 354 |
prompts = []
|
| 355 |
for _ in range(count):
|
| 356 |
ethnicity = random.choice(self.config.ETHNICITIES)
|
|
|
|
| 404 |
filename = f"prompt_history_{datetime.datetime.now().strftime('%Y%m%d_%H%M%S')}.json"
|
| 405 |
with open(filename, 'w', encoding='utf-8') as f:
|
| 406 |
json.dump(history, f, indent=2, ensure_ascii=False)
|
| 407 |
+
return f"History exported to {filename}"
|
| 408 |
+
|
| 409 |
+
# Interfaz Gradio
|
| 410 |
with gr.Blocks(title="HyperRealistic Humanized Perfection Generator", theme=gr.themes.Soft(), css="""
|
| 411 |
.prompt-block {
|
| 412 |
border: 1px solid #e0e0e0;
|
|
|
|
| 674 |
share=True,
|
| 675 |
debug=True,
|
| 676 |
show_error=True
|
| 677 |
+
)
|
| 678 |
+
|