Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -43,13 +43,13 @@ def pred_func(image, prompt):
|
|
43 |
if type(out) == type({}):
|
44 |
#return out["spiga_seg"]
|
45 |
control_image = out["spiga_seg"]
|
46 |
-
if type(
|
47 |
-
|
48 |
elif hasattr(image, "shape"):
|
49 |
-
|
50 |
else:
|
51 |
-
|
52 |
-
|
53 |
|
54 |
generator = torch.manual_seed(0)
|
55 |
image = pipe(
|
|
|
43 |
if type(out) == type({}):
|
44 |
#return out["spiga_seg"]
|
45 |
control_image = out["spiga_seg"]
|
46 |
+
if type(control_image) == type("") and os.path.exists(control_image):
|
47 |
+
control_image = Image.open(control_image).convert("RGB")
|
48 |
elif hasattr(image, "shape"):
|
49 |
+
control_image = Image.fromarray(control_image).convert("RGB")
|
50 |
else:
|
51 |
+
control_image = control_image.convert("RGB")
|
52 |
+
control_image = control_image.resize((512, 512))
|
53 |
|
54 |
generator = torch.manual_seed(0)
|
55 |
image = pipe(
|