[Fooocus 2.0.60] Fooocus Inpaint or Outpaint (Midjourney Left/Right/Top/Bottom) (#402)

[Fooocus 2.0.60] Fooocus Inpaint or Outpaint (Midjourney Left/Right/Top/Bottom) (#402)
This commit is contained in:
lllyasviel
2023-09-18 01:16:07 -07:00
committed by GitHub
parent 43e59c1676
commit b61642ecba
11 changed files with 572 additions and 53 deletions
+6
View File
@@ -28,6 +28,12 @@ def image_is_generated_in_current_ui(image, ui_width, ui_height):
LANCZOS = (Image.Resampling.LANCZOS if hasattr(Image, 'Resampling') else Image.LANCZOS)
def resample_image(im, width, height):
im = Image.fromarray(im)
im = im.resize((width, height), resample=LANCZOS)
return np.array(im)
def resize_image(im, width, height, resize_mode=1):
"""
Resizes an image with the specified resize_mode, width, and height.