forked from WhyILived/FATELESS_Studios
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_map_generation.py
More file actions
73 lines (61 loc) · 2.49 KB
/
test_map_generation.py
File metadata and controls
73 lines (61 loc) · 2.49 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
#!/usr/bin/env python3
"""
Simple test script for map generation pipeline.
"""
import asyncio
import sys
from pathlib import Path
# Add the mcp_server directory to the path
sys.path.append(str(Path(__file__).parent / "mcp_server"))
from tools.map import generate_background_from_prompt
async def main():
print("Testing map generation pipeline...")
# Test different scene types
test_cases = [
{
"prompt": "The Space Ship control room with space to move around from the movie Interstellar, make it look really nice.",
"scene_type": "futuristic_room"
},
{
"prompt": "A mystical forest with ancient trees and glowing mushrooms",
"scene_type": "nature"
},
{
"prompt": "A grand palace corridor with marble floors and golden chandeliers, similar to the one from the movie Frozen. Make it look really nice.",
"scene_type": "halls"
},
{
"prompt": "A bustling Arabian marketplace with colorful tents and merchants, similar to the one from the movie Aladdin. Make it look really nice. DO NOT HAVE ANY CHARACTERS IN THE BACKGROUND.",
"scene_type": "market"
},
{
"prompt": "A magical laboratory with floating crystals and alchemical equipment",
"scene_type": "misc"
}
]
for i, test_case in enumerate(test_cases, 1):
print(f"\n--- Test {i}: {test_case['scene_type']} ---")
print(f"Prompt: {test_case['prompt']}")
try:
# Use custom naming for better organization
custom_name = f"test_{i}_{test_case['scene_type']}"
result = await generate_background_from_prompt(
test_case['prompt'],
test_case['scene_type'],
custom_name
)
print(f"Result: {result.replace('✅', 'SUCCESS:').replace('❌', 'ERROR:')}")
# Check if file was created
output_dir = Path("mcp_output/maps")
if output_dir.exists():
files = list(output_dir.glob("*.png"))
print(f"Generated files: {[f.name for f in files]}")
except Exception as e:
print(f"Error: {e}")
import traceback
traceback.print_exc()
# Small delay between tests
await asyncio.sleep(1)
print("\nMap generation tests completed!")
if __name__ == "__main__":
asyncio.run(main())