Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,34 +32,36 @@ def generate_text(prompt, model_name="claude-3-opus-20240229"):
|
|
| 32 |
def main():
|
| 33 |
st.set_page_config(page_title="StoryForge", layout="wide")
|
| 34 |
st.title("StoryForge")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
# Sidebar for user input
|
| 37 |
with st.sidebar:
|
| 38 |
-
st.header("
|
| 39 |
image_description = st.text_area(
|
| 40 |
-
"
|
|
|
|
| 41 |
height=100
|
| 42 |
)
|
| 43 |
protagonist_description = st.text_area(
|
| 44 |
-
"
|
|
|
|
| 45 |
height=100
|
| 46 |
)
|
| 47 |
antagonist_description = st.text_area(
|
| 48 |
-
"
|
|
|
|
| 49 |
height=100
|
| 50 |
)
|
| 51 |
-
generate_text_btn = st.button("Generate
|
| 52 |
|
| 53 |
col1, col2 = st.columns(2)
|
| 54 |
|
| 55 |
with col1:
|
| 56 |
-
st.markdown(
|
| 57 |
-
"*StoryForge* is a cutting-edge AI app designed to empower *game developers* and creators. "
|
| 58 |
-
"With StoryForge, you can effortlessly craft captivating game design documents. "
|
| 59 |
-
"From crafting immersive storylines and intricate plots to defining compelling protagonists and antagonists, "
|
| 60 |
-
"StoryForge unlocks your creative potential and streamlines the game design process."
|
| 61 |
-
)
|
| 62 |
-
|
| 63 |
st.subheader("Game Environment")
|
| 64 |
if generate_text_btn and image_description:
|
| 65 |
with st.spinner("Generating game environment description..."):
|
|
@@ -68,16 +70,16 @@ def main():
|
|
| 68 |
)
|
| 69 |
st.markdown(generated_environment)
|
| 70 |
|
| 71 |
-
st.subheader("
|
| 72 |
-
if generate_text_btn and
|
| 73 |
-
with st.spinner("Generating
|
| 74 |
-
|
| 75 |
-
f"Generate a detailed description of a game
|
| 76 |
)
|
| 77 |
-
st.markdown(
|
| 78 |
|
| 79 |
with col2:
|
| 80 |
-
st.subheader("Story")
|
| 81 |
if generate_text_btn and image_description:
|
| 82 |
with st.spinner("Generating game story..."):
|
| 83 |
generated_story = generate_text(
|
|
@@ -85,21 +87,13 @@ def main():
|
|
| 85 |
)
|
| 86 |
st.markdown(generated_story)
|
| 87 |
|
| 88 |
-
st.subheader("
|
| 89 |
-
if generate_text_btn and
|
| 90 |
-
with st.spinner("Generating
|
| 91 |
-
|
| 92 |
-
f"Generate a detailed description of a game
|
| 93 |
-
)
|
| 94 |
-
st.markdown(generated_protagonist)
|
| 95 |
-
|
| 96 |
-
st.subheader("Game Plot")
|
| 97 |
-
if generate_text_btn and image_description:
|
| 98 |
-
with st.spinner("Generating game plot..."):
|
| 99 |
-
generated_plot = generate_text(
|
| 100 |
-
f"Generate a short game plot with a hook, gameplay relation, sticky mechanics, and setting based on this description: {image_description}"
|
| 101 |
)
|
| 102 |
-
st.markdown(
|
| 103 |
|
| 104 |
# Run Main Function
|
| 105 |
if __name__ == "__main__":
|
|
|
|
| 32 |
def main():
|
| 33 |
st.set_page_config(page_title="StoryForge", layout="wide")
|
| 34 |
st.title("StoryForge")
|
| 35 |
+
st.markdown(
|
| 36 |
+
"""
|
| 37 |
+
**StoryForge** helps game developers generate comprehensive Game Design Documents.
|
| 38 |
+
Input details about your game environment, protagonist, and antagonist to create a structured design document.
|
| 39 |
+
"""
|
| 40 |
+
)
|
| 41 |
|
| 42 |
# Sidebar for user input
|
| 43 |
with st.sidebar:
|
| 44 |
+
st.header("Game Details")
|
| 45 |
image_description = st.text_area(
|
| 46 |
+
"Game Environment",
|
| 47 |
+
placeholder="Describe the setting of your game",
|
| 48 |
height=100
|
| 49 |
)
|
| 50 |
protagonist_description = st.text_area(
|
| 51 |
+
"Protagonist",
|
| 52 |
+
placeholder="Describe the main character",
|
| 53 |
height=100
|
| 54 |
)
|
| 55 |
antagonist_description = st.text_area(
|
| 56 |
+
"Antagonist",
|
| 57 |
+
placeholder="Describe the main villain or opposing force",
|
| 58 |
height=100
|
| 59 |
)
|
| 60 |
+
generate_text_btn = st.button("Generate Document")
|
| 61 |
|
| 62 |
col1, col2 = st.columns(2)
|
| 63 |
|
| 64 |
with col1:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
st.subheader("Game Environment")
|
| 66 |
if generate_text_btn and image_description:
|
| 67 |
with st.spinner("Generating game environment description..."):
|
|
|
|
| 70 |
)
|
| 71 |
st.markdown(generated_environment)
|
| 72 |
|
| 73 |
+
st.subheader("Protagonist")
|
| 74 |
+
if generate_text_btn and protagonist_description:
|
| 75 |
+
with st.spinner("Generating protagonist description..."):
|
| 76 |
+
generated_protagonist = generate_text(
|
| 77 |
+
f"Generate a detailed description of a game protagonist based on this description: {protagonist_description}"
|
| 78 |
)
|
| 79 |
+
st.markdown(generated_protagonist)
|
| 80 |
|
| 81 |
with col2:
|
| 82 |
+
st.subheader("Game Story")
|
| 83 |
if generate_text_btn and image_description:
|
| 84 |
with st.spinner("Generating game story..."):
|
| 85 |
generated_story = generate_text(
|
|
|
|
| 87 |
)
|
| 88 |
st.markdown(generated_story)
|
| 89 |
|
| 90 |
+
st.subheader("Antagonist")
|
| 91 |
+
if generate_text_btn and antagonist_description:
|
| 92 |
+
with st.spinner("Generating antagonist description..."):
|
| 93 |
+
generated_antagonist = generate_text(
|
| 94 |
+
f"Generate a detailed description of a game antagonist based on this description: {antagonist_description}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
)
|
| 96 |
+
st.markdown(generated_antagonist)
|
| 97 |
|
| 98 |
# Run Main Function
|
| 99 |
if __name__ == "__main__":
|