|
import streamlit as st |
|
import openai |
|
|
|
|
|
openai.api_key = st.secrets["YOUR_OPENAI_API_KEY"] |
|
|
|
st.title("Real Estate Video Background Image Generator") |
|
|
|
|
|
image_theme = st.text_input("Image Theme", placeholder="Enter a theme for your image (e.g., cozy living room, modern office)") |
|
color_scheme = st.text_input("Color Scheme", placeholder="Preferred color scheme (e.g., warm, cool, monochromatic)") |
|
additional_elements = st.text_input("Additional Elements", placeholder="Any specific elements to include in the image?") |
|
|
|
if st.button('Generate Image'): |
|
|
|
prompt = f"Create an image with the theme: '{image_theme}', color scheme: '{color_scheme}', including elements: '{additional_elements}'." |
|
|
|
|
|
response = openai.Image.create( |
|
prompt=prompt, |
|
n=1, |
|
size="1024x1024" |
|
) |
|
|
|
|
|
image_data = response.data[0] |
|
st.image(image_data, caption='Generated Image') |
|
|