Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,13 +88,11 @@ def edit_image(
|
|
| 88 |
except Exception as e:
|
| 89 |
raise gr.Error(f"Error during image editing: {str(e)}")
|
| 90 |
|
| 91 |
-
# Example
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
["
|
| 96 |
-
["Make it nighttime", "", 4.5, 50, 44],
|
| 97 |
-
["将图片转换为油画风格", "", 4.5, 50, 45],
|
| 98 |
]
|
| 99 |
|
| 100 |
# Build Gradio interface
|
|
@@ -197,11 +195,14 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 197 |
""")
|
| 198 |
|
| 199 |
# Examples section
|
| 200 |
-
gr.Markdown("### 📝 Example
|
| 201 |
gr.Examples(
|
| 202 |
-
examples=
|
| 203 |
-
inputs=[prompt, negative_prompt, guidance_scale, num_inference_steps, seed],
|
| 204 |
-
|
|
|
|
|
|
|
|
|
|
| 205 |
)
|
| 206 |
|
| 207 |
# Event handlers
|
|
|
|
| 88 |
except Exception as e:
|
| 89 |
raise gr.Error(f"Error during image editing: {str(e)}")
|
| 90 |
|
| 91 |
+
# Example with image
|
| 92 |
+
example_image_url = "https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.png"
|
| 93 |
+
|
| 94 |
+
example_data = [
|
| 95 |
+
[example_image_url, "Make the background gradient from blue to purple", "", 4.5, 50, 42],
|
|
|
|
|
|
|
| 96 |
]
|
| 97 |
|
| 98 |
# Build Gradio interface
|
|
|
|
| 195 |
""")
|
| 196 |
|
| 197 |
# Examples section
|
| 198 |
+
gr.Markdown("### 📝 Example")
|
| 199 |
gr.Examples(
|
| 200 |
+
examples=example_data,
|
| 201 |
+
inputs=[input_image, prompt, negative_prompt, guidance_scale, num_inference_steps, seed],
|
| 202 |
+
outputs=output_image,
|
| 203 |
+
fn=edit_image,
|
| 204 |
+
cache_examples=False,
|
| 205 |
+
label="Click to try this example"
|
| 206 |
)
|
| 207 |
|
| 208 |
# Event handlers
|