Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -119,9 +119,21 @@ def generate(image, prompt_user, progress=gr.Progress(track_tqdm=True)):
|
|
119 |
prompt = prompt_structure + prompt_user
|
120 |
|
121 |
# Process input image
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
# Generate output
|
126 |
out = pipe(
|
127 |
prompt=prompt,
|
|
|
119 |
prompt = prompt_structure + prompt_user
|
120 |
|
121 |
# Process input image
|
122 |
+
try:
|
123 |
+
cropped_image = square_center_crop(image)
|
124 |
+
except Exception as e:
|
125 |
+
error_message = f"Error during cropping: {str(e)}"
|
126 |
+
print(error_message) # For logging
|
127 |
+
raise gr.Error(error_message)
|
128 |
+
|
129 |
+
try:
|
130 |
+
logo_dupli = duplicate_horizontally(cropped_image)
|
131 |
+
except Exception as e:
|
132 |
+
error_message = f"Error during duplication: {str(e)}"
|
133 |
+
print(error_message) # For logging
|
134 |
+
raise gr.Error(error_message)
|
135 |
+
|
136 |
+
print("just before getting into pipe")
|
137 |
# Generate output
|
138 |
out = pipe(
|
139 |
prompt=prompt,
|