Spaces:
Sleeping
Sleeping
Alexandros Popov
commited on
Commit
·
9b232e0
1
Parent(s):
94bbb76
raw logs.
Browse files
app.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 1 |
-
import contextlib
|
| 2 |
-
import io
|
| 3 |
import os
|
| 4 |
import tempfile
|
| 5 |
|
|
@@ -17,20 +15,17 @@ def process_image_with_agents(image: Image.Image, prompt: str):
|
|
| 17 |
|
| 18 |
yield [image], "Original image uploaded. Starting enhancement…"
|
| 19 |
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
output_directory=output_directory,
|
| 26 |
-
)
|
| 27 |
|
| 28 |
# Find all images in temp_dir (sorted by name)
|
| 29 |
image_files = sorted([os.path.join(temp_dir, f) for f in os.listdir(temp_dir) if f.endswith((".jpg", ".png"))])
|
| 30 |
images = [Image.open(p) for p in image_files]
|
| 31 |
|
| 32 |
-
|
| 33 |
-
yield images, f"✅ Enhancement finished.\n\n--- Agent Logs ---\n{logs}"
|
| 34 |
|
| 35 |
|
| 36 |
with gr.Blocks(title="AI Art Director • Agent Workflow") as demo:
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import tempfile
|
| 3 |
|
|
|
|
| 15 |
|
| 16 |
yield [image], "Original image uploaded. Starting enhancement…"
|
| 17 |
|
| 18 |
+
run_photo_enchancement_agent(
|
| 19 |
+
prompt,
|
| 20 |
+
image_path=input_path,
|
| 21 |
+
output_directory=output_directory,
|
| 22 |
+
)
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# Find all images in temp_dir (sorted by name)
|
| 25 |
image_files = sorted([os.path.join(temp_dir, f) for f in os.listdir(temp_dir) if f.endswith((".jpg", ".png"))])
|
| 26 |
images = [Image.open(p) for p in image_files]
|
| 27 |
|
| 28 |
+
yield images, "Enhancement finished."
|
|
|
|
| 29 |
|
| 30 |
|
| 31 |
with gr.Blocks(title="AI Art Director • Agent Workflow") as demo:
|