Spaces:
Runtime error
Runtime error
francescoKrnl
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -35,7 +35,10 @@ def pil_image_to_data_uri(img, format='PNG'):
|
|
35 |
def run(image, item_name):
|
36 |
print("sketch updated")
|
37 |
print(image)
|
38 |
-
|
|
|
|
|
|
|
39 |
ones = Image.new("L", (512, 512), 255)
|
40 |
return ones
|
41 |
print(item_name.split()[1])
|
|
|
35 |
def run(image, item_name):
|
36 |
print("sketch updated")
|
37 |
print(image)
|
38 |
+
empty_image = Image.new("L", (512, 512), 255)
|
39 |
+
diff = ImageChops.difference(image, empty_image)
|
40 |
+
# if image["composite"] is None:
|
41 |
+
if not diff.getbbox():
|
42 |
ones = Image.new("L", (512, 512), 255)
|
43 |
return ones
|
44 |
print(item_name.split()[1])
|