alixagari2000 commited on
Commit
f6b8525
·
verified ·
1 Parent(s): ae18f07

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -42,7 +42,7 @@ async def generate_image_gemini(prompt, image, api_key, temperature=0.4):
42
 
43
  try:
44
  # Initialize Gemini client with API key
45
- #client = genai.Client(api_key="AIzaSyAxAUAOJzMhTOY1M5Sb3Hgrma5_XzMvEyM")
46
  client = genai.Client(api_key=api_key)
47
 
48
  # Convert PIL image to bytes
@@ -147,9 +147,9 @@ def continue_editing(output_image):
147
 
148
  # Create Gradio UI
149
  def create_ui():
150
- with gr.Blocks(title="Gemini Image Editor") as app:
151
- gr.Markdown("# Gemini Image Editor")
152
- gr.Markdown("Upload an image, enter a description of the edit you want, and let Gemini do the rest!")
153
 
154
  # Store image history in state
155
  image_history = gr.State([])
@@ -158,7 +158,7 @@ def create_ui():
158
  with gr.Column():
159
  input_image = gr.Image(type="pil", label="Upload Image")
160
  prompt = gr.Textbox(label="Edit Description", placeholder="Describe the edit you want...")
161
- #api_key = gr.Textbox(label="Gemini API Key", placeholder="Enter your Gemini API key", type="password")
162
 
163
  # Replace hidden settings with accordion
164
  with gr.Accordion("Advanced Settings", open=False):
 
42
 
43
  try:
44
  # Initialize Gemini client with API key
45
+
46
  client = genai.Client(api_key=api_key)
47
 
48
  # Convert PIL image to bytes
 
147
 
148
  # Create Gradio UI
149
  def create_ui():
150
+ with gr.Blocks(title="Image Editor") as app:
151
+ gr.Markdown("# Image Editor")
152
+ gr.Markdown("Upload an image, enter a description of the edit you want, and let Model do the rest!")
153
 
154
  # Store image history in state
155
  image_history = gr.State([])
 
158
  with gr.Column():
159
  input_image = gr.Image(type="pil", label="Upload Image")
160
  prompt = gr.Textbox(label="Edit Description", placeholder="Describe the edit you want...")
161
+
162
 
163
  # Replace hidden settings with accordion
164
  with gr.Accordion("Advanced Settings", open=False):