Deadmon commited on
Commit
bc7c0d9
·
verified ·
1 Parent(s): f5572da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -90,7 +90,6 @@ def generate_image(prompt, image=None):
90
  print("Full Text Response from Gemini:", full_text_response) # Debugging full text
91
  return None, full_text_response # Return full text response
92
 
93
-
94
  # Function to handle chat interaction
95
  def chat_handler(prompt, user_image, chat_history):
96
  # Add the user prompt to the chat history - ONLY TEXT PROMPT for user message
@@ -150,19 +149,22 @@ with gr.Blocks(title="Image Editing Chatbot") as demo:
150
 
151
  # Input area
152
  with gr.Row():
153
- with gr.Column():
154
  image_input = gr.Image(
155
  label="Upload Image",
156
  type="pil",
157
  scale=1,
158
- height=100
 
 
159
  )
160
  prompt_input = gr.Textbox(
161
  label="Prompt",
162
  placeholder="Enter your image description here...",
163
- lines=3
 
164
  )
165
- generate_btn = gr.Button("Generate Image")
166
 
167
  # State to maintain chat history
168
  chat_state = gr.State([])
 
90
  print("Full Text Response from Gemini:", full_text_response) # Debugging full text
91
  return None, full_text_response # Return full text response
92
 
 
93
  # Function to handle chat interaction
94
  def chat_handler(prompt, user_image, chat_history):
95
  # Add the user prompt to the chat history - ONLY TEXT PROMPT for user message
 
149
 
150
  # Input area
151
  with gr.Row():
152
+ with gr.Column(scale=2): # Increased scale for better spacing
153
  image_input = gr.Image(
154
  label="Upload Image",
155
  type="pil",
156
  scale=1,
157
+ height=150, # Increased height for better visibility
158
+ container=True, # Ensure the component has a container for padding
159
+ elem_classes="p-4" # Add padding via CSS class (4 units of padding)
160
  )
161
  prompt_input = gr.Textbox(
162
  label="Prompt",
163
  placeholder="Enter your image description here...",
164
+ lines=3,
165
+ elem_classes="mt-2" # Add margin-top for spacing between components
166
  )
167
+ generate_btn = gr.Button("Generate Image", elem_classes="mt-2") # Add margin-top for the button
168
 
169
  # State to maintain chat history
170
  chat_state = gr.State([])