Update app.py
Browse files
app.py
CHANGED
|
@@ -43,10 +43,10 @@ def resize_image_dimensions(
|
|
| 43 |
) -> Tuple[int, int]:
|
| 44 |
width, height = original_resolution_wh
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
|
| 51 |
# if width > height:
|
| 52 |
# scaling_factor = maximum_dimension / width
|
|
@@ -73,9 +73,7 @@ def process(
|
|
| 73 |
num_influence: float,
|
| 74 |
progress=gr.Progress(track_tqdm=True)
|
| 75 |
):
|
| 76 |
-
|
| 77 |
-
gr.Info("Please enter a text prompt.")
|
| 78 |
-
return None, None
|
| 79 |
input_text = "A military COR2 "+input_text
|
| 80 |
image = input_image_editor['background']
|
| 81 |
mask = input_image_editor['layers'][0]
|
|
@@ -106,7 +104,8 @@ def process(
|
|
| 106 |
guidance_scale=3.5,
|
| 107 |
)
|
| 108 |
print('INFERENCE DONE')
|
| 109 |
-
return result.images[0].resize((image.size), Image.LANCZOS), result.images[1].resize((image.size), Image.LANCZOS)
|
|
|
|
| 110 |
|
| 111 |
#resized_mask = mask.resize((width, height), Image.LANCZOS)
|
| 112 |
|
|
|
|
| 43 |
) -> Tuple[int, int]:
|
| 44 |
width, height = original_resolution_wh
|
| 45 |
|
| 46 |
+
#if width <= maximum_dimension and height <= maximum_dimension:
|
| 47 |
+
# width = width - (width % 32)
|
| 48 |
+
# height = height - (height % 32)
|
| 49 |
+
# return width, height
|
| 50 |
|
| 51 |
# if width > height:
|
| 52 |
# scaling_factor = maximum_dimension / width
|
|
|
|
| 73 |
num_influence: float,
|
| 74 |
progress=gr.Progress(track_tqdm=True)
|
| 75 |
):
|
| 76 |
+
|
|
|
|
|
|
|
| 77 |
input_text = "A military COR2 "+input_text
|
| 78 |
image = input_image_editor['background']
|
| 79 |
mask = input_image_editor['layers'][0]
|
|
|
|
| 104 |
guidance_scale=3.5,
|
| 105 |
)
|
| 106 |
print('INFERENCE DONE')
|
| 107 |
+
#return result.images[0].resize((image.size), Image.LANCZOS), result.images[1].resize((image.size), Image.LANCZOS)
|
| 108 |
+
return result.images[0], result.images[1]
|
| 109 |
|
| 110 |
#resized_mask = mask.resize((width, height), Image.LANCZOS)
|
| 111 |
|