Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
-
# Import necessary libraries
|
2 |
import streamlit as st
|
3 |
-
from
|
4 |
|
5 |
# Load Tungsten AI model
|
6 |
-
model =
|
7 |
|
8 |
-
#
|
9 |
st.title("Text to Image Generation with Tungsten AI")
|
10 |
|
11 |
# User input for text
|
@@ -14,7 +13,10 @@ text_input = st.text_area("Enter text for image generation:")
|
|
14 |
# Generate Image button
|
15 |
if st.button("Generate Image"):
|
16 |
# Generate image based on input text
|
17 |
-
|
|
|
|
|
|
|
18 |
|
19 |
# Display the generated image
|
20 |
-
st.image(
|
|
|
|
|
1 |
import streamlit as st
|
2 |
+
from tungstenkit import models
|
3 |
|
4 |
# Load Tungsten AI model
|
5 |
+
model = models.get("text-to-image")
|
6 |
|
7 |
+
# Streamlit app title
|
8 |
st.title("Text to Image Generation with Tungsten AI")
|
9 |
|
10 |
# User input for text
|
|
|
13 |
# Generate Image button
|
14 |
if st.button("Generate Image"):
|
15 |
# Generate image based on input text
|
16 |
+
result = model.predict({"prompt": text_input})
|
17 |
+
|
18 |
+
# Get the image path from the result
|
19 |
+
image_path = result["image"]
|
20 |
|
21 |
# Display the generated image
|
22 |
+
st.image(image_path, caption="Generated Image", use_column_width=True)
|