Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
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 |
-
|
| 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="
|
| 151 |
-
gr.Markdown("#
|
| 152 |
-
gr.Markdown("Upload an image, enter a description of the edit you want, and let
|
| 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 |
-
|
| 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):
|