Spaces:
Sleeping
Sleeping
Andre
commited on
Commit
·
336e78e
1
Parent(s):
e19588a
“Update”
Browse files- src/img_gen_colab.py +14 -8
src/img_gen_colab.py
CHANGED
@@ -27,16 +27,22 @@ def generate_image(prompt, team, model_name, height, width, num_inference_steps,
|
|
27 |
# Determine the enemy color
|
28 |
enemy_color = "blue" if team.lower() == "red" else "red"
|
29 |
|
30 |
-
# Replace {enemy_color} in the prompt
|
31 |
-
prompt = prompt.format(enemy_color=enemy_color)
|
32 |
-
|
33 |
-
# Add team-specific details to the prompt
|
34 |
if team.lower() == "red":
|
35 |
-
|
36 |
elif team.lower() == "blue":
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
# Append the custom prompt if provided
|
42 |
if custom_prompt.strip():
|
|
|
27 |
# Determine the enemy color
|
28 |
enemy_color = "blue" if team.lower() == "red" else "red"
|
29 |
|
|
|
|
|
|
|
|
|
30 |
if team.lower() == "red":
|
31 |
+
winning_team_text = " The winning army is dressed in red armor and banners."
|
32 |
elif team.lower() == "blue":
|
33 |
+
winning_team_text = " The winning army is dressed in blue armor and banners."
|
34 |
+
|
35 |
+
# Print the original prompt and dynamic values for debugging
|
36 |
+
print("Original Prompt:")
|
37 |
+
print(prompt)
|
38 |
+
print(f"Enemy Color: {enemy_color}")
|
39 |
+
print(f"Winning Team Text: {winning_team_text}")
|
40 |
+
|
41 |
+
prompt = prompt.format(enemy_color=enemy_color, winning_team_text = winning_team_text)
|
42 |
+
|
43 |
+
# Print the formatted prompt for debugging
|
44 |
+
print("\nFormatted Prompt:")
|
45 |
+
print(prompt)
|
46 |
|
47 |
# Append the custom prompt if provided
|
48 |
if custom_prompt.strip():
|