Andre commited on
Commit
2c1d8b2
·
1 Parent(s): 16f92a8

minor updates

Browse files
adventurers_data.json CHANGED
@@ -2,30 +2,30 @@
2
  "data": {
3
  "adventurers": [
4
  {
5
- "owner": "0x29a092d0810ef4ad66075753c453d29e7ee3c714bf81fbb8130ffe0412fdd96",
6
- "id": 225,
7
- "name": "Blobert #446",
8
- "strength": 2,
9
- "vitality": 3,
10
- "dexterity": 1,
11
- "intelligence": 1,
12
  "wisdom": 2,
13
  "charisma": 3,
14
- "level": 4,
15
- "xp": 16,
16
  "health": 0,
17
- "beastHealth": 74,
18
- "head": null,
19
- "hand": null,
20
- "chest": "Leather Armor",
21
  "waist": "Leather Belt",
22
  "foot": "Leather Boots",
23
  "weapon": "Warhammer",
24
- "gold": 0,
25
  "neck": null,
26
  "ring": null,
27
  "luck": 2,
28
- "battleActionCount": 3,
29
  "customRenderer": null,
30
  "statUpgrades": 0
31
  }
 
2
  "data": {
3
  "adventurers": [
4
  {
5
+ "owner": "0x52eaece65e70b394f6907fbef609a143466ee0b861bc339306ab54dc8668a25",
6
+ "id": 9,
7
+ "name": "Blobert #34",
8
+ "strength": 1,
9
+ "vitality": 2,
10
+ "dexterity": 3,
11
+ "intelligence": 4,
12
  "wisdom": 2,
13
  "charisma": 3,
14
+ "level": 7,
15
+ "xp": 52,
16
  "health": 0,
17
+ "beastHealth": 14,
18
+ "head": "Cap",
19
+ "hand": "Leather Gloves",
20
+ "chest": "Ring Mail",
21
  "waist": "Leather Belt",
22
  "foot": "Leather Boots",
23
  "weapon": "Warhammer",
24
+ "gold": 7,
25
  "neck": null,
26
  "ring": null,
27
  "luck": 2,
28
+ "battleActionCount": 2,
29
  "customRenderer": null,
30
  "statUpgrades": 0
31
  }
adventurers_data2.json CHANGED
@@ -2,115 +2,115 @@
2
  "data": {
3
  "battles": [
4
  {
5
- "adventurerId": 225,
6
- "adventurerHealth": 24,
7
- "beast": "Dragon",
8
- "beastHealth": 74,
9
- "beastLevel": 5,
10
- "seed": "0x141120e5",
11
- "attacker": "Beast",
12
- "fled": false,
13
- "damageDealt": 0,
14
- "criticalHit": false,
15
- "damageTaken": 24,
16
- "damageLocation": "Foot",
17
- "xpEarnedAdventurer": 0,
18
- "xpEarnedItems": 0,
19
- "goldEarned": 0,
20
- "discoveryTime": "2024-09-14T10:53:37.040Z"
21
- },
22
- {
23
- "adventurerId": 225,
24
  "adventurerHealth": 0,
25
- "beast": "Dragon",
26
- "beastHealth": 74,
27
- "beastLevel": 5,
28
- "seed": "0x141120e5",
29
  "attacker": "Adventurer",
30
  "fled": false,
31
- "damageDealt": 0,
32
  "criticalHit": false,
33
  "damageTaken": 0,
34
  "damageLocation": null,
35
  "xpEarnedAdventurer": 0,
36
  "xpEarnedItems": 0,
37
  "goldEarned": 0,
38
- "discoveryTime": "2024-09-14T10:53:37.040Z"
39
  },
40
  {
41
- "adventurerId": 225,
42
- "adventurerHealth": 72,
43
- "beast": "Dragon",
44
- "beastHealth": 74,
45
- "beastLevel": 5,
46
- "seed": "0x141120e5",
47
  "attacker": "Beast",
48
  "fled": false,
49
  "damageDealt": 0,
50
  "criticalHit": false,
51
- "damageTaken": 24,
52
- "damageLocation": "Chest",
53
  "xpEarnedAdventurer": 0,
54
  "xpEarnedItems": 0,
55
  "goldEarned": 0,
56
- "discoveryTime": "2024-09-14T10:53:06.844Z"
57
  },
58
  {
59
- "adventurerId": 225,
60
- "adventurerHealth": 24,
61
- "beast": "Dragon",
62
- "beastHealth": 74,
63
- "beastLevel": 5,
64
- "seed": "0x141120e5",
65
  "attacker": "Adventurer",
66
  "fled": false,
67
- "damageDealt": 0,
68
- "criticalHit": false,
69
  "damageTaken": 0,
70
  "damageLocation": null,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  "xpEarnedAdventurer": 0,
72
  "xpEarnedItems": 0,
73
  "goldEarned": 0,
74
- "discoveryTime": "2024-09-14T10:53:37.039Z"
75
  },
76
  {
77
- "adventurerId": 225,
78
- "adventurerHealth": 48,
79
- "beast": "Dragon",
80
- "beastHealth": 74,
81
- "beastLevel": 5,
82
- "seed": "0x141120e5",
83
- "attacker": "Adventurer",
84
  "fled": false,
85
  "damageDealt": 0,
86
  "criticalHit": false,
87
- "damageTaken": 0,
88
- "damageLocation": null,
89
  "xpEarnedAdventurer": 0,
90
  "xpEarnedItems": 0,
91
  "goldEarned": 0,
92
- "discoveryTime": "2024-09-14T10:53:37.039Z"
93
  },
94
  {
95
- "adventurerId": 225,
96
- "adventurerHealth": 31,
97
- "beast": "Tarrasque",
98
- "beastHealth": 0,
99
- "beastLevel": 6,
100
- "seed": "0xa09ad3ea",
101
- "attacker": "Adventurer",
102
- "fled": true,
103
  "damageDealt": 0,
104
  "criticalHit": false,
105
- "damageTaken": 0,
106
- "damageLocation": null,
107
  "xpEarnedAdventurer": 0,
108
  "xpEarnedItems": 0,
109
  "goldEarned": 0,
110
- "discoveryTime": "2024-09-14T10:51:36.286Z"
111
  },
112
  {
113
- "adventurerId": 225,
114
  "adventurerHealth": 90,
115
  "beast": "Spider",
116
  "beastHealth": 0,
@@ -125,15 +125,15 @@
125
  "xpEarnedAdventurer": 4,
126
  "xpEarnedItems": 8,
127
  "goldEarned": 0,
128
- "discoveryTime": "2024-09-14T10:50:02.212Z"
129
  },
130
  {
131
- "adventurerId": 225,
132
  "adventurerHealth": 90,
133
- "beast": "Bear",
134
  "beastHealth": 3,
135
  "beastLevel": 1,
136
- "seed": "0xe1",
137
  "attacker": "Beast",
138
  "fled": false,
139
  "damageDealt": 0,
@@ -143,43 +143,43 @@
143
  "xpEarnedAdventurer": 0,
144
  "xpEarnedItems": 0,
145
  "goldEarned": 0,
146
- "discoveryTime": "2024-09-10T18:35:04.955Z"
147
  },
148
  {
149
- "adventurerId": 225,
150
- "adventurerHealth": 31,
151
- "beast": "Tarrasque",
152
- "beastHealth": 58,
153
- "beastLevel": 6,
154
- "seed": "0xa09ad3ea",
155
- "attacker": "Beast",
156
  "fled": false,
157
- "damageDealt": 0,
158
- "criticalHit": true,
159
- "damageTaken": 89,
160
- "damageLocation": "Foot",
161
  "xpEarnedAdventurer": 0,
162
  "xpEarnedItems": 0,
163
  "goldEarned": 0,
164
- "discoveryTime": "2024-09-14T10:51:36.286Z"
165
  },
166
  {
167
- "adventurerId": 225,
168
- "adventurerHealth": 48,
169
- "beast": "Dragon",
170
- "beastHealth": 74,
171
- "beastLevel": 5,
172
- "seed": "0x141120e5",
173
- "attacker": "Beast",
174
  "fled": false,
175
- "damageDealt": 0,
176
  "criticalHit": false,
177
- "damageTaken": 24,
178
- "damageLocation": "Waist",
179
  "xpEarnedAdventurer": 0,
180
  "xpEarnedItems": 0,
181
  "goldEarned": 0,
182
- "discoveryTime": "2024-09-14T10:53:37.039Z"
183
  }
184
  ]
185
  }
 
2
  "data": {
3
  "battles": [
4
  {
5
+ "adventurerId": 9,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  "adventurerHealth": 0,
7
+ "beast": "Skinwalker",
8
+ "beastHealth": 14,
9
+ "beastLevel": 20,
10
+ "seed": "0x3f103d85",
11
  "attacker": "Adventurer",
12
  "fled": false,
13
+ "damageDealt": 4,
14
  "criticalHit": false,
15
  "damageTaken": 0,
16
  "damageLocation": null,
17
  "xpEarnedAdventurer": 0,
18
  "xpEarnedItems": 0,
19
  "goldEarned": 0,
20
+ "discoveryTime": "2024-09-10T18:55:57.992Z"
21
  },
22
  {
23
+ "adventurerId": 9,
24
+ "adventurerHealth": 0,
25
+ "beast": "Skinwalker",
26
+ "beastHealth": 14,
27
+ "beastLevel": 20,
28
+ "seed": "0x3f103d85",
29
  "attacker": "Beast",
30
  "fled": false,
31
  "damageDealt": 0,
32
  "criticalHit": false,
33
+ "damageTaken": 75,
34
+ "damageLocation": "Head",
35
  "xpEarnedAdventurer": 0,
36
  "xpEarnedItems": 0,
37
  "goldEarned": 0,
38
+ "discoveryTime": "2024-09-10T18:55:57.993Z"
39
  },
40
  {
41
+ "adventurerId": 9,
42
+ "adventurerHealth": 126,
43
+ "beast": "Gnome",
44
+ "beastHealth": 0,
45
+ "beastLevel": 9,
46
+ "seed": "0x6a7673a5",
47
  "attacker": "Adventurer",
48
  "fled": false,
49
+ "damageDealt": 7,
50
+ "criticalHit": true,
51
  "damageTaken": 0,
52
  "damageLocation": null,
53
+ "xpEarnedAdventurer": 4,
54
+ "xpEarnedItems": 8,
55
+ "goldEarned": 0,
56
+ "discoveryTime": "2024-09-10T18:48:51.392Z"
57
+ },
58
+ {
59
+ "adventurerId": 9,
60
+ "adventurerHealth": 22,
61
+ "beast": "Skinwalker",
62
+ "beastHealth": 18,
63
+ "beastLevel": 20,
64
+ "seed": "0x3f103d85",
65
+ "attacker": "Beast",
66
+ "fled": false,
67
+ "damageDealt": 0,
68
+ "criticalHit": false,
69
+ "damageTaken": 75,
70
+ "damageLocation": "Head",
71
  "xpEarnedAdventurer": 0,
72
  "xpEarnedItems": 0,
73
  "goldEarned": 0,
74
+ "discoveryTime": "2024-09-10T18:55:57.992Z"
75
  },
76
  {
77
+ "adventurerId": 9,
78
+ "adventurerHealth": 97,
79
+ "beast": "Skinwalker",
80
+ "beastHealth": 22,
81
+ "beastLevel": 20,
82
+ "seed": "0x3f103d85",
83
+ "attacker": "Beast",
84
  "fled": false,
85
  "damageDealt": 0,
86
  "criticalHit": false,
87
+ "damageTaken": 33,
88
+ "damageLocation": "Chest",
89
  "xpEarnedAdventurer": 0,
90
  "xpEarnedItems": 0,
91
  "goldEarned": 0,
92
+ "discoveryTime": "2024-09-10T18:55:24.653Z"
93
  },
94
  {
95
+ "adventurerId": 9,
96
+ "adventurerHealth": 126,
97
+ "beast": "Gnome",
98
+ "beastHealth": 7,
99
+ "beastLevel": 9,
100
+ "seed": "0x6a7673a5",
101
+ "attacker": "Beast",
102
+ "fled": false,
103
  "damageDealt": 0,
104
  "criticalHit": false,
105
+ "damageTaken": 4,
106
+ "damageLocation": "Head",
107
  "xpEarnedAdventurer": 0,
108
  "xpEarnedItems": 0,
109
  "goldEarned": 0,
110
+ "discoveryTime": "2024-09-10T18:48:51.392Z"
111
  },
112
  {
113
+ "adventurerId": 9,
114
  "adventurerHealth": 90,
115
  "beast": "Spider",
116
  "beastHealth": 0,
 
125
  "xpEarnedAdventurer": 4,
126
  "xpEarnedItems": 8,
127
  "goldEarned": 0,
128
+ "discoveryTime": "2024-09-10T18:42:07.398Z"
129
  },
130
  {
131
+ "adventurerId": 9,
132
  "adventurerHealth": 90,
133
+ "beast": "Rat",
134
  "beastHealth": 3,
135
  "beastLevel": 1,
136
+ "seed": "0x9",
137
  "attacker": "Beast",
138
  "fled": false,
139
  "damageDealt": 0,
 
143
  "xpEarnedAdventurer": 0,
144
  "xpEarnedItems": 0,
145
  "goldEarned": 0,
146
+ "discoveryTime": "2024-09-10T18:35:04.877Z"
147
  },
148
  {
149
+ "adventurerId": 9,
150
+ "adventurerHealth": 126,
151
+ "beast": "Gnome",
152
+ "beastHealth": 7,
153
+ "beastLevel": 9,
154
+ "seed": "0x6a7673a5",
155
+ "attacker": "Adventurer",
156
  "fled": false,
157
+ "damageDealt": 4,
158
+ "criticalHit": false,
159
+ "damageTaken": 0,
160
+ "damageLocation": null,
161
  "xpEarnedAdventurer": 0,
162
  "xpEarnedItems": 0,
163
  "goldEarned": 0,
164
+ "discoveryTime": "2024-09-10T18:48:51.392Z"
165
  },
166
  {
167
+ "adventurerId": 9,
168
+ "adventurerHealth": 22,
169
+ "beast": "Skinwalker",
170
+ "beastHealth": 18,
171
+ "beastLevel": 20,
172
+ "seed": "0x3f103d85",
173
+ "attacker": "Adventurer",
174
  "fled": false,
175
+ "damageDealt": 4,
176
  "criticalHit": false,
177
+ "damageTaken": 0,
178
+ "damageLocation": null,
179
  "xpEarnedAdventurer": 0,
180
  "xpEarnedItems": 0,
181
  "goldEarned": 0,
182
+ "discoveryTime": "2024-09-10T18:55:57.992Z"
183
  }
184
  ]
185
  }
app copy.py CHANGED
@@ -25,7 +25,7 @@ def gradio_interface():
25
  #prompt_dropdown = gr.Dropdown(choices=[p["alias"] for p in prompts], label="Select Beast", value=prompts[0]["alias"])
26
  adventurer_id = gr.Number(label="Adventurer ID:")
27
  #character_dropdown = gr.Dropdown(choices=["Wizard", "Hunter", "Warrior"], label="Select Character Type", value="Wizard")
28
- scene_dropdown = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Adventurer Portait")
29
  #model_dropdown = gr.Dropdown(choices=[m["alias"] for m in models], label="Select Model", value=models[0]["alias"])
30
  with gr.Row():
31
  # Add a text box for custom user input (max 200 characters)
@@ -33,10 +33,7 @@ def gradio_interface():
33
  with gr.Row():
34
  generate_button = gr.Button("Generate Image")
35
  with gr.Row():
36
- output_image1 = gr.Image(elem_classes="output-image", label="Generated Image", show_label=False, scale=1, width="100%")
37
- output_image2 = gr.Image(elem_classes="output-image", label="Generated Image", show_label=False, scale=1, width="100%")
38
- output_image3 = gr.Image(elem_classes="output-image", label="Generated Image", show_label=False, scale=1, width="100%")
39
- output_image4 = gr.Image(elem_classes="output-image", label="Generated Image", show_label=False, scale=1, width="100%")
40
  with gr.Row():
41
  status_text = gr.Textbox(label="Status", placeholder="Waiting for input...", interactive=False)
42
  # Connect the button to the function
@@ -49,7 +46,7 @@ def gradio_interface():
49
  #model_dropdown,
50
  custom_prompt_input,
51
  ],
52
- outputs=[output_image1, status_text]
53
  )
54
  return demo
55
 
 
25
  #prompt_dropdown = gr.Dropdown(choices=[p["alias"] for p in prompts], label="Select Beast", value=prompts[0]["alias"])
26
  adventurer_id = gr.Number(label="Adventurer ID:")
27
  #character_dropdown = gr.Dropdown(choices=["Wizard", "Hunter", "Warrior"], label="Select Character Type", value="Wizard")
28
+ scene_dropdown = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Final Scene"], label="Select Scene", value="Adventurer Portait")
29
  #model_dropdown = gr.Dropdown(choices=[m["alias"] for m in models], label="Select Model", value=models[0]["alias"])
30
  with gr.Row():
31
  # Add a text box for custom user input (max 200 characters)
 
33
  with gr.Row():
34
  generate_button = gr.Button("Generate Image")
35
  with gr.Row():
36
+ output_image = gr.Image(elem_classes="output-image", label="Generated Image", show_label=False, scale=1, width="100%")
 
 
 
37
  with gr.Row():
38
  status_text = gr.Textbox(label="Status", placeholder="Waiting for input...", interactive=False)
39
  # Connect the button to the function
 
46
  #model_dropdown,
47
  custom_prompt_input,
48
  ],
49
+ outputs=[output_image, status_text]
50
  )
51
  return demo
52
 
app.py CHANGED
@@ -5,6 +5,7 @@ from config.models import models
5
  import gradio as gr
6
  from src.img_gen import generate_image
7
  from metadata.metadata import fetch_metadata
 
8
 
9
  # Gradio Interface
10
  def gradio_interface():
@@ -30,7 +31,7 @@ def gradio_interface():
30
  scene_dropdown2 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Beast Portait", visible=False )
31
  scene_dropdown3 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Encounter", visible=False )
32
  scene_dropdown4 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Last Battle", visible=False )
33
- scene_dropdown5 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Loot Bag", visible=False )
34
  custom_prompt_input = gr.Textbox(label="Custom Prompt (Optional)", placeholder="Enter additional details (max 200 chars)...", max_lines=1, max_length=200)
35
  #model_dropdown = gr.Dropdown(choices=[m["alias"] for m in models], label="Select Model", value=models[0]["alias"])
36
  #with gr.Row():
@@ -43,7 +44,7 @@ def gradio_interface():
43
  with gr.Row():
44
  output_image3 = gr.Image(elem_classes="output-image", label="Encounter", show_label=True, scale=1, width="100%")
45
  output_image4 = gr.Image(elem_classes="output-image", label="Last Battle", show_label=True, scale=1, width="100%")
46
- output_image5 = gr.Image(elem_classes="output-image", label="Loot Bag", show_label=True, scale=1, width="100%")
47
 
48
  with gr.Row():
49
  status_text = gr.Textbox(label="Status", placeholder="Waiting for input...", interactive=False)
 
5
  import gradio as gr
6
  from src.img_gen import generate_image
7
  from metadata.metadata import fetch_metadata
8
+ import time
9
 
10
  # Gradio Interface
11
  def gradio_interface():
 
31
  scene_dropdown2 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Beast Portait", visible=False )
32
  scene_dropdown3 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Encounter", visible=False )
33
  scene_dropdown4 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Last Battle", visible=False )
34
+ scene_dropdown5 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Final Scene"], label="Select Scene", value="Final Scene", visible=False )
35
  custom_prompt_input = gr.Textbox(label="Custom Prompt (Optional)", placeholder="Enter additional details (max 200 chars)...", max_lines=1, max_length=200)
36
  #model_dropdown = gr.Dropdown(choices=[m["alias"] for m in models], label="Select Model", value=models[0]["alias"])
37
  #with gr.Row():
 
44
  with gr.Row():
45
  output_image3 = gr.Image(elem_classes="output-image", label="Encounter", show_label=True, scale=1, width="100%")
46
  output_image4 = gr.Image(elem_classes="output-image", label="Last Battle", show_label=True, scale=1, width="100%")
47
+ output_image5 = gr.Image(elem_classes="output-image", label="Final Scene", show_label=True, scale=1, width="100%")
48
 
49
  with gr.Row():
50
  status_text = gr.Textbox(label="Status", placeholder="Waiting for input...", interactive=False)
app_modal.py CHANGED
@@ -64,7 +64,7 @@ def gradio_interface():
64
  scene_dropdown2 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Beast Portait", visible=False )
65
  scene_dropdown3 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Encounter", visible=False )
66
  scene_dropdown4 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Last Battle", visible=False )
67
- scene_dropdown5 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Loot Bag", visible=False )
68
  custom_prompt_input = gr.Textbox(label="Custom Prompt (Optional)", placeholder="Enter additional details (max 200 chars)...", max_lines=1, max_length=200)
69
  #model_dropdown = gr.Dropdown(choices=[m["alias"] for m in models], label="Select Model", value=models[0]["alias"])
70
  #with gr.Row():
@@ -77,7 +77,7 @@ def gradio_interface():
77
  with gr.Row():
78
  output_image3 = gr.Image(elem_classes="output-image", label="Encounter", show_label=True, scale=1, width="100%")
79
  output_image4 = gr.Image(elem_classes="output-image", label="Last Battle", show_label=True, scale=1, width="100%")
80
- output_image5 = gr.Image(elem_classes="output-image", label="Loot Bag", show_label=True, scale=1, width="100%")
81
 
82
  with gr.Row():
83
  status_text = gr.Textbox(label="Status", placeholder="Waiting for input...", interactive=False)
 
64
  scene_dropdown2 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Beast Portait", visible=False )
65
  scene_dropdown3 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Encounter", visible=False )
66
  scene_dropdown4 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Loot Bag"], label="Select Scene", value="Last Battle", visible=False )
67
+ scene_dropdown5 = gr.Dropdown(choices=["Adventurer Portait", "Encounter", "Beast Portait", "Last Battle", "Final Scene"], label="Select Scene", value="Final Scene", visible=False )
68
  custom_prompt_input = gr.Textbox(label="Custom Prompt (Optional)", placeholder="Enter additional details (max 200 chars)...", max_lines=1, max_length=200)
69
  #model_dropdown = gr.Dropdown(choices=[m["alias"] for m in models], label="Select Model", value=models[0]["alias"])
70
  #with gr.Row():
 
77
  with gr.Row():
78
  output_image3 = gr.Image(elem_classes="output-image", label="Encounter", show_label=True, scale=1, width="100%")
79
  output_image4 = gr.Image(elem_classes="output-image", label="Last Battle", show_label=True, scale=1, width="100%")
80
+ output_image5 = gr.Image(elem_classes="output-image", label="Final Scene", show_label=True, scale=1, width="100%")
81
 
82
  with gr.Row():
83
  status_text = gr.Textbox(label="Status", placeholder="Waiting for input...", interactive=False)
metadata/__pycache__/metadata.cpython-311.pyc CHANGED
Binary files a/metadata/__pycache__/metadata.cpython-311.pyc and b/metadata/__pycache__/metadata.cpython-311.pyc differ
 
requirements.txt CHANGED
@@ -2,7 +2,7 @@ torch
2
  diffusers
3
  transformers
4
  accelerate
5
- gradio==5.16.0
6
  safetensors
7
  pillow
8
  numpy<2
 
2
  diffusers
3
  transformers
4
  accelerate
5
+ gradio
6
  safetensors
7
  pillow
8
  numpy<2
src/__pycache__/prompt_gen.cpython-311.pyc CHANGED
Binary files a/src/__pycache__/prompt_gen.cpython-311.pyc and b/src/__pycache__/prompt_gen.cpython-311.pyc differ
 
src/prompt_gen copy 5.py ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from metadata.metadata import fetch_metadata
2
+
3
+ def prompt_gen(adventurer_id, scene_dropdown):
4
+ adventurer = fetch_metadata(adventurer_id)
5
+ print(f"ANDRE {adventurer['name']}")
6
+
7
+ id = adventurer['id']
8
+ name = adventurer['name']
9
+ weapon_equipment = adventurer['weapon']
10
+ head_equipment = adventurer['head']
11
+ hand_equipment = adventurer['hand']
12
+ chest_equipment = adventurer['chest']
13
+ waist_equipment = adventurer['waist']
14
+ foot_equipment = adventurer['foot']
15
+ gold_equipment = adventurer['gold']
16
+ beast_last_battle = adventurer['beast']
17
+
18
+ # Check for weapon = None to fix eventual generator mistakes
19
+ if weapon_equipment == None:
20
+ weapon_equipment = "barehands"
21
+ else:
22
+ weapon_sentence = f"holding only a {weapon_equipment}"
23
+
24
+ # if character_dropdown == "Wizard":
25
+ # character_attack_sentence = f"The adventurer is attacking using powerful magic"
26
+ # else:
27
+ # character_attack_sentence = f"The adventurer is attacking using his {weapon_equipment}"
28
+
29
+ # Function to build equipment sentence dynamically
30
+ def build_equipment_sentence(**equipment):
31
+ sentences = []
32
+
33
+ # Weapon
34
+ if equipment.get("weapon_equipment"):
35
+ sentences.append(f"holding a {equipment['weapon_equipment']}")
36
+ else:
37
+ sentences.append("holding nothing in his hands (bare hands)")
38
+
39
+ # Head
40
+ if equipment.get("head_equipment"):
41
+ sentences.append(f"wearing a {equipment['head_equipment']} on his head")
42
+ else:
43
+ sentences.append("with no head protection (bare head)")
44
+
45
+ # Hands
46
+ if equipment.get("hand_equipment"):
47
+ sentences.append(f"wearing {equipment['hand_equipment']} on his hands")
48
+ else:
49
+ sentences.append("with no hand protection (bare hands)")
50
+
51
+ # Chest
52
+ if equipment.get("chest_equipment"):
53
+ sentences.append(f"wearing a {equipment['chest_equipment']} on his chest")
54
+ else:
55
+ sentences.append("with no chest armor (bare chest)")
56
+
57
+ # Waist
58
+ if equipment.get("waist_equipment"):
59
+ sentences.append(f"wearing a {equipment['waist_equipment']} around his waist")
60
+ else:
61
+ sentences.append("with no waist equipment (bare waist)")
62
+
63
+ # Feet
64
+ if equipment.get("foot_equipment"):
65
+ sentences.append(f"wearing {equipment['foot_equipment']} on his feet")
66
+ else:
67
+ sentences.append("with no foot protection (bare feet)")
68
+
69
+ return ", ".join(sentences)
70
+
71
+ # Example usage
72
+ equipment_sentence = build_equipment_sentence(
73
+ weapon_equipment=weapon_equipment,
74
+ head_equipment=head_equipment,
75
+ hand_equipment=hand_equipment,
76
+ chest_equipment=chest_equipment,
77
+ waist_equipment=waist_equipment,
78
+ foot_equipment=foot_equipment
79
+ )
80
+
81
+ # Set the custom prompt variables
82
+ if scene_dropdown == "Adventurer Portait":
83
+ prompt = f"A portrait of a medieval, fantasy adventurer, {equipment_sentence}. All equipment is strictly medieval, crafted from materials and techniques possible in that era. Make the adventurer unshaved and dirty, as if he has been fighting for days down in the dungeons. Torchlit light environment. Foreboding dungeon scene. Unreal Engine render style, photorealistic, atmospheric dark light, realistic fantasy style."
84
+
85
+ if scene_dropdown == "Beast Portait":
86
+ prompt = f"A portait of a massive {beast_last_battle} in a dark, foreboding dungeon. Its eyes glow faintly in the dark. It roars menacingly surrounded by broken weapons and bones of his past preys. Torchlit environment, underground dungeon. Unreal Engine render style, photorealistic, atmospheric dark lights, realistic fantasy style."
87
+
88
+ if scene_dropdown == "Encounter":
89
+ prompt = f"A close-up shot of the {beast_last_battle}'s piercing eye, glowing faintly in the dim light of a torchlit dungeon. Intricate details of the beast's scaly or furred skin surround the eye, with faint scars and ancient markings hinting at its long history of battles. Torchlit environment. The atmosphere is tense, with shadows dancing across the dungeon walls and the faint glint of broken weapons and bones scattered nearby. Unreal Engine render style, photorealistic, atmospheric dark lighting, hyper-detailed, realistic fantasy style."
90
+
91
+ if scene_dropdown == "Last Battle":
92
+ prompt = f"A battle between a medieval fantasy adventurer and a massive {beast_last_battle} deep within the confines of a dark, foreboding dungeon. The adventurer is {equipment_sentence}. All equipment is strictly medieval, crafted from materials and techniques possible in that era. The {beast_last_battle} stands in a dark undergroud dungeon. Its eyes glow faintly in the dark. It roars menacingly, surrounded by broken weapons and bones of his past preys. The adventurer attacks using his {weapon_equipment} or powerful magic, the glow of his spells or the glint of his weapon illuminating the stone walls. The dungeon is dimly lit by flickering torches, their light casting long, ominous shadows across the ancient, cracked floor. Unreal Engine render style, photorealistic, realistic fantasy style."
93
+
94
+ elif scene_dropdown == "Loot Bag":
95
+ prompt = f"A loot bag from a medieval fantasy adventurer and his equipments. On the floor also a {weapon_equipment} a {head_equipment}, a {hand_equipment}, a {chest_equipment}, a {waist_equipment}, and a {foot_equipment}. All equipment is strictly medieval, crafted from materials and techniques possible in that era. Inside the bag {gold_equipment} gold coins. Atmospheric light, underground dungeon context. Torchlit environment. Unreal Engine render style, photorealistic, realistic fantasy style."
96
+ else:
97
+ pass
98
+
99
+ return adventurer, prompt
100
+
src/prompt_gen.py CHANGED
@@ -2,7 +2,7 @@ from metadata.metadata import fetch_metadata
2
 
3
  def prompt_gen(adventurer_id, scene_dropdown):
4
  adventurer = fetch_metadata(adventurer_id)
5
- print(f"ANDRE {adventurer['name']}")
6
 
7
  id = adventurer['id']
8
  name = adventurer['name']
@@ -13,7 +13,9 @@ def prompt_gen(adventurer_id, scene_dropdown):
13
  waist_equipment = adventurer['waist']
14
  foot_equipment = adventurer['foot']
15
  gold_equipment = adventurer['gold']
 
16
  beast_last_battle = adventurer['beast']
 
17
 
18
  # Check for weapon = None to fix eventual generator mistakes
19
  if weapon_equipment == None:
@@ -82,17 +84,24 @@ def prompt_gen(adventurer_id, scene_dropdown):
82
  if scene_dropdown == "Adventurer Portait":
83
  prompt = f"A portrait of a medieval, fantasy adventurer, {equipment_sentence}. All equipment is strictly medieval, crafted from materials and techniques possible in that era. Make the adventurer unshaved and dirty, as if he has been fighting for days down in the dungeons. Torchlit light environment. Foreboding dungeon scene. Unreal Engine render style, photorealistic, atmospheric dark light, realistic fantasy style."
84
 
85
- if scene_dropdown == "Beast Portait":
86
  prompt = f"A portait of a massive {beast_last_battle} in a dark, foreboding dungeon. Its eyes glow faintly in the dark. It roars menacingly surrounded by broken weapons and bones of his past preys. Torchlit environment, underground dungeon. Unreal Engine render style, photorealistic, atmospheric dark lights, realistic fantasy style."
87
 
88
- if scene_dropdown == "Encounter":
89
  prompt = f"A close-up shot of the {beast_last_battle}'s piercing eye, glowing faintly in the dim light of a torchlit dungeon. Intricate details of the beast's scaly or furred skin surround the eye, with faint scars and ancient markings hinting at its long history of battles. Torchlit environment. The atmosphere is tense, with shadows dancing across the dungeon walls and the faint glint of broken weapons and bones scattered nearby. Unreal Engine render style, photorealistic, atmospheric dark lighting, hyper-detailed, realistic fantasy style."
90
 
91
- if scene_dropdown == "Last Battle":
92
- prompt = f"A battle between a medieval fantasy adventurer and a massive {beast_last_battle} deep within the confines of a dark, foreboding dungeon. The adventurer is {equipment_sentence}. All equipment is strictly medieval, crafted from materials and techniques possible in that era. The {beast_last_battle} stands in a dark undergroud dungeon. Its eyes glow faintly in the dark. It roars menacingly, surrounded by broken weapons and bones of his past preys. The adventurer attacks using his {weapon_equipment} or powerful magic, the glow of his spells or the glint of his weapon illuminating the stone walls. The dungeon is dimly lit by flickering torches, their light casting long, ominous shadows across the ancient, cracked floor. Unreal Engine render style, photorealistic, realistic fantasy style."
93
 
94
- elif scene_dropdown == "Loot Bag":
95
- prompt = f"A loot bag from a medieval fantasy adventurer and his equipments. On the floor also a {weapon_equipment} a {head_equipment}, a {hand_equipment}, a {chest_equipment}, a {waist_equipment}, and a {foot_equipment}. All equipment is strictly medieval, crafted from materials and techniques possible in that era. Inside the bag {gold_equipment} gold coins. Atmospheric light, underground dungeon context. Torchlit environment. Unreal Engine render style, photorealistic, realistic fantasy style."
 
 
 
 
 
 
 
96
  else:
97
  pass
98
 
 
2
 
3
  def prompt_gen(adventurer_id, scene_dropdown):
4
  adventurer = fetch_metadata(adventurer_id)
5
+ print(f"\nNAME: {adventurer['name']}")
6
 
7
  id = adventurer['id']
8
  name = adventurer['name']
 
13
  waist_equipment = adventurer['waist']
14
  foot_equipment = adventurer['foot']
15
  gold_equipment = adventurer['gold']
16
+ adventurer_health = adventurer['health']
17
  beast_last_battle = adventurer['beast']
18
+ beast_health = adventurer['beastHealth']
19
 
20
  # Check for weapon = None to fix eventual generator mistakes
21
  if weapon_equipment == None:
 
84
  if scene_dropdown == "Adventurer Portait":
85
  prompt = f"A portrait of a medieval, fantasy adventurer, {equipment_sentence}. All equipment is strictly medieval, crafted from materials and techniques possible in that era. Make the adventurer unshaved and dirty, as if he has been fighting for days down in the dungeons. Torchlit light environment. Foreboding dungeon scene. Unreal Engine render style, photorealistic, atmospheric dark light, realistic fantasy style."
86
 
87
+ elif scene_dropdown == "Beast Portait":
88
  prompt = f"A portait of a massive {beast_last_battle} in a dark, foreboding dungeon. Its eyes glow faintly in the dark. It roars menacingly surrounded by broken weapons and bones of his past preys. Torchlit environment, underground dungeon. Unreal Engine render style, photorealistic, atmospheric dark lights, realistic fantasy style."
89
 
90
+ elif scene_dropdown == "Encounter":
91
  prompt = f"A close-up shot of the {beast_last_battle}'s piercing eye, glowing faintly in the dim light of a torchlit dungeon. Intricate details of the beast's scaly or furred skin surround the eye, with faint scars and ancient markings hinting at its long history of battles. Torchlit environment. The atmosphere is tense, with shadows dancing across the dungeon walls and the faint glint of broken weapons and bones scattered nearby. Unreal Engine render style, photorealistic, atmospheric dark lighting, hyper-detailed, realistic fantasy style."
92
 
93
+ elif scene_dropdown == "Last Battle":
94
+ prompt = f"A battle between a medieval fantasy adventurer and a massive {beast_last_battle} deep within the confines of a dark, foreboding dungeon. The adventurer is {equipment_sentence}. All equipment is strictly medieval, crafted from materials and techniques possible in that era. The {beast_last_battle} stands in a dark undergroud dungeon. Its eyes glow faintly in the dark. It roars menacingly, surrounded by broken weapons and bones of his past preys. The adventurer attacks using his {weapon_equipment} and powerful magic, the glow of his spells or the glint of his weapon illuminate the stone walls. The dungeon is dimly lit by flickering torches, their light casting long, ominous shadows across the ancient, cracked floor. Unreal Engine render style, photorealistic, realistic fantasy style."
95
 
96
+ elif scene_dropdown == "Final Scene":
97
+ print("===FINAL SCENE===")
98
+ print(f"adv health: {adventurer_health}")
99
+ if adventurer_health != 0:
100
+ print("\n=====THE ADVENTURER IS STILL ALIVE2=====")
101
+ prompt = f"A climactic battle between a medieval fantasy adventurer and a massive {beast_last_battle} deep within the confines of a dark, foreboding dungeon. The adventurer has emerged victorious, standing tall over the slain {beast_last_battle}. The beast lies defeated, its massive form crumpled on the dungeon floor, its faintly glowing eyes dimming as life fades. The adventurer is {equipment_sentence}, their equipment battered but intact, a testament to their skill and resilience. All equipment is strictly medieval, crafted from materials and techniques possible in that era. The scene takes place in a dark underground dungeon, dimly lit by flickering torches. The adventurer's breath is visible in the cold air, their expression a mix of exhaustion and triumph. The dungeon walls are damp and covered in moss, with ancient runes carved into the stone. Unreal Engine render style, photorealistic, realistic fantasy style, highly detailed, cinematic lighting, and atmospheric effects."
102
+ else:
103
+ print("\n=====THE ADVENTURER IS DEAD2=====")
104
+ prompt = f"Close-up shot of a dramatic battle between a medieval fantasy adventurer and a massive {beast_last_battle} deep within the confines of a dark, foreboding dungeon. The {beast_last_battle} has emerged victorious, standing triumphantly over the fallen adventurer. The adventurer lies defeated, {equipment_sentence}, their equipment shattered and scattered across the dungeon floor. All equipment is strictly medieval, crafted from materials and techniques possible in that era. The scene takes place in a dark underground dungeon, dimly lit by flickering torches. The {beast_last_battle}'s eyes glow faintly in the dark, casting an eerie light. The dungeon walls are damp and covered in moss, with ancient runes carved into the stone. Unreal Engine render style, photorealistic, realistic fantasy style, highly detailed, cinematic lighting, and atmospheric effects."
105
  else:
106
  pass
107