Spaces:
Sleeping
Sleeping
Commit ·
d2383e6
1
Parent(s): cdedd76
app.py
CHANGED
|
@@ -16,14 +16,13 @@ def image_to_data_uri(image_path):
|
|
| 16 |
return f"data:{mime};base64,{data}"
|
| 17 |
|
| 18 |
|
| 19 |
-
def edit_images(
|
| 20 |
-
*imgs, prompt, token = args
|
| 21 |
if not token:
|
| 22 |
raise gr.Error("Please sign in with your Hugging Face account first.")
|
| 23 |
if not prompt or prompt.strip() == "":
|
| 24 |
raise gr.Error("Please enter a prompt.")
|
| 25 |
|
| 26 |
-
images = [img for img in
|
| 27 |
if len(images) == 0:
|
| 28 |
raise gr.Error("Please upload at least one image.")
|
| 29 |
|
|
|
|
| 16 |
return f"data:{mime};base64,{data}"
|
| 17 |
|
| 18 |
|
| 19 |
+
def edit_images(img1, img2, img3, img4, img5, prompt, token: gr.OAuthToken | None = None):
|
|
|
|
| 20 |
if not token:
|
| 21 |
raise gr.Error("Please sign in with your Hugging Face account first.")
|
| 22 |
if not prompt or prompt.strip() == "":
|
| 23 |
raise gr.Error("Please enter a prompt.")
|
| 24 |
|
| 25 |
+
images = [img for img in [img1, img2, img3, img4, img5] if img is not None]
|
| 26 |
if len(images) == 0:
|
| 27 |
raise gr.Error("Please upload at least one image.")
|
| 28 |
|