Spaces:
Sleeping
Sleeping
better monster
Browse files
app.py
CHANGED
|
@@ -339,13 +339,23 @@ class PicletGeneratorService:
|
|
| 339 |
|
| 340 |
"{caption}"
|
| 341 |
|
| 342 |
-
|
| 343 |
-
1.
|
| 344 |
-
2.
|
| 345 |
-
3.
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
```md
|
| 350 |
# Canonical Object
|
| 351 |
{{Specific object name: "macbook", "eiffel tower", "iphone", "tesla", "le creuset mug", "nintendo switch"}}
|
|
@@ -369,21 +379,27 @@ Height: {{e.g., "1.2m" or "3'5\\""}}
|
|
| 369 |
Weight: {{e.g., "15kg" or "33 lbs"}}
|
| 370 |
|
| 371 |
# Personality
|
| 372 |
-
{{1-2 sentences describing personality traits}}
|
|
|
|
|
|
|
|
|
|
| 373 |
|
| 374 |
-
#
|
| 375 |
-
{{2-3 paragraphs describing
|
| 376 |
|
| 377 |
# Monster Image Prompt
|
| 378 |
-
{{
|
| 379 |
```
|
| 380 |
|
| 381 |
CRITICAL RULES:
|
| 382 |
-
- Canonical Object MUST be SPECIFIC: "
|
| 383 |
- If you can identify a brand, model, or proper name from the description, USE IT
|
| 384 |
- Variation should be meaningful and distinctive (material, style, color, context, or model variant)
|
| 385 |
-
-
|
| 386 |
-
-
|
|
|
|
|
|
|
|
|
|
| 387 |
|
| 388 |
response_text = PicletGeneratorService.generate_text_with_gpt(concept_prompt, hf_token)
|
| 389 |
|
|
@@ -417,7 +433,16 @@ CRITICAL RULES:
|
|
| 417 |
rarity_text = extract_section(concept_text, 'Object Rarity').lower()
|
| 418 |
monster_name = extract_section(concept_text, 'Monster Name')
|
| 419 |
primary_type = extract_section(concept_text, 'Primary Type').lower()
|
| 420 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 421 |
image_prompt = extract_section(concept_text, 'Monster Image Prompt')
|
| 422 |
|
| 423 |
# Parse physical stats
|
|
|
|
| 339 |
|
| 340 |
"{caption}"
|
| 341 |
|
| 342 |
+
STEP 1 - REASONING (think through these before writing):
|
| 343 |
+
1. What is the PRIMARY PHYSICAL OBJECT? Be SPECIFIC (e.g., "f-16 fighting falcon" not "jet", "macbook pro" not "laptop")
|
| 344 |
+
2. What is this object's real-world PURPOSE and FUNCTION?
|
| 345 |
+
3. What PERSONALITY traits would naturally emerge from this object's characteristics?
|
| 346 |
+
- If it's fast β energetic, agile
|
| 347 |
+
- If it's protective β loyal, defensive
|
| 348 |
+
- If it's precise β disciplined, focused
|
| 349 |
+
4. What NATURAL HABITAT suits this object-turned-creature?
|
| 350 |
+
- Electronics β urban/tech environments
|
| 351 |
+
- Vehicles β roads, skies, waters they traverse
|
| 352 |
+
- Tools β workshops, sites where they're used
|
| 353 |
+
5. What BEHAVIORS and ABILITIES reflect the object's function?
|
| 354 |
+
- What does the object DO in real life?
|
| 355 |
+
- How would those actions become creature abilities?
|
| 356 |
+
6. What are the object's most ICONIC VISUAL FEATURES that define it?
|
| 357 |
+
|
| 358 |
+
STEP 2 - FORMAT your complete concept EXACTLY as follows:
|
| 359 |
```md
|
| 360 |
# Canonical Object
|
| 361 |
{{Specific object name: "macbook", "eiffel tower", "iphone", "tesla", "le creuset mug", "nintendo switch"}}
|
|
|
|
| 379 |
Weight: {{e.g., "15kg" or "33 lbs"}}
|
| 380 |
|
| 381 |
# Personality
|
| 382 |
+
{{1-2 sentences describing personality traits based on the object's real-world function and characteristics}}
|
| 383 |
+
|
| 384 |
+
# Physical Appearance
|
| 385 |
+
{{2-3 paragraphs describing how the SPECIFIC object's visual features translate into monster features. Reference the actual object by name. Describe body structure, colors, textures, materials, distinctive markings, and how each physical element relates to the source object.}}
|
| 386 |
|
| 387 |
+
# Lore & Behavior
|
| 388 |
+
{{2-3 paragraphs describing the creature's behavior, habitat, abilities, and role in its ecosystem. What does it DO? Where does it live? How does it interact with its environment? What are its natural behaviors and powers that reflect the object's real-world function? This is the creature's background story and behavioral profile.}}
|
| 389 |
|
| 390 |
# Monster Image Prompt
|
| 391 |
+
{{Detailed 3-4 sentence visual description for image generation. Must include: "Inspired by [specific object name]" at the start. Describe body structure, colors, textures, materials, distinctive features, personality-driven pose/expression, dynamic action or stance, environment/background setting, and atmospheric lighting. Be specific and detailed about visual elements.}}
|
| 392 |
```
|
| 393 |
|
| 394 |
CRITICAL RULES:
|
| 395 |
+
- Canonical Object MUST be SPECIFIC: "f-16 fighting falcon" not "jet", "macbook pro" not "laptop", "coca cola" not "soda"
|
| 396 |
- If you can identify a brand, model, or proper name from the description, USE IT
|
| 397 |
- Variation should be meaningful and distinctive (material, style, color, context, or model variant)
|
| 398 |
+
- Physical Appearance must describe the CREATURE'S BODY with references to the specific object's visual features
|
| 399 |
+
- Lore & Behavior must describe WHAT THE CREATURE DOES, not how it looks
|
| 400 |
+
- Monster Image Prompt must START with "Inspired by [object name]" and be detailed (3-4 sentences)
|
| 401 |
+
- Monster Image Prompt must NOT include the monster's name or style prefixes like "Anime-style" or "Pokemon-style"
|
| 402 |
+
- Primary Type must match the object category (machina for electronics/vehicles, structure for buildings, etc.)"""
|
| 403 |
|
| 404 |
response_text = PicletGeneratorService.generate_text_with_gpt(concept_prompt, hf_token)
|
| 405 |
|
|
|
|
| 433 |
rarity_text = extract_section(concept_text, 'Object Rarity').lower()
|
| 434 |
monster_name = extract_section(concept_text, 'Monster Name')
|
| 435 |
primary_type = extract_section(concept_text, 'Primary Type').lower()
|
| 436 |
+
|
| 437 |
+
# Extract both appearance and lore sections, combine them
|
| 438 |
+
physical_appearance = extract_section(concept_text, 'Physical Appearance')
|
| 439 |
+
lore_behavior = extract_section(concept_text, 'Lore & Behavior')
|
| 440 |
+
|
| 441 |
+
# Combine both sections with a separator for complete description
|
| 442 |
+
description = physical_appearance
|
| 443 |
+
if lore_behavior:
|
| 444 |
+
description = f"{physical_appearance}\n\n{lore_behavior}" if physical_appearance else lore_behavior
|
| 445 |
+
|
| 446 |
image_prompt = extract_section(concept_text, 'Monster Image Prompt')
|
| 447 |
|
| 448 |
# Parse physical stats
|