Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Import necessary libraries
|
| 2 |
+
import streamlit as st
|
| 3 |
+
from tungsten import TungstenAI
|
| 4 |
+
|
| 5 |
+
# Load Tungsten AI model
|
| 6 |
+
model = TungstenAI()
|
| 7 |
+
|
| 8 |
+
# Create Streamlit app
|
| 9 |
+
st.title("Text to Image Generation with Tungsten AI")
|
| 10 |
+
|
| 11 |
+
# User input for text
|
| 12 |
+
text_input = st.text_area("Enter text for image generation:")
|
| 13 |
+
|
| 14 |
+
# Generate Image button
|
| 15 |
+
if st.button("Generate Image"):
|
| 16 |
+
# Generate image based on input text
|
| 17 |
+
generated_image = model.generate(text_input)
|
| 18 |
+
|
| 19 |
+
# Display the generated image
|
| 20 |
+
st.image(generated_image, caption="Generated Image", use_column_width=True)
|