Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,10 +34,10 @@ def call_openai_image_api(prompt: str, api_key: str, input_image: Image.Image |
|
|
| 34 |
size = "1024x1024"
|
| 35 |
|
| 36 |
try:
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
|
| 42 |
# Convert PIL Image to bytes for the API request
|
| 43 |
byte_stream = io.BytesIO()
|
|
|
|
| 34 |
size = "1024x1024"
|
| 35 |
|
| 36 |
try:
|
| 37 |
+
if input_image:
|
| 38 |
+
# --- Image Editing ---
|
| 39 |
+
if not isinstance(input_image, Image.Image):
|
| 40 |
+
return None, None, "Error: Invalid image provided for editing."
|
| 41 |
|
| 42 |
# Convert PIL Image to bytes for the API request
|
| 43 |
byte_stream = io.BytesIO()
|