Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,10 @@ import torch
|
|
3 |
import spaces
|
4 |
import gradio as gr
|
5 |
from diffusers import FluxFillPipeline
|
6 |
-
from diffusers.utils import load_image
|
7 |
import random
|
8 |
import numpy as np
|
9 |
from huggingface_hub import hf_hub_download
|
|
|
10 |
|
11 |
|
12 |
CSS = """
|
@@ -65,10 +65,10 @@ def inpaintGen(
|
|
65 |
if not mask_path:
|
66 |
raise gr.Error("Please draw a mask on the image.")
|
67 |
|
68 |
-
source_img =
|
69 |
-
mask_img =
|
70 |
|
71 |
-
mask_img = create_mask_image(mask_img)
|
72 |
|
73 |
width, height = source_img.size
|
74 |
|
|
|
3 |
import spaces
|
4 |
import gradio as gr
|
5 |
from diffusers import FluxFillPipeline
|
|
|
6 |
import random
|
7 |
import numpy as np
|
8 |
from huggingface_hub import hf_hub_download
|
9 |
+
from PIL import Image, ImageOps
|
10 |
|
11 |
|
12 |
CSS = """
|
|
|
65 |
if not mask_path:
|
66 |
raise gr.Error("Please draw a mask on the image.")
|
67 |
|
68 |
+
source_img = Image.open(source_path).convert("RGB")
|
69 |
+
mask_img = Image.open(mask_path).convert('L')
|
70 |
|
71 |
+
#mask_img = create_mask_image(mask_img)
|
72 |
|
73 |
width, height = source_img.size
|
74 |
|