bizvideoschool commited on
Commit
a7cf0d8
1 Parent(s): 2644789

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -7,20 +7,20 @@ from io import BytesIO
7
  # Set up the OpenAI API key from Hugging Face Spaces secrets
8
  openai.api_key = st.secrets["OPENAI_API_KEY"]
9
 
10
- st.title("Short-Form Video Backdrop and Image Generator")
11
 
12
  # User inputs for image generation
13
  st.subheader("Define Your Business")
14
- business_type = st.text_input("Your Business Type", placeholder="e.g., Cafe, Florist, Yoga Studio")
15
 
16
- st.subheader("Video Backdrop Details")
17
- video_theme = st.text_input("Video Theme", placeholder="Enter a theme for your TikTok video (e.g., cozy cafe, floral arrangement, yoga session)")
18
- color_scheme = st.text_input("Color Scheme", placeholder="Preferred color scheme (e.g., pastel, vibrant, earth tones)")
19
- additional_elements = st.text_input("Additional Elements", placeholder="Any specific elements to include in the backdrop (e.g., coffee cups, flowers, yoga mats)")
20
 
21
  if st.button('Generate Image'):
22
- # Construct the prompt
23
- prompt = f"Create a vertical image that could be used in the background of a video on TikTok or Reels for a {business_type}. Theme: '{video_theme}', color scheme: '{color_scheme}', including elements: '{additional_elements}'."
24
 
25
  # Call the DALL-E API
26
  try:
@@ -28,7 +28,7 @@ if st.button('Generate Image'):
28
  model="dall-e-3", # Specify DALL-E 3 model
29
  prompt=prompt,
30
  n=1,
31
- size="1024x1792", # Set image dimensions to vertical
32
  quality="standard" # Set image quality to standard for lower cost
33
  )
34
 
@@ -40,7 +40,7 @@ if st.button('Generate Image'):
40
  image = Image.open(BytesIO(image_response.content))
41
 
42
  # Display the image
43
- st.image(image, caption='Generated Business Video Backdrop Image')
44
 
45
  except Exception as e:
46
  st.error(f"An error occurred: {e}")
 
7
  # Set up the OpenAI API key from Hugging Face Spaces secrets
8
  openai.api_key = st.secrets["OPENAI_API_KEY"]
9
 
10
+ st.title("Valentine's Day Video Backdrop Generator")
11
 
12
  # User inputs for image generation
13
  st.subheader("Define Your Business")
14
+ business_type = st.text_input("Your Business Type", placeholder="e.g., Cafe, Florist, Jewelry Store")
15
 
16
+ st.subheader("Valentine's Day Backdrop Details")
17
+ video_theme = st.text_input("Video Theme", placeholder="Valentine's Day theme for your video (e.g., romantic dinner, bouquet of flowers, gift showcase)")
18
+ color_scheme = st.text_input("Color Scheme", placeholder="Valentine's Day color scheme (e.g., red and white, pink and gold)")
19
+ additional_elements = st.text_input("Additional Elements", placeholder="Valentine's Day specific elements to include (e.g., hearts, chocolates, candles)")
20
 
21
  if st.button('Generate Image'):
22
+ # Construct the prompt for Valentine's Day theme
23
+ prompt = f"Create a vertical image for a {business_type} with a Valentine's Day theme: '{video_theme}', color scheme: '{color_scheme}', including elements: '{additional_elements}'. This image will be used as a backdrop for a TikTok or Instagram Reels video."
24
 
25
  # Call the DALL-E API
26
  try:
 
28
  model="dall-e-3", # Specify DALL-E 3 model
29
  prompt=prompt,
30
  n=1,
31
+ size="1024x1792", # Set image dimensions to vertical for TikTok or Reels
32
  quality="standard" # Set image quality to standard for lower cost
33
  )
34
 
 
40
  image = Image.open(BytesIO(image_response.content))
41
 
42
  # Display the image
43
+ st.image(image, caption='Generated Valentine\'s Day Video Backdrop Image')
44
 
45
  except Exception as e:
46
  st.error(f"An error occurred: {e}")